Class XRImageTrackingSubsystem
A subsystem for detecting and tracking a preconfigured set of images in the environment.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine .XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRImageTrackingSubsystem : TrackingSubsystem<XRTrackedImage, XRImageTrackingSubsystem, XRImageTrackingSubsystemDescriptor, XRImageTrackingSubsystem.Provider>, ISubsystem
Constructors
XRImageTrackingSubsystem()
Constructs a subsystem. Do not invoke directly; call Create
on the XRImage
Declaration
public XRImageTrackingSubsystem()
Properties
currentMaxNumberOfMovingImages
The current maximum number of moving images to track.
This can be different from requested
Declaration
public int currentMaxNumberOfMovingImages { get; }
Property Value
Type | Description |
---|---|
int |
imageLibrary
Get or set the reference image library. This is the set of images to look for in the environment.
Declaration
public RuntimeReferenceImageLibrary imageLibrary { get; set; }
Property Value
Type | Description |
---|---|
Runtime |
Remarks
A Runtime
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the subsystem has been started, and you attempt to set the image library to null. |
See Also
requestedMaxNumberOfMovingImages
The requested maximum number of moving images to track.
Declaration
public int requestedMaxNumberOfMovingImages { get; set; }
Property Value
Type | Description |
---|---|
int |
Exceptions
Type | Condition |
---|---|
Not |
Thrown if the subsystem does not support tracking moving images.
Check for support of this feature with supports |
Methods
CreateRuntimeLibrary(XRReferenceImageLibrary)
Creates a RuntimeserializedLibrary
is null
.
Use this to construct the runtime representation of an XRReference
Declaration
public RuntimeReferenceImageLibrary CreateRuntimeLibrary(XRReferenceImageLibrary serializedLibrary)
Parameters
Type | Name | Description |
---|---|---|
XRReference |
serializedLibrary | An existing XRReference |
Returns
Type | Description |
---|---|
Runtime |
A new Runtime |
Remarks
If the subsystem supports runtime mutable libraries
(see supports
See Also
GetChanges(Allocator)
Retrieve the changes in the state of tracked images (added, updated, and removed) since the last call to GetChanges
.
Declaration
public override TrackableChanges<XRTrackedImage> GetChanges(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The allocator to use for the returned set of changes. |
Returns
Type | Description |
---|---|
Trackable |
The set of tracked image changes (added, updated, and removed) since the last call to this method. |
Overrides
OnStart()
Starts the subsystem, that is, starts detecting images in the scene. image
Declaration
protected override void OnStart()
Overrides
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown if image |
OnStop()
Stops the subsystem, that is, stops detecting and tracking images.
Declaration
protected override sealed void OnStop()