Class MSFTSpatialAnchorPersistence
This extension allows persistence and retrieval of spatial anchors sharing and localization across application sessions on a device. Spatial anchors persisted during an application session on a device will only be able to be retrieved during sessions of that same application on the same device. This extension requires XR_MSFT_spatial_anchor to also be enabled.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsXrResult.static final intExtendsXrResult.static final intXR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFTstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsXrObjectType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, long spatialAnchorCreateInfo, long spatialAnchor) Unsafe version of:CreateSpatialAnchorFromPersistedNameMSFTstatic intnxrCreateSpatialAnchorStoreConnectionMSFT(XrSession session, long spatialAnchorStore) Unsafe version of:CreateSpatialAnchorStoreConnectionMSFTstatic intnxrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, int spatialAnchorNameCapacityInput, long spatialAnchorNameCountOutput, long spatialAnchorNames) Unsafe version of:EnumeratePersistedSpatialAnchorNamesMSFTstatic intnxrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceInfo) Unsafe version of:PersistSpatialAnchorMSFTstatic intnxrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceName) Unsafe version of:UnpersistSpatialAnchorMSFTstatic intxrClearSpatialAnchorStoreMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore) Clear all spatial anchors from the spatial anchor store.static intxrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT spatialAnchorCreateInfo, org.lwjgl.PointerBuffer spatialAnchor) Create a spatial anchor from the spatial anchor store by name.static intxrCreateSpatialAnchorStoreConnectionMSFT(XrSession session, org.lwjgl.PointerBuffer spatialAnchorStore) Create a handle to track a connection to the spatial anchor store.static intxrDestroySpatialAnchorStoreConnectionMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore) Destroys the anchor store handle.static intxrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, IntBuffer spatialAnchorNameCountOutput, @Nullable XrSpatialAnchorPersistenceNameMSFT.Buffer spatialAnchorNames) Enumerate the names of currently persisted spatial anchors in the spatial anchor store.static intxrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, XrSpatialAnchorPersistenceInfoMSFT spatialAnchorPersistenceInfo) Persist the spatial anchor in the spatial anchor store.static intxrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, XrSpatialAnchorPersistenceNameMSFT spatialAnchorPersistenceName) Removes an anchor from the store.
-
Field Details
-
XR_MSFT_spatial_anchor_persistence_SPEC_VERSION
public static final int XR_MSFT_spatial_anchor_persistence_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_MSFT_SPATIAL_ANCHOR_PERSISTENCE_EXTENSION_NAME
The extension name.- See Also:
-
XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFT
public static final int XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFTExtendsXrObjectType.- See Also:
-
XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT
public static final int XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFTExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT
public static final int XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFTExtendsXrStructureType.Enum values:
- See Also:
-
XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT
public static final int XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFTExtendsXrResult.Enum values:
- See Also:
-
XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT
public static final int XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFTExtendsXrResult.Enum values:
- See Also:
-
XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT
public static final int XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFTXR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT- See Also:
-
-
Method Details
-
nxrCreateSpatialAnchorStoreConnectionMSFT
public static int nxrCreateSpatialAnchorStoreConnectionMSFT(XrSession session, long spatialAnchorStore) Unsafe version of:CreateSpatialAnchorStoreConnectionMSFT -
xrCreateSpatialAnchorStoreConnectionMSFT
public static int xrCreateSpatialAnchorStoreConnectionMSFT(XrSession session, org.lwjgl.PointerBuffer spatialAnchorStore) Create a handle to track a connection to the spatial anchor store.C Specification
The application can use the
CreateSpatialAnchorStoreConnectionMSFTfunction to create an handle to the spatial anchor store. The application can use this handle to interact with the spatial anchor store in order to persist anchors across application sessions.The
CreateSpatialAnchorStoreConnectionMSFTfunction may be a slow operation and therefore should be invoked from a non-timing critical thread.XrResult xrCreateSpatialAnchorStoreConnectionMSFT( XrSession session, XrSpatialAnchorStoreConnectionMSFT* spatialAnchorStore);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingCreateSpatialAnchorStoreConnectionMSFT sessionmust be a validXrSessionhandlespatialAnchorStoremust be a pointer to anXrSpatialAnchorStoreConnectionMSFThandle
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
session- theXrSessionthe anchor was created with.spatialAnchorStore- a pointer to theXrSpatialAnchorStoreConnectionMSFThandle.
- The
-
xrDestroySpatialAnchorStoreConnectionMSFT
public static int xrDestroySpatialAnchorStoreConnectionMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore) Destroys the anchor store handle.C Specification
The application can use the
DestroySpatialAnchorStoreConnectionMSFTfunction to destroy an anchor store connection.XrResult xrDestroySpatialAnchorStoreConnectionMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingDestroySpatialAnchorStoreConnectionMSFT spatialAnchorStoremust be a validXrSpatialAnchorStoreConnectionMSFThandle
Thread Safety
- Access to
spatialAnchorStore, and any child handles, must be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
spatialAnchorStore- theXrSpatialAnchorStoreConnectionMSFTto be destroyed.
- The
-
nxrPersistSpatialAnchorMSFT
public static int nxrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceInfo) Unsafe version of:PersistSpatialAnchorMSFT -
xrPersistSpatialAnchorMSFT
public static int xrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, XrSpatialAnchorPersistenceInfoMSFT spatialAnchorPersistenceInfo) Persist the spatial anchor in the spatial anchor store.C Specification
The application can use the
PersistSpatialAnchorMSFTfunction to persist a spatial anchor in the spatial anchor store for this application. The givenXrSpatialAnchorPersistenceInfoMSFT::spatialAnchorPersistenceNamewill be the string to retrieve the spatial anchor from the Spatial Anchor store or subsequently remove the record of this spatial anchor from the store. This name will uniquely identify the spatial anchor for the current application. If there is already a spatial anchor of the same name persisted in the spatial anchor store, the existing spatial anchor will be replaced andPersistSpatialAnchorMSFTmust returnSUCCESS.XrResult xrPersistSpatialAnchorMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, const XrSpatialAnchorPersistenceInfoMSFT* spatialAnchorPersistenceInfo);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingPersistSpatialAnchorMSFT spatialAnchorStoremust be a validXrSpatialAnchorStoreConnectionMSFThandlespatialAnchorPersistenceInfomust be a pointer to a validXrSpatialAnchorPersistenceInfoMSFTstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
spatialAnchorStore- theXrSpatialAnchorStoreConnectionMSFTwith which to persist theXrSpatialAnchorPersistenceInfoMSFT::spatialAnchor.spatialAnchorPersistenceInfo- a pointer toXrSpatialAnchorPersistenceInfoMSFTstructure to specify the anchor and its name to persist.
- The
-
nxrEnumeratePersistedSpatialAnchorNamesMSFT
public static int nxrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, int spatialAnchorNameCapacityInput, long spatialAnchorNameCountOutput, long spatialAnchorNames) Unsafe version of:EnumeratePersistedSpatialAnchorNamesMSFT- Parameters:
spatialAnchorNameCapacityInput- the capacity of thespatialAnchorNamesarray, or 0 to indicate a request to retrieve the required capacity.
-
xrEnumeratePersistedSpatialAnchorNamesMSFT
public static int xrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, IntBuffer spatialAnchorNameCountOutput, @Nullable XrSpatialAnchorPersistenceNameMSFT.Buffer spatialAnchorNames) Enumerate the names of currently persisted spatial anchors in the spatial anchor store.C Specification
The application can use the
EnumeratePersistedSpatialAnchorNamesMSFTfunction to enumerate the names of all spatial anchors currently persisted in the spatial anchor store for this application. This function follows the two-call idiom for filling thespatialAnchorNames.XrResult xrEnumeratePersistedSpatialAnchorNamesMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, uint32_t spatialAnchorNameCapacityInput, uint32_t* spatialAnchorNameCountOutput, XrSpatialAnchorPersistenceNameMSFT* spatialAnchorNames);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingEnumeratePersistedSpatialAnchorNamesMSFT spatialAnchorStoremust be a validXrSpatialAnchorStoreConnectionMSFThandlespatialAnchorNameCountOutputmust be a pointer to auint32_tvalue- If
spatialAnchorNameCapacityInputis not 0,spatialAnchorNamesmust be a pointer to an array ofspatialAnchorNameCapacityInputXrSpatialAnchorPersistenceNameMSFTstructures
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
spatialAnchorStore- theXrSpatialAnchorStoreConnectionMSFTanchor store to perform the enumeration operation on.spatialAnchorNameCountOutput- filled in by the runtime with the count of anchor names written or the required capacity in the case thatspatialAnchorNameCapacityInputis insufficient.spatialAnchorNames- a pointer to an array ofXrSpatialAnchorPersistenceNameMSFTstructures, but can beNULLif propertyCapacityInput is 0.
- The
-
nxrCreateSpatialAnchorFromPersistedNameMSFT
public static int nxrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, long spatialAnchorCreateInfo, long spatialAnchor) Unsafe version of:CreateSpatialAnchorFromPersistedNameMSFT -
xrCreateSpatialAnchorFromPersistedNameMSFT
public static int xrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT spatialAnchorCreateInfo, org.lwjgl.PointerBuffer spatialAnchor) Create a spatial anchor from the spatial anchor store by name.C Specification
The application can use the
CreateSpatialAnchorFromPersistedNameMSFTfunction to create aXrSpatialAnchorMSFTfrom the spatial anchor store. If theXrSpatialAnchorFromPersistedAnchorCreateInfoMSFT::spatialAnchorPersistenceNameprovided does not correspond to a currently stored anchor (i.e. the list of spatial anchor names returned fromEnumeratePersistedSpatialAnchorNamesMSFT), the function must returnERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT.XrResult xrCreateSpatialAnchorFromPersistedNameMSFT( XrSession session, const XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT* spatialAnchorCreateInfo, XrSpatialAnchorMSFT* spatialAnchor);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingCreateSpatialAnchorFromPersistedNameMSFT sessionmust be a validXrSessionhandlespatialAnchorCreateInfomust be a pointer to a validXrSpatialAnchorFromPersistedAnchorCreateInfoMSFTstructurespatialAnchormust be a pointer to anXrSpatialAnchorMSFThandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- a handle to anXrSessionpreviously created withCreateSession.spatialAnchorCreateInfo- a pointer to theXrSpatialAnchorFromPersistedAnchorCreateInfoMSFT.spatialAnchor- a pointer to anXrSpatialAnchorMSFThandle that will be set by the runtime on successful load.
- The
-
nxrUnpersistSpatialAnchorMSFT
public static int nxrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceName) Unsafe version of:UnpersistSpatialAnchorMSFT -
xrUnpersistSpatialAnchorMSFT
public static int xrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, XrSpatialAnchorPersistenceNameMSFT spatialAnchorPersistenceName) Removes an anchor from the store.C Specification
The application can use the
UnpersistSpatialAnchorMSFTfunction to remove the record of the anchor in the spatial anchor store. This operation will not affect anyXrSpatialAnchorMSFThandles previously created. If thespatialAnchorPersistenceNameprovided does not correspond to a currently stored anchor, the function must returnERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT.XrResult xrUnpersistSpatialAnchorMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, const XrSpatialAnchorPersistenceNameMSFT* spatialAnchorPersistenceName);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingUnpersistSpatialAnchorMSFT spatialAnchorStoremust be a validXrSpatialAnchorStoreConnectionMSFThandlespatialAnchorPersistenceNamemust be a pointer to a validXrSpatialAnchorPersistenceNameMSFTstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
spatialAnchorStore- anXrSpatialAnchorStoreConnectionMSFTanchor store to perform the unpersist operation on.spatialAnchorPersistenceName- a pointer to theXrSpatialAnchorPersistenceNameMSFT.
- The
-
xrClearSpatialAnchorStoreMSFT
public static int xrClearSpatialAnchorStoreMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore) Clear all spatial anchors from the spatial anchor store.C Specification
The application can use the
ClearSpatialAnchorStoreMSFTfunction to remove all spatial anchors from the spatial anchor store for this application. The function only removes the record of the spatial anchors in the store but does not affect anyXrSpatialAnchorMSFThandles previously loaded in the current session.XrResult xrClearSpatialAnchorStoreMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore);Valid Usage (Implicit)
- The
XR_MSFT_spatial_anchor_persistenceextension must be enabled prior to callingClearSpatialAnchorStoreMSFT spatialAnchorStoremust be a validXrSpatialAnchorStoreConnectionMSFThandle
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
spatialAnchorStore-XrSpatialAnchorStoreConnectionMSFTto perform the clear operation on.
- The
-