mixed-reality

4.26

To get the data for the hand rays, you should use the Get Motion Controller Data function from the previous section. The returned structure contains two parameters you can use to create a hand ray – Aim Position and Aim Rotation. These parameters form a ray directed by your elbow. You should take them and find a hologram being pointed by.

Below is an example of determining whether a hand ray hits a Widget and setting a custom hit result:

Blueprint of get motion controller data function

4.25

To use Hand Rays in Blueprints, search for any of the actions under Windows Mixed Reality HMD:

Hand Rays BP

To access them in C++, include WindowsMixedRealityFunctionLibrary.h to the top of your calling code file.

Enum

You also have access to input cases under EHMDInputControllerButtons, which can be used in Blueprints:

Input Controller Buttons

For access in C++, use the EHMDInputControllerButtons enum class:

enum class EHMDInputControllerButtons : uint8
{
	Select,
	Grasp,
//......
};

Below is a breakdown of the two applicable enum cases:

You can access the tracking status of your hand mesh in C++ through the EHMDTrackingStatus enum shown below:

enum class EHMDTrackingStatus : uint8
{
	NotTracked,
	//......
	Tracked
};

Below is a breakdown of the two applicable enum cases:

Struct

The PointerPoseInfo struct can give you information on the following hand data:

You can access the PointerPoseInfo struct through Blueprints, as shown below:

Pointer Pose Info BP

Or with C++:

struct FPointerPoseInfo
{
	FVector Origin;
	FVector Direction;
	FVector Up;
	FQuat Orientation;
	EHMDTrackingStatus TrackingStatus;
};

Functions

All of the functions listed below can be called on every frame, which allows continuous monitoring.

  1. Get Pointer Pose Info returns complete information about the hand ray direction in the current frame.

Blueprint:

Get Pointer Pose Info

C++:

static FPointerPoseInfo UWindowsMixedRealityFunctionLibrary::GetPointerPoseInfo(EControllerHand hand);
  1. Is Grasped returns true if the hand is grasped in the current frame.

Blueprint:

Is Grasped BP

C++:

static bool UWindowsMixedRealityFunctionLibrary::IsGrasped(EControllerHand hand);
  1. Is Select Pressed returns true if the user triggered Select in the current frame.

Blueprint:

Is Select Pressed BP

C++:

static bool UWindowsMixedRealityFunctionLibrary::IsSelectPressed(EControllerHand hand);
  1. Is Button Clicked returns true if the event or button is triggered in the current frame.

Blueprint:

Is Button Clicked BP

C++:

static bool UWindowsMixedRealityFunctionLibrary::IsButtonClicked(EControllerHand hand, EHMDInputControllerButtons button);
  1. Get Controller Tracking Status returns the tracking status in the current frame.

Blueprint:

Get Controller Tracking Status BP

C++:

static EHMDTrackingStatus UWindowsMixedRealityFunctionLibrary::GetControllerTrackingStatus(EControllerHand hand);