Skip to main content
Version: 21 Aug 2024

Headset Fit

API to query the status of the Headset fit. More...

Classes

Name
structMLHeadsetFitState
Headset fit state.

Types

Name
typedef struct MLHeadsetFitStateMLHeadsetFitState
Headset fit state.

Enums

Name
enumMLHeadsetFitStatus
{
MLHeadsetFitStatus_Unknown = 0,
MLHeadsetFitStatus_NotWorn,
MLHeadsetFitStatus_GoodFit,
MLHeadsetFitStatus_BadFit,
MLHeadsetFitStatus_Ensure32Bits = 0x7FFFFFFF
}
Represents the different fit status that the system can report.

Functions

Name
voidMLHeadsetFitStateInit(MLHeadsetFitState * inout_state)
Initialize MLHeadsetFitState.
MLResultMLHeadsetFitCreateClient(MLHandle * out_handle)
Creates a headset fit client.
MLResultMLHeadsetFitDestroyClient(MLHandle handle)
Destroys headset fit client.
MLResultMLHeadsetFitGetState(MLHandle handle, MLHeadsetFitState * out_state)
Gets information about the user's current headset fit.

Detailed Description

API to query the status of the Headset fit.

This API can be used to determine the fit of the headset on the user. The API will only look to see if the pupil location corresponding to the neutral gaze is centered on the image. What this means is that we can only look for a certain type of bad fits. However this covers majority of the bad fit cases.

Warning

THIS API IS DEPRECATED IN FAVOR OF OPENXR XR_ML_user_calibration EXTENSION: https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#XR_ML_user_calibration

Shared Object:

  • perception.magicleap*

Enums Documentation

MLHeadsetFitStatus

EnumeratorValueDescription
MLHeadsetFitStatus_Unknown0Headset fit status not available for unknown reason.
MLHeadsetFitStatus_NotWornHeadset not worn.
MLHeadsetFitStatus_GoodFitGood fit.
MLHeadsetFitStatus_BadFitBad fit.
MLHeadsetFitStatus_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Represents the different fit status that the system can report.

If status is neither NotWorn nor Unknown, then headset is being worn.

Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

Types Documentation

MLHeadsetFitState

typedef struct MLHeadsetFitState MLHeadsetFitState;

Headset fit state.

More Info

Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

Functions Documentation

MLHeadsetFitStateInit

static inline void MLHeadsetFitStateInit(
MLHeadsetFitState * inout_state
)

Initialize MLHeadsetFitState.

Parameters

MLHeadsetFitState *inout_stateSet up the version for inout_state and zero all other fields.
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

MLHeadsetFitCreateClient

MLResult MLHeadsetFitCreateClient(
MLHandle * out_handle
)

Creates a headset fit client.

Parameters

MLHandle *out_handleA pointer to an MLHandle to the newly created headset fit client.

Returns

MLResultMLResult_InvalidParamFailed to create headset fit client due to an invalid input parameter.
MLResultMLResult_OkSuccessfully created headset fit client.
MLResultMLResult_UnspecifiedFailureFailed to create headset fit client due to an unknown failure.

Required Permissions:

  • None
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

MLHeadsetFitDestroyClient

MLResult MLHeadsetFitDestroyClient(
MLHandle handle
)

Destroys headset fit client.

Parameters

MLHandlehandleMLHandle to the headset fit client created by MLHeadsetFitCreateClient.

Returns

MLResultMLResult_OkSuccessfully destroyed headset fit client.
MLResultMLResult_InvalidParamMLHandle is invalid.
MLResultMLResult_UnspecifiedFailureFailed to destroy headset fit client due to an unknown failure.

Required Permissions:

  • None
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

MLHeadsetFitGetState

MLResult MLHeadsetFitGetState(
MLHandle handle,
MLHeadsetFitState * out_state
)

Gets information about the user's current headset fit.

Parameters

MLHandlehandleHandle to the headset fit information created by MLHeadsetFitCreateClient.
MLHeadsetFitState *out_stateInformation about headset fit state.

Returns

MLResultMLResult_InvalidParamFailed to receive headset fit state due to an invalid input parameter.
MLResultMLResult_OkSuccessfully returned headset fit state.
MLResultMLResult_UnspecifiedFailureFailed to receive headset fit state due to an unknown failure.

Required Permissions:

  • None
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20