mixed-reality

4.26

The hierarchy is described by EHandKeypoint enum:

Image of hand keypoint bluprint options

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.

Blueprint of get gaze data function connected to line trace by channel function

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.

4.25

The EWMRHandKeypoint enum describes the Hand’s bone hierarchy. You can find each hand keypoint listed in your Blueprints:

Hand Keypoint BP

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.

Supporting Hand Tracking

You can use hand tracking in Blueprints by adding Supports Hand Tracking from Hand Tracking > Windows Mixed Reality:

Hand Tracking BP

This function returns true if hand tracking is supported on the device and false if hand tracking isn’t available.

Supports Hand Tracking BP

C++:

Include WindowsMixedRealityHandTrackingFunctionLibrary.h.

static bool UWindowsMixedRealityHandTrackingFunctionLibrary::SupportsHandTracking()

Getting Hand Tracking

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.

Get Hand Joint Transform

C++:

static bool UWindowsMixedRealityHandTrackingFunctionLibrary::GetHandJointTransform(EControllerHand Hand, EWMRHandKeypoint Keypoint, FTransform& OutTransform, float& OutRadius)

Here’s a breakdown of GetHandJointTransform’s function parameters: