QCHT API
XR Hand Tracking Subsystem
XR Hand Tracking Subsytem is instantiated by the OpenXR hand tracking feature. It controls starting and stopping underlying fetching data loop, exposes hand data and throws hand tracking related events.
Static | Description |
---|---|
XRHandTrackingSubsystem GetSubsystemInManager() | Returns the first XR Hand Tracking Subsystem instance in the Subsystem Manager if it exists |
Non-Static | Description |
---|---|
HandTrackingStatus Status | Gets hand tracking status. It can be Idle , Running or Error |
void Start() | Starts the hand tracking subsystem |
void Stop() | Stops the hand tracking subsystem |
Hand LeftHand | Left hand data |
Hand RightHand | Right hand data |
Hand GetHand(XrHandedness handedness) | Gets hand data by handedness |
event Action<Hand> OnHandTracked | Raised if a hand has been tracked this frame |
event Action<Hand> OnHandUntracked | Raised if a hand has been untracked this frame |
event Action<UpdatePhase> OnHandsUpdated | Raised after both hands data have been updated. UpdatePhase can be Dynamic (before Update calls) or BeforeRender |
Hand Struct
Hand data is a struct filled by the hand tracking subsystem and its hand tracking providers.
Both hands data can be retrieved by calling LeftHand
and RightHand
on the subsystem reference.
See LeftHand
and RightHand
in XR Hand Tracking Subsystem above.
Non-Static | Description |
---|---|
XrHandedness Handedness | Hand handedness. It can be XR_HAND_LEFT or XR_HAND_RIGHT |
XrSpace Space | Space in which joint data are stored. It can be XR_HAND_LOCAL or XR_HAND_WORLD (in XR Origin) |
bool IsTracked | True if the hand is currently tracked |
float Scale | Hand scale from .5f to 1.6f |
Pose Root | Hand root pose (equivalent to the wrist center pose in XR Origin) |
Pose[] Joints | Hand joint poses |
Pose GetHandJoint(XrHandJoint joint) | Returns a particular joint pose |
XR Hand Tracking Manager
XR Hand Tracking Manager is the component which handles the hand tracking visualisation's part. It is responsible for instancing hand prefabs by listening the hand tracking subsystem events.
Static | Description |
---|---|
GameObject DefaultLeftHandPrefab | Reference to the default Left Hand prefab in resources folder. Packages > Prefabs > Resources > QualcommHandLeft |
GameObject DefaultRightHandPrefab | Reference to the default Right Hand prefab in resources folder. Packages > Prefabs > Resources > QualcommHandRight |
XRHandTrackingManager InstantiateHandTrackingManager() | Instantiate a Hand Tracking Manager with Default Hand prefabs |
XRHandTrackingManager GetOrCreate(GameObject leftHandPrefab, GameObject rightHandPrefab) | Gets existing or creates a Hand Tracking Manager if it doesn't exist with Hand prefabs given in parameters |
void Destroy(XRHandTrackingManager manager) | Destroys a given Hand Tracking Manager instance or tries to find one to destroy if it does exist |
Non-Static | Description |
---|---|
GameObject LeftHandPrefab | Left prefab object that will be instantiated |
GameObject RightHandPrefab | Right prefab object that will be instantiated |
void RefreshLeftHand() | Regenerates the left hand object if the prefab has changed |
void RefreshRightHand() | Regenerates the right hand object if the prefab has changed |
HandSkin LeftHandSkin | Change or retrieve the left hand skin |
HandSkin RightHandSkin | Change or retrieve the right hand skin |
void ToggleHand(XrHandedness handedness, bool visible) | Toggles the hand visibility |
bool TrySetHandPose(XrHandedness handedness, HandData? data, HandMask? mask) | Attempts to apply a custom hand pose on the hand object |
bool TrySetPoking(XrHandedness handedness, Vector3? pokePoint) | Attempts to set a poke point for the hand object |
bool TrySetVff(XrHandedness handedness, bool active) | Attempts to activate Virtual Force Feedback system on the hand object |