Skip to main content
Version: 21 Aug 2024

PlaneBoundaryCollection

Represents a collection of concave BoundedPlane boundaries obtained from MagicLeapPlaneSubsystem.GetAllBoundariesForPlane(TrackableId). More...

Inherits from:
IEquatable< PlaneBoundaryCollection >

Detailed Description

public struct PlaneBoundaryCollection : IEquatable< PlaneBoundaryCollection > 

Details*

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 BoundedPlane s, 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.

.

See: MagicLeapPlaneSubsystem.GetPlaneBoundaries(TrackableId)


Public Fields

count

The number of boundaries in this collection.


public int count { get; set; }


this[int index]

Attempts to get the plane boundary at index and, if successful, copies it to boundaryOut . boundaryOut is resized or created using if necessary.


public PlaneBoundary this[int index] { get; set; }

TypeDescription
PlaneBoundaryContainer 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.

Parameters

TypeNameDescription
indexThe index of the boundary to retrieve.
allocatorThe Allocator to use if _boundaryOut_ must be recreated. Must be Allocator.TempJob or Allocator.Persistent .
boundaryOutA NativeArray to fill with boundary points. If the array is not the correct size, it is disposed and recreated. If this method returns false , boundaryOut is unchanged.

Exceptions:

  • System.InvalidOperationException Thrown if valid is false .
  • System.InvalidOperationException Thrown if _allocator_ is Allocator.Temp or Allocator.None .
  • System.ArgumentOutOfRangeException Thrown if _index_ is less than zero or greater than or equal to count.

Returns: true if the boundary was successfully retrieved and boundaryOut was populated; otherwise, false .


valid

Whether this collection is valid or not. Check for validity before using the index operator.


public bool valid { get; set; }


Public Methods

override bool Equals

IEquatable interface. Compares for equality.

public override bool Equals(
object obj
)

Parameters

TypeNameDescription
objectobjThe object to compare for equality.

Returns: true if obj is of type PlaneBoundaryCollection and compares equal with Equals(PlaneBoundaryCollection).


bool Equals

IEquatable interface. Comapres for equality.

public bool Equals(
PlaneBoundaryCollection other
)

Parameters

TypeNameDescription
PlaneBoundaryCollectionotherThe PlaneBoundaryCollection to compare against.

Returns: true if all fields of this PlaneBoundaryCollection compare equal to other .


Enumerator 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.

public Enumerator GetEnumerator()

Returns: An Enumerator compatible with a duck-typed foreach.


override int GetHashCode

Computes a hash code suitable for use in a Dictionary or HashSet .

public override int GetHashCode()

Returns: A hash code suitable for use in a Dictionary or HashSet .


bool operator!=

Comapres for inequality. Same as ! Equals(PlaneBoundaryCollection).

public static bool operator!=(
PlaneBoundaryCollection lhs,
PlaneBoundaryCollection rhs
)

Parameters

TypeNameDescription
PlaneBoundaryCollectionlhsThe left-hand side of the comparison.
PlaneBoundaryCollectionrhsThe right-hand side of the comparison.

Returns: true if any of the fields of this PlaneBoundaryCollection are not equal to other .


bool operator==

Comapres for equality. Same as Equals(PlaneBoundaryCollection).

public static bool operator==(
PlaneBoundaryCollection lhs,
PlaneBoundaryCollection rhs
)

Parameters

TypeNameDescription
PlaneBoundaryCollectionlhsThe left-hand side of the comparison.
PlaneBoundaryCollectionrhsThe right-hand side of the comparison.

Returns: true if all fields of this PlaneBoundaryCollection compare equal to other .


Public Attributes

m_Boundaries


public NativeArray< Extensions.MLPlaneBoundary > m_Boundaries;


m_Pose


public Pose m_Pose;