XR Hand Input Data Provider
HandInputDataProvider derived script that handles the OpenXR hand tracking based input
Reads the hand tracking data using XR Hands package and sets the input state defined in XRHandInputDataProvider's base behaviours
It is a good idea to set the InputRoot property inherited from InputDataProvider to XR Rig's Transform if one is in use in a given scene. That way if the camera rig object gets moved (like it is in teleport functionality for example) all of the hand-representing objects that use XRHandInputDataProvider will move with it properly
Members defined in this script are:
Public properties
HandType HandType { get; set; }
Specifies for which hand is input being provided by this script, left or right
HandSkeletonPose BindPose { get; set; }
HandSkeletonPose is a scriptable object that stores the poses (positions and rotations) of each of the hand skeleton bones. BindPose property specifies the default pose for a hand skeleton which can be viewed as the pose for a hand skeleton at rest
This property is required, XRHandInputDataProvider will not provide tracked hand poses if no value is assigned
OctoXR base package includes bind pose assets, one for the left and one for the right hand, so there is no need to manually create one except if there is a need for more custom hands to be used
Protected methods
virtual void Awake()
Unity built-in callback. Performs certain initialization logic for the XRHandInputDataProvider
virtual void Start()
Unity built-in callback. Performs certain initialization logic for the XRHandInputDataProvider
virtual void Update()
Unity built-in callback. Updates the input state in order to provide the fresh input information for current frame
Hopefully it goes without saying that base implementations of these methods should always be called in their respective override methods in order to ensure the correct behaviour of this script.
Last updated