Class XRObjectTrackingSubsystem
Base class for object tracking subsystems.
Inheritance
Implements
Inherited Members
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 XRObject
Declaration
public XRObjectTrackingSubsystem()
Properties
library
The library of reference objects for which to scan. This must be set to non-null
before calling On
Declaration
public XRReferenceObjectLibrary library { get; set; }
Property Value
Type | Description |
---|---|
XRReference |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if you set the library to |
Methods
GetChanges(Allocator)
Get changes to XRTrackedallocator
.
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 |
---|---|
Trackable |
A new Trackable |
Overrides
OnStart()
Starts scanning for the reference objects in library.
Declaration
protected override sealed void OnStart()
Overrides
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if library is |
OnStop()
Stops scanning for objects.
Declaration
protected override sealed void OnStop()
Overrides
Register<T>(string, Capabilities)
Registers an implementation of the XRObject
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. |
XRObject |
capabilities | Describes the capabilities of the implementation. |
Type Parameters
Name | Description |
---|---|
T | The concrete type of the subsystem being registered. |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |
Register<TProvider, TSubsystemOverride>(string, Capabilities)
Registers a new implementation of the XRObjectXRObjectTrackingSubsystem
.
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. |
XRObject |
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 |
---|---|
Argument |
Thrown if |