Class SpatialImageTrackingSubsystem
The OpenXR Spatial Entities implementation of the UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem. Don't create this directly. Use the SubsystemManager instead.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features.SpatialEntities
Assembly: Unity.XR.SpatialEntities.dll
Syntax
[Preserve]
public class SpatialImageTrackingSubsystem : XRImageTrackingSubsystem, ISubsystem
Methods
GetPermissionState()
Get the state of any required permissions for this subsystem to run on the current device.
Declaration
public override XRPermissionState GetPermissionState()
Returns
| Type | Description |
|---|---|
| XRPermissionState | The permission state. |
Overrides
GetSupportedTextureFormats()
Returns the texture formats the OpenXR runtime supports for reference images, as reported by
xrEnumerateSpatialReferenceImageFormatsEXT. Formats the runtime reports that have no
equivalent Unity TextureFormat (such as YUV 4:2:0) are omitted.
Declaration
public List<TextureFormat> GetSupportedTextureFormats()
Returns
| Type | Description |
|---|---|
| List<TextureFormat> | The supported texture formats, or an empty list if the runtime hasn't been initialized or the enumeration failed. |
TryDestroyImageDatabase(SpatialImageDatabase)
Destroys the underlying native image-tracking database. The managed SpatialImageDatabase wrapper is invalidated and should no longer be used if this call returns success.
Declaration
public XRResultStatus TryDestroyImageDatabase(SpatialImageDatabase imageDatabase)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialImageDatabase | imageDatabase | The database to destroy. |
Returns
| Type | Description |
|---|---|
| XRResultStatus | The status of the destroy operation. |
Remarks
If imageDatabase is the database currently assigned to
UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem.imageLibrary, image tracking stops.
TryStartAsync(CancellationToken, XRSubsystemStartOptions)
Requests the scene permission when needed. The dedicated image context itself is created later when an image library is assigned.
Declaration
public override Awaitable<XRResultStatus> TryStartAsync(CancellationToken token, XRSubsystemStartOptions options = XRSubsystemStartOptions.None)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | token | A cancellation token, which you can use to cancel the operation in progress. |
| XRSubsystemStartOptions | options | The options to start the subsystem with. |
Returns
| Type | Description |
|---|---|
| Awaitable<XRResultStatus> | The status of the operation. |
Overrides
Exceptions
| Type | Condition |
|---|---|
| OperationCanceledException | Thrown if |