docs.unity3d.com
    Show / Hide Table of Contents

    Class XRDepthSubsystem

    An abstract class that provides a generic API for low-level depth detection features.

    Inheritance
    Object
    Subsystem
    Subsystem<XRDepthSubsystemDescriptor>
    XRSubsystem<XRDepthSubsystemDescriptor>
    TrackingSubsystem<XRPointCloud, XRDepthSubsystemDescriptor>
    XRDepthSubsystem
    XRDepthSubsystemImpl
    Inherited Members
    TrackingSubsystem<XRPointCloud, XRDepthSubsystemDescriptor>.GetChanges(Allocator)
    XRSubsystem<XRDepthSubsystemDescriptor>.running
    XRSubsystem<XRDepthSubsystemDescriptor>.OnDestroy()
    XRSubsystem<XRDepthSubsystemDescriptor>.Start()
    XRSubsystem<XRDepthSubsystemDescriptor>.Stop()
    Subsystem<XRDepthSubsystemDescriptor>.SubsystemDescriptor
    Subsystem.Destroy()
    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()

    Properties

    provider

    The provider created by the implementation that contains the required depth functionality.

    Declaration
    protected XRDepthSubsystem.Provider provider { get; }
    Property Value
    Type Description
    XRDepthSubsystem.Provider

    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 Allocator to use when allocating the returned NativeArrays.

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

    Overrides
    UnityEngine.XR.ARSubsystems.TrackingSubsystem<UnityEngine.XR.ARSubsystems.XRPointCloud, UnityEngine.XR.ARSubsystems.XRDepthSubsystemDescriptor>.GetChanges(Unity.Collections.Allocator)

    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 NativeArrays in the returned XRPointCloudData. Allocator.Temp is not supported; use Allocator.TempJob if you need temporary memory.

    Returns
    Type Description
    XRPointCloudData

    A new XRPointCloudData with newly allocated NativeArrays using allocator. The caller owns the memory and is responsible for calling Dispose() on it.

    OnDestroyed()

    Destroy the depth subsystem.

    Declaration
    protected sealed override void OnDestroyed()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRDepthSubsystemDescriptor>.OnDestroyed()

    OnStart()

    Start the depth subsystem, i.e., start collecting depth data.

    Declaration
    protected sealed override void OnStart()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRDepthSubsystemDescriptor>.OnStart()

    OnStop()

    Stop the subsystem, i.e., stop collecting depth data.

    Declaration
    protected sealed override void OnStop()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRDepthSubsystemDescriptor>.OnStop()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023