docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRObjectTrackingSubsystem

    Base class for object tracking subsystems.

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>
    TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>
    XRObjectTrackingSubsystem
    Implements
    ISubsystem
    Inherited Members
    TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.GetChanges(Allocator)
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.OnCreate()
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.OnStart()
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.OnStop()
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.OnDestroy()
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.subsystemDescriptor
    SubsystemWithProvider<XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.provider
    SubsystemWithProvider.Start()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.OnDestroy()
    SubsystemWithProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public class XRObjectTrackingSubsystem : TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>, 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

    GetChanges(Allocator)

    Get changes to XRTrackedObjects (added, updated, and removed) 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
    TrackingSubsystem<XRTrackedObject, XRObjectTrackingSubsystem, XRObjectTrackingSubsystemDescriptor, XRObjectTrackingSubsystem.Provider>.GetChanges(Allocator)

    OnStart()

    Starts scanning for the reference objects in library.

    Declaration
    protected override sealed void OnStart()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystem, UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystem.Provider>.OnStart()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if library is null.

    OnStop()

    Stops scanning for objects.

    Declaration
    protected override sealed void OnStop()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystem, UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRObjectTrackingSubsystem.Provider>.OnStop()

    Register<T>(string, Capabilities)

    Registers an implementation of the XRObjectTrackingSubsystem.

    Declaration
    [Obsolete("XRObjectTrackingSubsystem.Register<T>(string id, XRObjectTrackingSubsystemDescriptor.Capabilities capabilities) has been deprecated in AR Foundation version 6.0. Instead use XRObjectTrackingSubsystemDescriptor.Register(XRObjectTrackingSubsystemDescriptor.Cinfo cinfo)", false)]
    public static void Register<T>(string id, XRObjectTrackingSubsystemDescriptor.Capabilities capabilities) where T : XRObjectTrackingSubsystem.Provider
    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.

    Register<TProvider, TSubsystemOverride>(string, Capabilities)

    Registers a new implementation of the XRObjectTrackingSubsystem. Allows overriding a derived type of XRObjectTrackingSubsystem.

    Declaration
    [Obsolete("XRObjectTrackingSubsystem.Register<TProvider, TSubsystemOverride>(string id, XRObjectTrackingSubsystemDescriptor.Capabilities capabilities) has been deprecated in AR Foundation version 6.0. Instead use XRObjectTrackingSubsystemDescriptor.Register(XRObjectTrackingSubsystemDescriptor.Cinfo cinfo)", false)]
    public static void Register<TProvider, TSubsystemOverride>(string id, XRObjectTrackingSubsystemDescriptor.Capabilities capabilities) where TProvider : XRObjectTrackingSubsystem.Provider where TSubsystemOverride : 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
    TProvider

    The concrete type of the provider being registered.

    TSubsystemOverride

    The concrete type of the subsystem being registered.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if id is null.

    Implements

    ISubsystem
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)