Basic Interaction Setup
Once the basic scene setup is complete, the user is now able to visualize their hands, but they cannot yet interact with the virtual environment around them. Perform the basic setup for hand tracking interactions described below to enable it.
Scene Architecture
Visualisation
After creating an XR Hand Tracking Manager
, two prefabs are automatically set up on the left and right hand fields. These prefabs are for hand visualisation purpose only.
Hand prefab game objects have Hand Rigged Visualizer and Hand Driver components which are in charge of visualizing the hand mesh and updating hand joint transforms for the Skinned Mesh.
Interactions
QCHT interactions are fully based on XRIT package.
Interaction profiles
QCHTI supports Hand Interaction Profile and Microsoft Hand Interaction Profile
If no interaction profile is selected or the runtime does not support interaction profiles, QCHTI will fallback to a custom Hand Tracking Input Device which will register itself as XR Controller in input system device map.
Available controls when fallback are :
Unity Control Name | Type | Aliases |
---|---|---|
isTracked | Boolean | |
trackingState | Flag | |
devicePosition | Vector3 | |
deviceRotation | Quaternion | |
pokePosition | Vector3 | |
pokeRotation | Quaternion | |
pinchPosition | Vector3 | |
pinchRotation | Quaternion | |
graspPosition | Vector3 | |
graspRotation | Quaternion | |
pointerPosition | Vector3 | |
pointerRotation | Quaternion | |
trigger | Float | select |
triggerPressed | Boolean | selectPressed, triggerButton |
grip | Float | squeeze |
gripPressed | Boolean | squeezePressed, gripButton |
Controllers
From scratch, to enable interactions like Distal Interaction and Proximal Interaction, custom XRIT controllers for hands have to be added.
Add the Hand Tracking Controllers GameObject to the scene by right-clicking in the scene's Hierarchy and selecting QCHT > Hand Tracking Controllers.
Two instances of hand tracking controllers are automatically added as children of XR Origin (or AR Session).
Each controller aggregates the XR Ray Interactor, the XR Poke Interactor and two XR Direct Interactor components with predefined setup. These components are highly configurable.
However input action mapping is not pre-setup on these controllers.
It is highly recommended to use the Core Assets to get a full predefined XR Rig setup with a default input action mapping.
XR Hand Controller (Deprecated)
The XR Hand Controller component is a custom implementation of XR Action Base Controller from the XR Interaction Toolkit package. The XR Hand Controller is in charge of handling input action coming from the new Unity Input System directly mapped to the underlying hand tracking subsystem. This custom implementation of the XR Action Base Controller defines an additional grab action and the handedness of the controller which is useful to filter interactions.
This component is deprecated as proximal interactions have been split into two direct interactors: one for pinch interactions, the other for grasp interactions. See the Core Assets XR rig to know more about the new setup.