Skip to main content
Version: 12 Dec 2024

Extensions

Public Methods

bool TryGetEyeTrackingState

Try to get the InputSubsystem.Extensions.MLEyes.State, InputDevice from the given .

public static bool TryGetEyeTrackingState(
InputDevice eyesDevice,
out MLEyes.State state
)

Parameters

TypeNameDescription
InputDeviceeyesDeviceThe eye tracking device
out MLEyes.StatestateThe resulting Eye State

Details*

This method expects that a Magic Leap Eye Tracking input device is used in query. (ie. has the EyeTracking .) Note, you can retrieve Magic Leap devices with specific characteristics using the method. Once an eye tracking device is found and is equal to true, you can get the and access device specific features such as . For example:

InputDevice eyesDevice = InputSubsystem.Utils.FindMagicLeapDevice(InputDeviceCharacteristics.EyeTracking | InputDeviceCharacteristics.TrackedDevice);
if(eyesDevice.isValid){
InputSubsystem.Extensions.TryGetEyeTrackingState(eyesDevice, out MLEyes.State trackingState);
if(trackingState.FixationConfidence){
Debug.Log("FixationConfidence " + trackingState.FixationConfidence);
}
}

See: InputDeviceCharacteristics, InputSubsystem.Utils.FindMagicLeapDevice, InputDevice.isValid, MLEyes.State, InputSubsystem.Extensions.MLEyes.State.FixationConfidence

Returns: True if the resulting InputSubsystem.Extensions.MLEyes.State

is valid.


bool TryGetHeadTrackingState

public static bool TryGetHeadTrackingState(
InputDevice headDevice,
out MLHeadTracking.State headTrackingState
)

Parameters

TypeNameDescription
InputDeviceheadDevice
out MLHeadTracking.StateheadTrackingStateA structure containing information on the current state of the Head Tracking system.

bool TryGetHeadTrackingStateEx

public static bool TryGetHeadTrackingStateEx(
InputDevice headDevice,
out MLHeadTracking.StateEx headTrackingState
)

Parameters

TypeNameDescription
InputDeviceheadDevice
out MLHeadTracking.StateExheadTrackingStateA structure containing information on the current state of the Head Tracking system.