Changelog
All notable changes to this package will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
[1.0.0-pre.2] - 2022-10-26
Added
Added subsystem for cross-platform hand-tracking and accompanying types.
Types you might care about as a user:
XRHandSubsystemDescriptor, which you can retrieve aListof withSubsystemManager.GetSubsystemDescriptors.XRHandSubsystem, which can be created with a call toCreateon the above descriptor type.XRHand, which you can retrieve fromXRHandSubsystemwith itsleftHandandrightHandproperties. These contain joints androotPosedata, as well as itsHandedness.XRHandJoint, which you can retrieve from eachXRHandusingGetJointto query for joint tracking state, pose, radius, and velocity data on a per-joint basis.XRHandJointIDUtility, which contains extension methods for certainenums listed below and also housesFromIndex, which you can use when looping over an array to get the correspondingXRHandJointID(useful when callingXRHand.GetJoint).
As well as these enums:
XRHandJointTrackingState, a flags-enumused to denote which fields are valid and can be retrieved via theirTryGet...methods onXRHandJoint.XRHandJointID, used to identify each joint, and required when accessing joint data usingXRHand.GetJoint. If looping over an array of joint data, useXRHandJointIDUtility.FromIndexto convert your index toXRHandJointID, which is required forXRHand.GetJoint.Handedness, used to identify which hand is referred to by anXRHandusing itshandednessproperty.XRHandFingerID, not used anywhere else in the API surfaced in this package besides its extension methods inXRHandJointIDUtility:GetFrontJointIDandGetBackJointID, which together provider an inclusive range forXRHandJointIDs spanned by the finger represented byXRHandFingerID.
Additional types you may need to interact with if writing a provider (not a common use case):
XRHandSubsystemProvider, which the subsystem asks for data whenever itsTryUpdateHandsis called (built-in Unity setup calls this each frame) and is also queried when the subsystem and provider are created for which common joints are in the provider's layout usingGetHandLayout.XRHandProviderUtility, which providers should call into usingCreateJointduring theTryUpdateHandsper-frame call to fill out the left- and right-hand joint arrays. This same type also has a nestedSubsystemUpdatertype to be used for automatically updating the subsystem each frame. Users can respond to updates by subscribing to the subsystem'shandsUpdatedcallback.
Also added a visualizer sample, which demonstrates drawing using both meshes and per-joint prefabs. You can add this sample to your project through the Samples tab of this package's view in the Package Manager window. This sample has a mesh and script that assume OpenXR layout, so it is recommended you either use that plug-in or another one that conforms to the OpenXR hand joint layout.