Skip to main content
Version: 20 Mar 2024

MLSpaceCallbacks

Module: Magic Leap Spaces / Space

A structure containing callbacks for events related to the Space. More...

#include <ml_space.h>

Public Attributes

TypeName
uint32_tversion
void()(const MLSpaceLocalizationResult localization_result, void *user_data)on_localization_changed
This callback will be invoked whenever there is an update to the localization status.

Detailed Description

struct MLSpaceCallbacks;

A structure containing callbacks for events related to the Space.

This structure must be initialized by calling MLSpaceCallbacksInit before use. Application can unregister (stop receiving callbacks) at any time by setting the corresponding callback to NULL.

API Level:

  • 26

Public Attributes Documentation

version

uint32_t version;

Version of the structure.


on_localization_changed

void(*)(const MLSpaceLocalizationResult *localization_result, void *user_data) on_localization_changed;

This callback will be invoked whenever there is an update to the localization status.

TypeDescription
void()(const MLSpaceLocalizationResult localization_result, void *user_data))(const MLSpaceLocalizationResult localization_result, void user_data)

Parameters

localization_resultInformation about the localization status.
user_dataPointer to user context data as set by MLSpaceSetCallbacks (can be NULL).

Localization events can occur when the application requests for localization via MLSpaceRequestLocalization or due to other events outside the control of the app such as head tracking failure, localization loss.