Skip to main content
Version: 21 Aug 2024

NativeBindings

See ml_space.h for additional comments.

Inherits from:
MagicLeapNativeBindings

Public Methods

MLResult.Code MLSpaceExportSpace

Export an on device Magic Leap Space.

public MLResult.Code MLSpaceExportSpace(
in SpaceExportInfo exportInfo,
ref SpaceExportOutData data
)

Parameters

TypeNameDescription
in SpaceExportInfoexportInfoA structure containing information about the Space export settings. This structure must be initialized by calling #MLSpaceExportInfoInit before use.
ref SpaceExportOutDatadataA structure containing information about the exported Space.

MLResult.Code MLSpaceGetLocalizationResult

Get the localization results.

public MLResult.Code MLSpaceGetLocalizationResult(
ulong handle,
out SpaceLocalizationResult result
)

Parameters

TypeNameDescription
ulonghandle
out SpaceLocalizationResultresultA structure containing information about the device's localization state. This structure must be initialized by calling #MLSpaceLocalizationResultInit before usebefore use.

MLResult.Code MLSpaceGetSpaceList

The list memory is owned by the library, call MLSpaceReleaseSpaceList to release the memory. Each get MLSpaceGetSpaceList should have a corresponding MLSpaceReleaseSpaceList.

public MLResult.Code MLSpaceGetSpaceList(
ulong hanlde,
out SpaceFilter queryFilter,
out SpaceList spaceList
)

Parameters

TypeNameDescription
ulonghanlde
out SpaceFilterqueryFilterA collection of filters for Magic Leap Spaces. This structure must be initialized by calling #MLSpaceQueryFilterInit before use. There is no support for filters at this time.
out SpaceListspaceListA structure containing list of #MLSpace. This structure must be initialized by calling #MLSpaceListInit before use.

MLResult.Code MLSpaceImportSpace

The #MLSpaceImportInfo memory is owned by the app and the app should make sure to release the memory once the API call has returned

public MLResult.Code MLSpaceImportSpace(
in SpaceImportInfo importInfo,
ref SpaceImportOutData data
)

Parameters

TypeNameDescription
in SpaceImportInfoimportInfoA structure containing information needed to import Magic Leap Space. This structure must be initialized by calling #MLSpaceImportInfoInit before use.
ref SpaceImportOutDatadataA structure containing information about the imported Space.

MLResult.Code MLSpaceManagerCreate

Creates a Magic Leap Space manager handle.

public MLResult.Code MLSpaceManagerCreate(
in Settings settings,
out ulong handle
)

Parameters

TypeNameDescription
in SettingssettingsA structure containing settings for the space manager. This structure must be initialized by calling #MLSpaceManagerSettingsInit before use.
out ulonghandle

MLResult.Code MLSpaceManagerDestroy

Destroys a Space manager handle.

public MLResult.Code MLSpaceManagerDestroy(
ulong handle
)

Parameters

TypeNameDescription
ulonghandle

MLResult.Code MLSpaceReleaseExportData

Release resources acquired in MLSpaceExportSpace.

public MLResult.Code MLSpaceReleaseExportData(
ref SpaceExportOutData data
)

Parameters

TypeNameDescription
ref SpaceExportOutDatadataA structure containing information about the exported Space.

MLResult.Code MLSpaceReleaseSpaceList

Release the list of available spaces.

public MLResult.Code MLSpaceReleaseSpaceList(
ulong handle,
out SpaceList list
)

Parameters

TypeNameDescription
ulonghandle
out SpaceListlistA structure containing list of #MLSpace. This structure must be initialized by calling #MLSpaceListInit before use.

MLResult.Code MLSpaceRequestLocalization

Send a request to localize to a given Magic Leap Space.

public MLResult.Code MLSpaceRequestLocalization(
ulong handle,
ref SpaceLocalizationInfo spaceList
)

Parameters

TypeNameDescription
ulonghandle
ref SpaceLocalizationInfospaceListA collection of parameters to be used for localization request. This structure must be initialized by calling #MLSpaceLocalizationInfoInit before use.

MLResult.Code MLSpaceSetCallbacks

Set the callbacks for events related to the Magic Leap Space.

public MLResult.Code MLSpaceSetCallbacks(
ulong handle,
ref SpaceCallbacks callbacks,
IntPtr userData
)

Parameters

TypeNameDescription
ulonghandle
ref SpaceCallbackscallbacksA 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.
IntPtruserData