Class HandTracking
This OpenXRInteractionFeature enables the use of hand-tracking data in OpenXR through the XRHandSubsystem. It enables XR_EXT_hand_tracking in the underlying runtime. To retrieve hand data, use the XRHandSubsystem retrieved from subsystem.
Namespace: UnityEngine.XR.Hands.OpenXR
Assembly: Unity.XR.Hands.dll
Syntax
public class HandTracking : OpenXRFeature
Remarks
For this extension to be available, you must install the XR Hands package.
Fields
extensionString
The OpenXR Extension string. OpenXR uses this to check if this extension is available or enabled. See hand interaction extension documentation for more information on this OpenXR extension.
Declaration
public const string extensionString = "XR_EXT_hand_tracking"
Field Value
| Type | Description |
|---|---|
| string |
featureId
The feature ID string. This is used to give the feature a well known ID for reference.
Declaration
public const string featureId = "com.unity.openxr.feature.input.handtracking"
Field Value
| Type | Description |
|---|---|
| string |
Properties
subsystem
The XRHandSubsystem that retrieves hand data from its provider. Will only be valid when this feature is enabled and running. To subscribe to updates, use handsUpdated.
Declaration
public static XRHandSubsystem subsystem { get; }
Property Value
| Type | Description |
|---|---|
| XRHandSubsystem |
Methods
GetValidationChecks(List<ValidationRule>, BuildTargetGroup)
Declaration
protected override void GetValidationChecks(List<ValidationRule> results, BuildTargetGroup targetGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ValidationRule> | results | |
| BuildTargetGroup | targetGroup |
HookGetInstanceProcAddr(IntPtr)
Declaration
protected override IntPtr HookGetInstanceProcAddr(IntPtr func)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | func |
Returns
| Type | Description |
|---|---|
| IntPtr |
OnAppSpaceChange(ulong)
See OpenXRFeature.OnAppSpaceChange(ulong).
Declaration
protected override void OnAppSpaceChange(ulong xrSpace)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrSpace |
OnInstanceCreate(ulong)
See OpenXRFeature.OnInstanceCreate(ulong).
Declaration
protected override bool OnInstanceCreate(ulong xrInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrInstance |
Returns
| Type | Description |
|---|---|
| bool |
OnInstanceDestroy(ulong)
See OpenXRFeature.OnInstanceDestroy(ulong).
Declaration
protected override void OnInstanceDestroy(ulong xrInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrInstance |
OnInstanceLossPending(ulong)
See OpenXRFeature.OnInstanceLossPending(ulong).
Declaration
protected override void OnInstanceLossPending(ulong xrInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrInstance |
OnSessionCreate(ulong)
Called after xrCreateSession.
Declaration
protected override void OnSessionCreate(ulong xrSession)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrSession |
Remarks
Creates an XRHandSubsystem with the OpenXR provider.
OnSessionDestroy(ulong)
See OpenXRFeature.OnAppSpaceChange(ulong).
Declaration
protected override void OnSessionDestroy(ulong xrSpace)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrSpace |
OnSubsystemDestroy()
Called before the OpenXR loader destroys its subsystems.
Declaration
protected override void OnSubsystemDestroy()
Remarks
Destroys the XRHandSubsystem.
OnSubsystemStart()
Called after the OpenXR loader has started its subsystems.
Declaration
protected override void OnSubsystemStart()
Remarks
Starts the XRHandSubsystem and automatic updating for it. To subscribe to updates, use handsUpdated.
OnSubsystemStop()
Called before the OpenXR loader stops its subsystems.
Declaration
protected override void OnSubsystemStop()
Remarks
Stops the XRHandSubsystem and automatic updating for it.
OnSystemChange(ulong)
See OpenXRFeature.OnSystemChange(ulong).
Declaration
protected override void OnSystemChange(ulong xrSystem)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrSystem |