docs.unity3d.com
    Show / Hide Table of Contents

    Class XRObjectTrackingSubsystem

    Base class for object tracking subsystems.

    Inheritance
    Object
    Subsystem
    Subsystem<XRObjectTrackingSubsystemDescriptor>
    XRSubsystem<XRObjectTrackingSubsystemDescriptor>
    TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystemDescriptor>
    XRObjectTrackingSubsystem
    Inherited Members
    TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystemDescriptor>.GetChanges(Allocator)
    XRSubsystem<XRObjectTrackingSubsystemDescriptor>.running
    XRSubsystem<XRObjectTrackingSubsystemDescriptor>.OnDestroy()
    XRSubsystem<XRObjectTrackingSubsystemDescriptor>.Start()
    XRSubsystem<XRObjectTrackingSubsystemDescriptor>.Stop()
    Subsystem<XRObjectTrackingSubsystemDescriptor>.SubsystemDescriptor
    Subsystem.Destroy()
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public abstract class XRObjectTrackingSubsystem : TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystemDescriptor>, ISubsystem
    Remarks

    This subsystem allows real objects to be recognized in the environment. You must first specify a library of "reference objects" to search for. These reference objects are typically in a format specific to a particular implementation; see the documentation for the implementing subsystem for further instructions.

    Constructors

    XRObjectTrackingSubsystem()

    Constructs an object tracking subsystem. Do not invoked directly; call Create on the XRObjectTrackingSubsystemDescriptor instead.

    Declaration
    public XRObjectTrackingSubsystem()

    Properties

    library

    The library of reference objects for which to scan. This must be set to non-null before calling OnStart().

    Declaration
    public XRReferenceObjectLibrary library { get; set; }
    Property Value
    Type Description
    XRReferenceObjectLibrary
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if you set the library to null while the subsystem is running.

    Methods

    CreateProvider()

    Should create an instance of XRObjectTrackingSubsystem.Provider, which contains the implementation for a specific XRObjectTrackingSubsystem.

    Declaration
    protected abstract XRObjectTrackingSubsystem.Provider CreateProvider()
    Returns
    Type Description
    XRObjectTrackingSubsystem.Provider

    A new XRObjectTrackingSubsystem.Provider containing a concrete implementation of this API.

    GetChanges(Allocator)

    Get changes (added, updated, and removed) to XRTrackedObjects since the last call to this method. The caller owns the memory allocated with allocator.

    Declaration
    public override sealed TrackableChanges<XRTrackedObject> GetChanges(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The allocator to use for the returned arrays of changes.

    Returns
    Type Description
    TrackableChanges<XRTrackedObject>

    A new TrackableChanges<T> allocated with allocator. The caller owns the memory and is responsible for calling Dispose on it.

    Overrides
    UnityEngine.XR.ARSubsystems.TrackingSubsystem<UnityEngine.XR.ARSubsystems.XRTrackedObject, UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystemDescriptor>.GetChanges(Unity.Collections.Allocator)

    OnDestroyed()

    Destroys the subsystem.

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

    OnStart()

    Starts scanning for the reference objects in library.

    Declaration
    protected override sealed void OnStart()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystemDescriptor>.OnStart()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if library is null.

    OnStop()

    Stops scanning for objects.

    Declaration
    protected override sealed void OnStop()
    Overrides
    UnityEngine.XR.ARSubsystems.XRSubsystem<UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystemDescriptor>.OnStop()

    Register<T>(String, XRObjectTrackingSubsystemDescriptor.Capabilities)

    Registers a novel implementation of the XRObjectTrackingSubsystem.

    Declaration
    public static void Register<T>(string id, XRObjectTrackingSubsystemDescriptor.Capabilities capabilities)
        where T : XRObjectTrackingSubsystem
    Parameters
    Type Name Description
    String id

    A unique string identifying the subsystem implementation.

    XRObjectTrackingSubsystemDescriptor.Capabilities capabilities

    Describes the capabilities of the implementation.

    Type Parameters
    Name Description
    T

    The concrete type of the subsystem being registered.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if id is null.

    Back to top
    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