MagicLeapSpatialAnchorsStorageFeature
NameSpace: MagicLeapSupport
Inherits from:
MagicLeapOpenXRFeatureBase,
OpenXRFeature
Public Methods
bool CreateSpatialAnchorsFromStorage
public bool CreateSpatialAnchorsFromStorage(
List< String > AnchorMapPositionIds
)
Parameters
Type | Name | Description |
---|---|---|
List< String > | AnchorMapPositionIds |
bool DeleteStoredSpatialAnchor
Delete published anchors from Spatial Anchor Storage.
public bool DeleteStoredSpatialAnchor(
List< string > AnchorMapPositionIds
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | AnchorMapPositionIds | The list of AnchorMapPositionIds to Delete. These were assigned in the OnPublishComplete event in MagicLeapSpatialAnchorsStorageFeature. |
delegate void OnCreationCompleteFromStorageEvent
public delegate void OnCreationCompleteFromStorageEvent(
Pose pose,
ulong anchorId,
string anchorStorageId,
XrResult result
)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | |
ulong | anchorId | |
string | anchorStorageId | |
XrResult | result |
delegate void OnDeletedCompleteEvent
public delegate void OnDeletedCompleteEvent(
List< string > anchorMapPositionId
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | anchorMapPositionId |
delegate void OnPublishCompleteEvent
public delegate void OnPublishCompleteEvent(
ulong anchorId,
string anchorMapPositionId
)
Parameters
Type | Name | Description |
---|---|---|
ulong | anchorId | |
string | anchorMapPositionId |
delegate void OnQueryCompleteEvent
public delegate void OnQueryCompleteEvent(
List< string > anchorMapPositionId
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | anchorMapPositionId |
delegate void OnUpdateExpirationCompleteEvent
public delegate void OnUpdateExpirationCompleteEvent(
List< string > anchorMapPositionId
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | anchorMapPositionId |
bool PublishSpatialAnchorsToStorage
Publish local anchors to Spatial Anchor Storage using the MagicLeap Anchor Id.
public bool PublishSpatialAnchorsToStorage(
List< ulong > AnchorIds,
ulong expiration
)
Parameters
Type | Name | Description |
---|---|---|
List< ulong > | AnchorIds | The list of AnchorIds to publish. These were assigned in the OnCreationComplete event in MagicLeapSpatialAnchorsFeature. |
ulong | expiration | The time in seconds since epoch after which these anchors may: expire. Use 0 for permanent anchors. The system may retain them longer. |
bool PublishSpatialAnchorsToStorage
Publish local anchors to Spatial Anchor Storage using ARAnchors. Will return false if XRAnchorSubsystem is not loaded.
public bool PublishSpatialAnchorsToStorage(
List< ARAnchor > Anchors,
ulong expiration
)
Parameters
Type | Name | Description |
---|---|---|
List< ARAnchor > | Anchors | The list of ARAnchors to publish. TrackingState must be Tracking to be valid for publish. Will be ignored if not. |
ulong | expiration | The time in seconds since epoch after which these anchors may: expire. Use 0 for permanent anchors. The system may retain them longer. |
bool QueryStoredSpatialAnchors
Determine the maximum number of anchors to accept their completion status each update.
public bool QueryStoredSpatialAnchors(
Vector3 position,
float radius
)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the center of the query |
float | radius | The radius of the search area in meters. |
bool UpdateExpirationonStoredSpatialAnchor
Update the exiration time for published anchors in Spatial Anchor Storage.
public bool UpdateExpirationonStoredSpatialAnchor(
List< string > AnchorMapPositionIds,
ulong expiration
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | AnchorMapPositionIds | The list of AnchorMapPositionIds to Delete. These were assigned in the OnPublishComplete event in MagicLeapSpatialAnchorsStorageFeature. |
ulong | expiration | The time in seconds since epoch after which these anchors may: expire. The system may retain them longer. |
Protected Methods
OnInstanceCreate
protected override bool OnInstanceCreate(
ulong xrInstance
)
Parameters
Type | Name | Description |
---|---|---|
ulong | xrInstance |
OnInstanceDestroy
protected override void OnInstanceDestroy(
ulong xrInstance
)
Parameters
Type | Name | Description |
---|---|---|
ulong | xrInstance |
Public Attributes
ExtensionName
public const string ExtensionName = "XR_ML_spatial_anchors_storage XR_EXT_future";
FeatureId
public const string FeatureId = "com.magicleap.openxr.feature.ml2_spatialanchorstorage";
Public Events
OnCreationCompleteFromStorage
public OnCreationCompleteFromStorageEvent OnCreationCompleteFromStorage()
OnDeletedComplete
public OnDeletedCompleteEvent OnDeletedComplete()
OnPublishComplete
public OnPublishCompleteEvent OnPublishComplete()
OnQueryComplete
public OnQueryCompleteEvent OnQueryComplete()
OnUpdateExpirationCompleted
public OnUpdateExpirationCompleteEvent OnUpdateExpirationCompleted()