Struct PlaneBoundaryCollection
Represents a collection of concave BoundedPlane boundaries obtained from
GetAllBoundariesForPlane(TrackableId).
Implements
Inherited Members
Namespace: UnityEngine.XR.MagicLeap
Assembly: UnityEngine.XR.MagicLeap.dll
Syntax
public struct PlaneBoundaryCollection : IEquatable<PlaneBoundaryCollection>
Remarks
Each Magic Leap plane can have multiple plane boundaries. This collection
represents the set of all boundaries associated with a particular plane.
Note that unlike most boundaries associated with BoundedPlanes,
these are not necessarily convex.
The plane boundaries are tied to native resources which are managed
by the MagicLeapPlaneSubsystem. Typically, a PlaneBoundaryCollection
is only valid until the next call to
MagicLeapPlaneSubsystem.GetChanges(BoundedPlane, Allocator),
so you should not hold onto an instance of this struct past a frame boundary.
Properties
this[int]
Attempts to get the plane boundary at index index and, if successful, copies it to boundaryOut.
boundaryOut is resized or created using allocator if necessary.
Declaration
public PlaneBoundary this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the boundary to retrieve. |
Property Value
| Type | Description |
|---|---|
| PlaneBoundary |
|
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown if valid is |
| InvalidOperationException | Thrown if |
| ArgumentOutOfRangeException | Thrown if |
count
The number of boundaries in this collection.
Declaration
public int count { get; }
Property Value
| Type | Description |
|---|---|
| int |
valid
Whether this collection is valid or not. Check for validity before using the index operator.
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(PlaneBoundaryCollection)
IEquatable interface. Comapres for equality.
Declaration
public bool Equals(PlaneBoundaryCollection other)
Parameters
| Type | Name | Description |
|---|---|---|
| PlaneBoundaryCollection | other | The PlaneBoundaryCollection to compare against. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetEnumerator()
Get an enumerator, compatible with a duck-typed foreach. You typically would not call
this directly, but is used by the compiler in a foreach statement.
Declaration
public PlaneBoundaryCollection.Enumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| PlaneBoundaryCollection.Enumerator | An Enumerator compatible with a duck-typed foreach. |
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
Operators
operator ==(PlaneBoundaryCollection, PlaneBoundaryCollection)
Comapres for equality. Same as Equals(PlaneBoundaryCollection).
Declaration
public static bool operator ==(PlaneBoundaryCollection lhs, PlaneBoundaryCollection rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| PlaneBoundaryCollection | lhs | The left-hand side of the comparison. |
| PlaneBoundaryCollection | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(PlaneBoundaryCollection, PlaneBoundaryCollection)
Comapres for inequality. Same as !Equals(PlaneBoundaryCollection).
Declaration
public static bool operator !=(PlaneBoundaryCollection lhs, PlaneBoundaryCollection rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| PlaneBoundaryCollection | lhs | The left-hand side of the comparison. |
| PlaneBoundaryCollection | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool |
|