MLAnchors
NameSpace: MagicLeap
Spatial Anchor management is closely tied to the selected mapping mode on the device. The modes are mutually exclusive and affect the functionality of these APIs. The available mapping modes are: More...
Inherits from:
MLAutoAPISingleton< MLAnchors >,
MLLazySingleton< T >
Detailed Description
public class MLAnchors : MLAutoAPISingleton< MLAnchors >
Details*
Spatial Anchor management is closely tied to the selected mapping mode on the device. The modes are mutually exclusive and affect the functionality of these APIs.For example, publishing an anchor is not available in "per-session" mapping mode.The available mapping modes are: Per-Session Mode - A non-persistent mode in which anchors are only available for the currently active tracking session. On-Device Mode - A persistent mode in which anchors are persisted locally and will be available in multiple sessions when localized to the same space in which they were published.
On-Device Mode - A persistent mode in which anchors are persisted locally and will be available in multiple sessions when localized to the same space in which they were published.
AR Cloud Mode - A persistent mode in which anchors are persisted in the cloud environment and will be available in multiple sessions to devices that are localized to the same space in which they were published.
Public Methods
MLResult GetLocalizationInfo
public static MLResult GetLocalizationInfo(
out LocalizationInfo info
)
Parameters
Type | Name | Description |
---|---|---|
out LocalizationInfo | info | A structure containing information about the device's localization state. |
Protected Methods
StartAPI
Do API-specific creation/initialization of ML resources for this API, such as creating trackers, etc. Called automatically the first time Instance is accessed. Error checking on the return value is performed in the base class.
protected virtual override MLResult.Code StartAPI()
Reimplements: StartAPI
StopAPI
API-specific cleanup. Will be called whenever MLDevice is destroyed (at the latest, when the application is shutting down). Error checking on the return value is performed in the base class.
protected virtual override MLResult.Code StopAPI()
Reimplements: StopAPI
Public Attributes
MaxSpaceNameLength
Maximum size for the name of the space in the #MLSpatialAnchorLocalizationInfo structure.
public const uint MaxSpaceNameLength = 64;
Public Enums
LocalizationStatus
LocalizationStatus
Enumerator | Value | Description |
---|---|---|
NotLocalized | The device is not currently localized. | |
Localized | The device has localized successfully. | |
LocalizationPending | A localization attempt is currently in progress. | |
LocalizationFailed | The last localization attempt failed. |
MappingMode
The current mapping mode, set via settings.
Enumerator | Value | Description |
---|---|---|
OnDevice | Using on-device mapping . | |
ARCloud | Using cloud-based mapping. |
Quality
The quality of the local space around the anchor. This can change over time as the user continues to scan the space.
Enumerator | Value | Description |
---|---|---|
Low | Low quality, this anchor can be expected to move significantly. | |
Medium | Medium quality, this anchor may move slightly. | |
High | High quality, this anchor is stable and suitable for digital content attachment. |