Controller
APIs for the direct access to the Controller system. More...
Classes
| Name | |
|---|---|
| struct | MLControllerConfiguration |
| struct | MLControllerStream A structure containing information about the tracking-stream of this controller. |
| struct | MLControllerState A structure containing information about the current state of this controller. |
| struct | MLControllerStateEx A structure containing information about the current state of this controller. |
| struct | MLControllerSystemState A structure containing information about the current state of the controller system. |
| struct | MLControllerSystemStateEx A structure containing information about the current state of the controller system. |
Types
| Name | |
|---|---|
| typedef struct MLControllerConfiguration | MLControllerConfiguration |
| typedef struct MLControllerStream | MLControllerStream A structure containing information about the tracking-stream of this controller. |
| typedef struct MLControllerState | MLControllerState A structure containing information about the current state of this controller. |
| typedef struct MLControllerStateEx | MLControllerStateEx A structure containing information about the current state of this controller. |
| typedef struct MLControllerSystemState | MLControllerSystemState A structure containing information about the current state of the controller system. |
| typedef struct MLControllerSystemStateEx | MLControllerSystemStateEx A structure containing information about the current state of the controller system. |
Enums
| Name | |
|---|---|
| enum | MLControllerMode { Deprecated_Mode_0 = 0, Deprecated_Mode_1 = 1, MLControllerMode_Fused6Dof = 2, MLControllerMode_Count, MLControllerMode_Ensure32Bits = 0x7FFFFFFF } A set of possible tracking modes for the Controller system. |
| enum | Anonymous Enum 7 { MLController_MaxActive = 1 } |
| enum | MLControllerCalibAccuracy { MLControllerCalibAccuracy_Bad = 0, MLControllerCalibAccuracy_Low = 1, MLControllerCalibAccuracy_Medium = 2, MLControllerCalibAccuracy_High = 3, MLControllerCalibAccuracy_Ensure32Bits = 0x7FFFFFFF } Calibration Accuracy levels for controller. |
| enum | MLControllerStatus { MLControllerStatus_NotActive = 0, MLControllerStatus_Active_Rotation_Only = 1, MLControllerStatus_Active = 2, MLControllerStatus_Ensure32Bits = 0x7FFFFFFF } Stream mode for controller stream. |
Functions
| Name | |
|---|---|
| void | MLControllerSystemStateExInit(MLControllerSystemStateEx * inout_attr) Initializes values for MLControllerSystemStateEx. |
| MLResult | MLControllerCreateEx(const MLControllerConfiguration mode, MLHandle out_handle) Creates a controller tracker. |
| MLResult | MLControllerDestroy(MLHandle tracker) Destroys a controller tracker. |
| MLResult | MLControllerGetState(MLHandle handle, struct MLControllerSystemState * out_state) Return the most recent controller state. |
| MLResult | MLControllerGetStateEx(MLHandle handle, MLControllerSystemStateEx * out_state) Return the most recent controller state. |
Detailed Description
APIs for the direct access to the Controller system.
Shared Object:
- perception.magicleap*
Enums Documentation
MLControllerMode
| Enumerator | Value | Description |
|---|---|---|
| Deprecated_Mode_0 | 0 | |
| Deprecated_Mode_1 | 1 | |
| MLControllerMode_Fused6Dof | 2 | High quality 6 degrees of freedom tracking (position and orientation). |
| MLControllerMode_Count | Count of number of modes. | |
| MLControllerMode_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
A set of possible tracking modes for the Controller system.
Deprecated since 1.1.0. Scheduled for removal.
Anonymous Enum 7
| Enumerator | Value | Description |
|---|---|---|
| MLController_MaxActive | 1 | Maximum number of active Controllers. |
MLControllerCalibAccuracy
| Enumerator | Value | Description |
|---|---|---|
| MLControllerCalibAccuracy_Bad | 0 | CalAccuracy is Bad. |
| MLControllerCalibAccuracy_Low | 1 | CalAccuracy is Low. |
| MLControllerCalibAccuracy_Medium | 2 | CalAccuracy is Medium. |
| MLControllerCalibAccuracy_High | 3 | CalAccuracy is High. |
| MLControllerCalibAccuracy_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Calibration Accuracy levels for controller.
Deprecated since 1.1.0. Scheduled for removal.
MLControllerStatus
| Enumerator | Value | Description |
|---|---|---|
| MLControllerStatus_NotActive | 0 | Controller stream is not active. |
| MLControllerStatus_Active_Rotation_Only | 1 | Controller stream is active (rotation only). |
| MLControllerStatus_Active | 2 | Controller stream is active (both position and rotation). |
| MLControllerStatus_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Stream mode for controller stream.
API Level:
- 21
Types Documentation
MLControllerConfiguration
typedef struct MLControllerConfiguration MLControllerConfiguration;
A structure to configure controller's tracking-modes.
MLControllerStream
typedef struct MLControllerStream MLControllerStream;
A structure containing information about the tracking-stream of this controller.
Deprecated since 1.1.0. Scheduled for removal.
MLControllerState
typedef struct MLControllerState MLControllerState;
A structure containing information about the current state of this controller.
Deprecated since 1.1.0. Scheduled for removal.
MLControllerStateEx
typedef struct MLControllerStateEx MLControllerStateEx;
A structure containing information about the current state of this controller.
API Level:
- 21
MLControllerSystemState
typedef struct MLControllerSystemState MLControllerSystemState;
A structure containing information about the current state of the controller system.
Deprecated since 1.1.0. Scheduled for removal.
MLControllerSystemStateEx
typedef struct MLControllerSystemStateEx MLControllerSystemStateEx;
A structure containing information about the current state of the controller system.
API Level:
- 21
Functions Documentation
MLControllerSystemStateExInit
static inline void MLControllerSystemStateExInit(
MLControllerSystemStateEx * inout_attr
)
Initializes values for MLControllerSystemStateEx.
Parameters
| MLControllerSystemStateEx * | inout_attr | The object to initialize. |
API Level:
- 21
MLControllerCreateEx
MLResult MLControllerCreateEx(
const MLControllerConfiguration * mode,
MLHandle * out_handle
)
Creates a controller tracker.
Parameters
| const MLControllerConfiguration * | mode | A pointer to MLControllerConfiguration struct which contains the tracking modes to use for this session. |
| MLHandle * | out_handle | A pointer to an MLHandle which will the handle to the controller tracker. If this operation fails, out_handle will be ML_INVALID_HANDLE. |
Returns
| MLResult | MLResult_InvalidParam | Failed to create a controller tracker due to an invalid input parameter. |
| MLResult | MLResult_Ok | Controller Succesfully created a controller tracker. |
| MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
| MLResult | MLResult_PermissionDenied | Failed to create a controller tracker due to lack of permission. |
Required Permissions:
- None
API Level:
- 4
MLControllerDestroy
MLResult MLControllerDestroy(
MLHandle tracker
)
Destroys a controller tracker.
Parameters
| MLHandle | tracker | MLHandle to the tracker created by MLControllerCreateEx(). |
Returns
| MLResult | MLResult_Ok | Successfully destroyed the controller tracker. |
| MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
| MLResult | MLResult_UnspecifiedFailure | Failed to destroy the controller tracker due to an unknown error. |
Required Permissions:
- None
MLControllerGetState
MLResult MLControllerGetState(
MLHandle handle,
struct MLControllerSystemState * out_state
)
Return the most recent controller state.
Parameters
| MLHandle | handle | Handle to the tracker created by MLControllerCreateEx(). |
| struct MLControllerSystemState * | out_state | Pointer to valid MLControllerSystemState object to be filled with current state information. |
Returns
| MLResult | MLResult_InvalidParam | Failed to get the controller state due to an invalid input parameter. |
| MLResult | MLResult_Ok | Successfully filled out_state with current state. |
| MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
Deprecated since 1.1.0. Scheduled for removal.
MLControllerGetStateEx
MLResult MLControllerGetStateEx(
MLHandle handle,
MLControllerSystemStateEx * out_state
)
Return the most recent controller state.
Parameters
| MLHandle | handle | Handle to the tracker created by MLControllerCreateEx(). |
| MLControllerSystemStateEx * | out_state | Pointer to valid MLControllerSystemStateEx object to be filled with current state information. |
Returns
| MLResult | MLResult_InvalidParam | Failed to get the controller state due to an invalid input parameter. |
| MLResult | MLResult_Ok | Successfully filled out_state with current state. |
| MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
Required Permissions:
- None
API Level:
- 21