The hierarchy is described by EHandKeypoint
enum:
You can get all this data from a user’s hands using the Get Motion Controller Data function. That function returns an XRMotionControllerData structure. Below is a sample Blueprint script that parses the XRMotionControllerData structure to get hand joint locations and draws a debug coordinate system at each joint’s location.
It’s important to check if the structure is valid and that it’s a hand. Otherwise, you may get undefined behavior in access to positions, rotations, and radii arrays.
The EWMRHandKeypoint
enum describes the Hand’s bone hierarchy. You can find each hand keypoint listed in your Blueprints:
The full C++ enum is listed below:
enum class EWMRHandKeypoint : uint8
{
Palm,
Wrist,
ThumbMetacarpal,
ThumbProximal,
ThumbDistal,
ThumbTip,
IndexMetacarpal,
IndexProximal,
IndexIntermediate,
IndexDistal,
IndexTip,
MiddleMetacarpal,
MiddleProximal,
MiddleIntermediate,
MiddleDistal,
MiddleTip,
RingMetacarpal,
RingProximal,
RingIntermediate,
RingDistal,
RingTip,
LittleMetacarpal,
LittleProximal,
LittleIntermediate,
LittleDistal,
LittleTip
};
You can find the numerical values for each enum case in the Windows.Perception.People.HandJointKind table.
You can use hand tracking in Blueprints by adding Supports Hand Tracking from Hand Tracking > Windows Mixed Reality:
This function returns true
if hand tracking is supported on the device and false
if hand tracking isn’t available.
C++:
Include WindowsMixedRealityHandTrackingFunctionLibrary.h
.
static bool UWindowsMixedRealityHandTrackingFunctionLibrary::SupportsHandTracking()
You can use GetHandJointTransform to return spatial data from the hand. The data updates every frame, but if you’re inside a frame the returned values are cached. It’s not recommended to have heavy logic in this function for performance reasons.
C++:
static bool UWindowsMixedRealityHandTrackingFunctionLibrary::GetHandJointTransform(EControllerHand Hand, EWMRHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius)
Here’s a breakdown of GetHandJointTransform’s function parameters: