Class XRDepthSubsystem
An abstract class that provides a generic API for low-level depth detection features.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public abstract class XRDepthSubsystem : TrackingSubsystem<XRPointCloud, XRDepthSubsystemDescriptor>, ISubsystem
Remarks
This class can be used to access depth detection features in your app via accessing the generic API. It can also be extended to provide an implementation of a provider which provides the depth detection data to the higher level code.
Constructors
XRDepthSubsystem()
Constructs a depth subsystem. Do not invoked directly; call Create
on the XRDepthSubsystemDescriptor instead.
Declaration
protected XRDepthSubsystem()
Methods
CreateProvider()
Implement this and return an instance of the XRDepthSubsystem.Provider.
Declaration
protected abstract XRDepthSubsystem.Provider CreateProvider()
Returns
Type | Description |
---|---|
XRDepthSubsystem.Provider | An implementation of the XRDepthSubsystem.Provider. |
GetChanges(Allocator)
Get the changes (added, updated, and removed) point clouds since the last call to GetChanges(Allocator).
Declaration
public override TrackableChanges<XRPointCloud> GetChanges(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | An |
Returns
Type | Description |
---|---|
TrackableChanges<XRPointCloud> | TrackableChanges<T> describing the point clouds that have been added, updated, and removed
since the last call to GetChanges(Allocator). The caller owns the memory allocated with |
Overrides
GetPointCloudData(TrackableId, Allocator)
Retrieve point cloud data (positions, confidence values, and identifiers)
for the point cloud with the given trackableId
.
Declaration
public XRPointCloudData GetPointCloudData(TrackableId trackableId, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The point cloud for which to retrieve data. |
Allocator | allocator | The allocator to use when creating the |
Returns
Type | Description |
---|---|
XRPointCloudData | A new XRPointCloudData with newly allocated |
OnDestroyed()
Destroy the depth subsystem.
Declaration
protected override sealed void OnDestroyed()
Overrides
OnStart()
Start the depth subsystem, i.e., start collecting depth data.
Declaration
protected override sealed void OnStart()
Overrides
OnStop()
Stop the subsystem, i.e., stop collecting depth data.
Declaration
protected override sealed void OnStop()