Class XRPlaneSubsystem
This subsystem provides information regarding the detection of planes (that is, flat surfaces) in the real-world environment.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine .XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRPlaneSubsystem : TrackingSubsystem<BoundedPlane, XRPlaneSubsystem, XRPlaneSubsystemDescriptor, XRPlaneSubsystem.Provider>, ISubsystem
Remarks
This is a base class with an abstract provider type to be implemented by provider plug-in packages. This class itself does not implement plane detection.
Constructors
XRPlaneSubsystem()
Do not invoke this constructor directly.
Declaration
public XRPlaneSubsystem()
Remarks
If you are implementing your own custom subsystem Lifecycle management,
use the Subsystem
Properties
currentPlaneDetectionMode
Get the current Plane
Declaration
public PlaneDetectionMode currentPlaneDetectionMode { get; }
Property Value
Type | Description |
---|---|
Plane |
requestedPlaneDetectionMode
Get or set the requested Plane
Declaration
public PlaneDetectionMode requestedPlaneDetectionMode { get; set; }
Property Value
Type | Description |
---|---|
Plane |
Exceptions
Type | Condition |
---|---|
Not |
Thrown if requested |
Methods
CreateOrResizeNativeArrayIfNecessary<T>(int, Allocator, ref NativeArray<T>)
Creates or resizes the array
if necessary. If array
has been allocated
and its length is equal to length
, then this method does nothing. If its length is
different, then it is first disposed before being assigned to a new NativeArray
.
Declaration
protected static void CreateOrResizeNativeArrayIfNecessary<T>(int length, Allocator allocator, ref NativeArray<T> array) where T : struct
Parameters
Type | Name | Description |
---|---|---|
int | length | The length that |
Allocator | allocator | If allocation is necessary, this allocator will be used to create the new |
Native |
array | The array to create or resize. |
Type Parameters
Name | Description |
---|---|
T | The type of elements held by the |
GetBoundary(TrackableId, Allocator, ref NativeArray<Vector2>)
Gets the boundary vertices of a given Bounded
Declaration
public void GetBoundary(TrackableId trackableId, Allocator allocator, ref NativeArray<Vector2> boundary)
Parameters
Type | Name | Description |
---|---|---|
Trackable |
trackableId | The Trackable |
Allocator | allocator | An Allocator to use if |
Native |
boundary | The boundary vertices will be stored here. If the given array is the same length as the number of vertices, it is overwritten with the new data. Otherwise, it is disposed and recreated with the correct length. |
GetChanges(Allocator)
Gets a TrackableTrackableChanges
instance.
Declaration
public override TrackableChanges<BoundedPlane> GetChanges(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | An |
Returns
Type | Description |
---|---|
Trackable |
The Trackable |
Overrides
Remarks
The Trackableallocator
.