Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class MSFTSpatialAnchorPersistence

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

The XR_MSFT_spatial_anchor_persistence extension.

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

Modifier and TypeField and Description
public static final int
public static final int
public static final int
XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT

XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT

public static final String
public static final int
XR_MSFT_spatial_anchor_persistence_SPEC_VERSION

The extension specification version.

public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, long spatialAnchorCreateInfo, long spatialAnchor)

Unsafe version of: CreateSpatialAnchorFromPersistedNameMSFT

public static int
public static int
nxrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, int
the capacity of the spatialAnchorNames array, or 0 to indicate a request to retrieve the required capacity.
spatialAnchorNamesCapacityInput
,
long spatialAnchorNamesCountOutput, long persistedAnchorNames)

Unsafe version of: EnumeratePersistedSpatialAnchorNamesMSFT

public static int
nxrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceInfo)

Unsafe version of: PersistSpatialAnchorMSFT

public static int
nxrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceName)

Unsafe version of: UnpersistSpatialAnchorMSFT

public static int
xrClearSpatialAnchorStoreMSFT(XrSpatialAnchorStoreConnectionMSFT
XrSpatialAnchorStoreConnectionMSFT to perform the clear operation on.
spatialAnchorStore
)

Clear all spatial anchors from the spatial anchor store.

public static int
xrCreateSpatialAnchorFromPersistedNameMSFT(XrSession
a handle to an XrSession previously created with CreateSession.
session
,
XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT spatialAnchorCreateInfo, PointerBuffer
a pointer to an XrSpatialAnchorMSFT handle that will be set by the runtime on successful load.
spatialAnchor
)

Create a spatial anchor from the spatial anchor store by name.

public static int
xrCreateSpatialAnchorStoreConnectionMSFT(XrSession
the XrSession the anchor was created with.
session
,
PointerBuffer
a pointer to the XrSpatialAnchorStoreConnectionMSFT handle.
spatialAnchorStore
)

Create a handle to track a connection to the spatial anchor store.

public static int
xrDestroySpatialAnchorStoreConnectionMSFT(XrSpatialAnchorStoreConnectionMSFT
the XrSpatialAnchorStoreConnectionMSFT to be destroyed.
spatialAnchorStore
)

Destroys the anchor store handle.

public static int
xrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT
the XrSpatialAnchorStoreConnectionMSFT anchor store to perform the enumeration operation on.
spatialAnchorStore
,
IntBuffer
filled in by the runtime with the count of anchor names written or the required capacity in the case that spatialAnchorNamesCapacityInput is insufficient.
spatialAnchorNamesCountOutput
,
XrSpatialAnchorPersistenceNameMSFT.Buffer
a pointer to an array of XrSpatialAnchorPersistenceNameMSFT structures, but can be NULL if propertyCapacityInput is 0.
persistedAnchorNames
)

Enumerate the names of currently persisted spatial anchors in the spatial anchor store.

public static int
xrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT
the XrSpatialAnchorStoreConnectionMSFT with which to persist the spatialAnchor.
spatialAnchorStore
,
XrSpatialAnchorPersistenceInfoMSFT
a pointer to XrSpatialAnchorPersistenceInfoMSFT structure to specify the anchor and its name to persist.
spatialAnchorPersistenceInfo
)

Persist the spatial anchor in the spatial anchor store.

public static int
xrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT
an XrSpatialAnchorStoreConnectionMSFT anchor store to perform the unpersist operation on.
spatialAnchorStore
,
XrSpatialAnchorPersistenceNameMSFT spatialAnchorPersistenceName)

Removes an anchor from the store.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFTback to summary
public static final int XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT

Extends XrResult.

Enum values:
XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFTback to summary
public static final int XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT

Extends XrResult.

Enum values:
XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFTback to summary
public static final int XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT

XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT

XR_MSFT_SPATIAL_ANCHOR_PERSISTENCE_EXTENSION_NAMEback to summary
public static final String XR_MSFT_SPATIAL_ANCHOR_PERSISTENCE_EXTENSION_NAME

The extension name.

XR_MSFT_spatial_anchor_persistence_SPEC_VERSIONback to summary
public static final int XR_MSFT_spatial_anchor_persistence_SPEC_VERSION

The extension specification version.

XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFTback to summary
public static final int XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFT

Extends XrObjectType.

XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFTback to summary
public static final int XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT

Extends XrStructureType.

Enum values:
XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFTback to summary
public static final int XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT

Extends XrStructureType.

Enum values:

Constructor Detail

MSFTSpatialAnchorPersistenceback to summary
protected MSFTSpatialAnchorPersistence()

Method Detail

nxrCreateSpatialAnchorFromPersistedNameMSFTback to summary
public static int nxrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, long spatialAnchorCreateInfo, long spatialAnchor)

Unsafe version of: CreateSpatialAnchorFromPersistedNameMSFT

nxrCreateSpatialAnchorStoreConnectionMSFTback to summary
public static int nxrCreateSpatialAnchorStoreConnectionMSFT(XrSession session, long spatialAnchorStore)

Unsafe version of: CreateSpatialAnchorStoreConnectionMSFT

nxrEnumeratePersistedSpatialAnchorNamesMSFTback to summary
public static int nxrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, int spatialAnchorNamesCapacityInput, long spatialAnchorNamesCountOutput, long persistedAnchorNames)

Unsafe version of: EnumeratePersistedSpatialAnchorNamesMSFT

Parameters
spatialAnchorNamesCapacityInput:int

the capacity of the spatialAnchorNames array, or 0 to indicate a request to retrieve the required capacity.

nxrPersistSpatialAnchorMSFTback to summary
public static int nxrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceInfo)

Unsafe version of: PersistSpatialAnchorMSFT

nxrUnpersistSpatialAnchorMSFTback to summary
public static int nxrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, long spatialAnchorPersistenceName)

Unsafe version of: UnpersistSpatialAnchorMSFT

xrClearSpatialAnchorStoreMSFTback to summary
public static int xrClearSpatialAnchorStoreMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore)

Clear all spatial anchors from the spatial anchor store.

C Specification

The application can use the ClearSpatialAnchorStoreMSFT function 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 any XrSpatialAnchorMSFT handles previously loaded in the current session.


XrResult xrClearSpatialAnchorStoreMSFT(
    XrSpatialAnchorStoreConnectionMSFT          spatialAnchorStore);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
Parameters
spatialAnchorStore:XrSpatialAnchorStoreConnectionMSFT

XrSpatialAnchorStoreConnectionMSFT to perform the clear operation on.

Annotations
@NativeType:XrResult
xrCreateSpatialAnchorFromPersistedNameMSFTback to summary
public static int xrCreateSpatialAnchorFromPersistedNameMSFT(XrSession session, XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT spatialAnchorCreateInfo, PointerBuffer spatialAnchor)

Create a spatial anchor from the spatial anchor store by name.

C Specification

The application can use the CreateSpatialAnchorFromPersistedNameMSFT function to create a XrSpatialAnchorMSFT from the spatial anchor store. If the spatialAnchorName provided does not correspond to a currently stored anchor (i.e. the list of spatial anchor names returned from EnumeratePersistedSpatialAnchorNamesMSFT), the function must return ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT.


XrResult xrCreateSpatialAnchorFromPersistedNameMSFT(
    XrSession                                   session,
    const XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT* spatialAnchorCreateInfo,
    XrSpatialAnchorMSFT*                        spatialAnchor);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT

Parameters
session:XrSession

a handle to an XrSession previously created with CreateSession.

spatialAnchorCreateInfo:XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT

a pointer to the XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT.

spatialAnchor:PointerBuffer

a pointer to an XrSpatialAnchorMSFT handle that will be set by the runtime on successful load.

Annotations
@NativeType:XrResult
xrCreateSpatialAnchorStoreConnectionMSFTback to summary
public static int xrCreateSpatialAnchorStoreConnectionMSFT(XrSession session, PointerBuffer spatialAnchorStore)

Create a handle to track a connection to the spatial anchor store.

C Specification

The application can use the CreateSpatialAnchorStoreConnectionMSFT function 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 CreateSpatialAnchorStoreConnectionMSFT function 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)
Return Codes
On success, this command returns
On failure, this command returns
Parameters
session:XrSession

the XrSession the anchor was created with.

spatialAnchorStore:PointerBuffer

a pointer to the XrSpatialAnchorStoreConnectionMSFT handle.

Annotations
@NativeType:XrResult
xrDestroySpatialAnchorStoreConnectionMSFTback to summary
public static int xrDestroySpatialAnchorStoreConnectionMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore)

Destroys the anchor store handle.

C Specification

The application can use the DestroySpatialAnchorStoreConnectionMSFT function to destroy an anchor store connection.


XrResult xrDestroySpatialAnchorStoreConnectionMSFT(
    XrSpatialAnchorStoreConnectionMSFT          spatialAnchorStore);
Valid Usage (Implicit)
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:XrSpatialAnchorStoreConnectionMSFT

the XrSpatialAnchorStoreConnectionMSFT to be destroyed.

Annotations
@NativeType:XrResult
xrEnumeratePersistedSpatialAnchorNamesMSFTback to summary
public static int xrEnumeratePersistedSpatialAnchorNamesMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, IntBuffer spatialAnchorNamesCountOutput, XrSpatialAnchorPersistenceNameMSFT.Buffer persistedAnchorNames)

Enumerate the names of currently persisted spatial anchors in the spatial anchor store.

C Specification

The application can use the EnumeratePersistedSpatialAnchorNamesMSFT function 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 the spatialAnchorNames.


XrResult xrEnumeratePersistedSpatialAnchorNamesMSFT(
    XrSpatialAnchorStoreConnectionMSFT          spatialAnchorStore,
    uint32_t                                    spatialAnchorNamesCapacityInput,
    uint32_t*                                   spatialAnchorNamesCountOutput,
    XrSpatialAnchorPersistenceNameMSFT*         persistedAnchorNames);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorPersistenceNameMSFT

Parameters
spatialAnchorStore:XrSpatialAnchorStoreConnectionMSFT

the XrSpatialAnchorStoreConnectionMSFT anchor store to perform the enumeration operation on.

spatialAnchorNamesCountOutput:IntBuffer

filled in by the runtime with the count of anchor names written or the required capacity in the case that spatialAnchorNamesCapacityInput is insufficient.

persistedAnchorNames:XrSpatialAnchorPersistenceNameMSFT.Buffer

a pointer to an array of XrSpatialAnchorPersistenceNameMSFT structures, but can be NULL if propertyCapacityInput is 0.

Annotations
@NativeType:XrResult
xrPersistSpatialAnchorMSFTback to summary
public static int xrPersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, XrSpatialAnchorPersistenceInfoMSFT spatialAnchorPersistenceInfo)

Persist the spatial anchor in the spatial anchor store.

C Specification

The application can use the PersistSpatialAnchorMSFT function to persist a spatial anchor in the spatial anchor store for this application. The given spatialAnchorName will 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 and PersistSpatialAnchorMSFT must return SUCCESS.


XrResult xrPersistSpatialAnchorMSFT(
    XrSpatialAnchorStoreConnectionMSFT          spatialAnchorStore,
    const XrSpatialAnchorPersistenceInfoMSFT*   spatialAnchorPersistenceInfo);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorPersistenceInfoMSFT

Parameters
spatialAnchorStore:XrSpatialAnchorStoreConnectionMSFT

the XrSpatialAnchorStoreConnectionMSFT with which to persist the spatialAnchor.

spatialAnchorPersistenceInfo:XrSpatialAnchorPersistenceInfoMSFT

a pointer to XrSpatialAnchorPersistenceInfoMSFT structure to specify the anchor and its name to persist.

Annotations
@NativeType:XrResult
xrUnpersistSpatialAnchorMSFTback to summary
public static int xrUnpersistSpatialAnchorMSFT(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, XrSpatialAnchorPersistenceNameMSFT spatialAnchorPersistenceName)

Removes an anchor from the store.

C Specification

The application can use the UnpersistSpatialAnchorMSFT function to remove the record of the anchor in the spatial anchor store. This operation will not affect any XrSpatialAnchorMSFT handles previously created. If the spatialAnchorName provided does not correspond to a currently stored anchor, the function must return ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT.


XrResult xrUnpersistSpatialAnchorMSFT(
    XrSpatialAnchorStoreConnectionMSFT          spatialAnchorStore,
    const XrSpatialAnchorPersistenceNameMSFT*   spatialAnchorPersistenceName);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorPersistenceNameMSFT

Parameters
spatialAnchorStore:XrSpatialAnchorStoreConnectionMSFT

an XrSpatialAnchorStoreConnectionMSFT anchor store to perform the unpersist operation on.

spatialAnchorPersistenceName:XrSpatialAnchorPersistenceNameMSFT

a pointer to the XrSpatialAnchorPersistenceNameMSFT.

Annotations
@NativeType:XrResult