Skip to main content
Version: 11 Nov 2025

MLGazeRecognition

NameSpace: MagicLeap

This API can be used to get info about gaze. More...

Inherits from:
MLAutoAPISingleton< MLGazeRecognition >,
MLLazySingleton< T >

Detailed Description​

public class MLGazeRecognition : MLAutoAPISingleton< MLGazeRecognition > 

Details*

Runs once per Unity Update loop.


Public Methods​

MLResult GetState​

Get information about the user's gaze.

public static MLResult GetState(
out State state
)

Parameters

TypeNameDescription
out StatestateInformation about the gaze.

Returns: MLResult_InvalidParam The state parameter was not valid (null). MLResult_Ok gaze Recognition static was successfully received. MLResult_UnspecifiedFailure Failed to receive gaze Recognition state data.


MLResult GetStaticData​

Get static information about Gaze Recognition.

public static MLResult GetStaticData(
out StaticData data
)

Parameters

TypeNameDescription
out StaticDatadataTarget to populate the data about Gaze Recognition..

Returns: MLResult_InvalidParam The data parameter was not valid (null). MLResult_Ok gaze Recognition data was successfully received. MLResult_UnspecifiedFailure Failed to receive gaze Recognition static data.


Protected Methods​

StartAPI​

Start the API.

protected virtual override MLResult.Code StartAPI()

Reimplements: StartAPI


StopAPI​

Stop the API.

protected virtual override MLResult.Code StopAPI()

Reimplements: StopAPI


Public Enums​

Behavior​

A set of mutually-exclusive behaviors that the Gaze Recognition system can report.

EnumeratorValueDescription
UnknownUnknown.
EyesClosedBoth eyes closed.
BlinkBlink detected.
FixationUser is fixating, eye position is stable.
PursuitUser is pursuing, eye velocity is low but nonzero.
SaccadeUser is making a saccade, eye velocity is high.
WinkLeftUser is winking with the left eye
WinkRightUser is winking with the right eye

Error​

A set of possible error codes that the Gaze Recognition system can report.

EnumeratorValueDescription
NoneNo error, tracking is nominal.
GenericGaze Recognition system failed.