Struct PlaneBoundary
Container for the boundary of a detected planar surface. This is specific to Magic Leap because the polygon describing the boundary may be concave, and may contain holes.
Implements
Inherited Members
Namespace: UnityEngine .XR.MagicLeap
Assembly: UnityEngine.XR.MagicLeap.dll
Syntax
public struct PlaneBoundary : IEquatable<PlaneBoundary>
Properties
holeCount
The number of holes in this boundary.
Declaration
public int holeCount { get; }
Property Value
Type | Description |
---|---|
int |
polygonVertexCount
The number of vertices in this boundary's polygon.
Declaration
public readonly int polygonVertexCount { get; }
Property Value
Type | Description |
---|---|
int |
valid
Whether this Plane
Declaration
public bool valid { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Equals(object)
IEquatable interface. Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare for equality. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Equals(PlaneBoundary)
IEquatable interface. Compares for equality.
Declaration
public bool Equals(PlaneBoundary other)
Parameters
Type | Name | Description |
---|---|---|
Plane |
other | The Plane |
Returns
Type | Description |
---|---|
bool |
|
GetHashCode()
Computes a hash code suitable for use in a Dictionary
or HashSet
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code suitable for use in a |
Overrides
GetHole(int, Allocator)
Get the polygon representing a hole in this boundary. The 2D vertices are in plane-space.
Declaration
public NativeArray<Vector2> GetHole(int index, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the hole. Must be less than hole |
Allocator | allocator | The allocator to use for the returned NativeArray.
Must be |
Returns
Type | Description |
---|---|
Native |
A new NativeArray allocated with |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if valid is false. |
Invalid |
Thrown if |
Argument |
Thrown if |
GetHole(int, Allocator, ref NativeArray<Vector2>)
Get the polygon representing a hole in this boundary. The 2D vertices are in plane-space.
Declaration
public void GetHole(int index, Allocator allocator, ref NativeArray<Vector2> polygonOut)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the hole. Must be less than hole |
Allocator | allocator | The allocator to use if |
Native |
polygonOut | The resulting polygon describing the hole at |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if valid is false. |
Invalid |
Thrown if |
Argument |
Thrown if |
GetPolygon(Allocator)
Gets the polygon representing this boundary. The 2D vertices are in plane-space.
Declaration
public NativeArray<Vector2> GetPolygon(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The allocator to use for the returned NativeArray. Must be |
Returns
Type | Description |
---|---|
Native |
A new NativeArray containing a set of 2D points in plane-space representing a boundary for a plane. The caller is responsible for disposing the NativeArray. |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if valid is |
Invalid |
Thrown if |
GetPolygon(Allocator, ref NativeArray<Vector2>)
Gets the polygon representing a plane's boundary, and, if successful, copies it to polygonOut
.
polygonOut
is resized or created using allocator
if necessary.
The 2D vertices are in plane-space.
Declaration
public void GetPolygon(Allocator allocator, ref NativeArray<Vector2> polygonOut)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The Allocator to use if |
Native |
polygonOut | A NativeArray to fill with boundary points. If the array is not the correct size, it is disposed and recreated. |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if valid is |
Invalid |
Thrown if |
Operators
operator ==(PlaneBoundary, PlaneBoundary)
Compares for equality. Same as Equals(Plane
Declaration
public static bool operator ==(PlaneBoundary lhs, PlaneBoundary rhs)
Parameters
Type | Name | Description |
---|---|---|
Plane |
lhs | The left-hand side of the comparison. |
Plane |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(PlaneBoundary, PlaneBoundary)
Compares for inequality. Same as !
Equals(Plane
Declaration
public static bool operator !=(PlaneBoundary lhs, PlaneBoundary rhs)
Parameters
Type | Name | Description |
---|---|---|
Plane |
lhs | The left-hand side of the comparison. |
Plane |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|