MagicLeapSpatialAnchorsStorageFeature
NameSpace: SpatialAnchors
Inherits from:
MagicLeapOpenXRFeatureBase,
OpenXRFeature
Public Methods
bool CreateSpatialAnchorsFromStorage
public bool CreateSpatialAnchorsFromStorage(
List< string > anchorMapPositionIds
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | anchorMapPositionIds |
bool DeleteStoredSpatialAnchor
public bool DeleteStoredSpatialAnchor(
List< string > anchorMapPositionIds
)
Parameters
Type | Name | Description |
---|---|---|
List< string > | anchorMapPositionIds |
bool DeleteStoredSpatialAnchors
Delete published anchors from Spatial Anchor Storage.
public bool DeleteStoredSpatialAnchors(
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. |
bool DeleteStoredSpatialAnchors
public bool DeleteStoredSpatialAnchors(
List< ARAnchor > anchors
)
Parameters
Type | Name | Description |
---|---|---|
List< ARAnchor > | anchors |
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 UpdateExpirationForStoredSpatialAnchor
Update the expiration time for published anchors in Spatial Anchor Storage.
public bool UpdateExpirationForStoredSpatialAnchor(
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. |
bool UpdateExpirationForStoredSpatialAnchor
public bool UpdateExpirationForStoredSpatialAnchor(
List< ARAnchor > anchors,
ulong expiration
)
Parameters
Type | Name | Description |
---|---|---|
List< ARAnchor > | anchors | |
ulong | expiration |
bool UpdateExpirationonStoredSpatialAnchor
Update the expiration 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 |
OnSessionDestroy
protected override void OnSessionDestroy(
ulong xrSession
)
Parameters
Type | Name | Description |
---|---|---|
ulong | xrSession |
Public Attributes
FeatureId
public const string FeatureId = "com.magicleap.openxr.feature.ml2_spatialanchorstorage";
Protected Attributes
UsesExperimentalExtensions
protected override bool UsesExperimentalExtensions => true;
Public Events
OnCreationCompleteFromStorage
Receive the created anchor's Pose, the anchor's ulong AnchorId, the anchor's string anchorMapPositionId for the localized Map, and the XResult of the request to create the anchor.
public Action< Pose, ulong, string, XrResult > OnCreationCompleteFromStorage()
OnDeletedComplete
Receive a list of string anchorMapPositionIds of anchors that have been deleted from the Localized Map.
public Action< List< string > > OnDeletedComplete()
OnPublishComplete
Receive an ulong AnchorId and a string anchorMapPositionId for the published anchor.
public Action< ulong, string > OnPublishComplete()
OnQueryComplete
Receive a list of string anchorMapPositionIds of anchors returned from the Query of the Localized Map.
public Action< List< string > > OnQueryComplete()
OnUpdateExpirationCompleted
Receive a list of string anchorMapPositionIds of anchors that have had their expiration updated on the Localized Map.
public Action< List< string > > OnUpdateExpirationCompleted()