Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class MSFTSpatialAnchor

extends Object
Class Inheritance
Imports
org.lwjgl.*, org.lwjgl.system.*

The XR_MSFT_spatial_anchor extension.

This extension allows an application to create a spatial anchor, an arbitrary freespace point in the user’s physical environment that will then be tracked by the runtime. The runtime should then adjust the position and orientation of that anchor’s origin over time as needed, independently of all other spaces and anchors, to ensure that it maintains its original mapping to the real world.

Field Summary

Modifier and TypeField and Description
public static final int
public static final String
public static final int
XR_MSFT_spatial_anchor_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
nxrCreateSpatialAnchorMSFT(XrSession session, long createInfo, long anchor)

Unsafe version of: CreateSpatialAnchorMSFT

public static int
nxrCreateSpatialAnchorSpaceMSFT(XrSession session, long createInfo, long space)

Unsafe version of: CreateSpatialAnchorSpaceMSFT

public static int
xrCreateSpatialAnchorMSFT(XrSession
a handle to an XrSession.
session
,
XrSpatialAnchorCreateInfoMSFT
a pointer to an XrSpatialAnchorCreateInfoMSFT structure containing information about how to create the anchor.
createInfo
,
PointerBuffer
a pointer to a handle in which the created XrSpatialAnchorMSFT is returned.
anchor
)

Creates a spatial anchor.

public static int
xrCreateSpatialAnchorSpaceMSFT(XrSession
a handle to an XrSession.
session
,
XrSpatialAnchorSpaceCreateInfoMSFT
a pointer to an XrSpatialAnchorSpaceCreateInfoMSFT structure containing information about how to create the anchor.
createInfo
,
PointerBuffer
a pointer to a handle in which the created XrSpace is returned.
space
)

Creates a space from a spatial anchor.

public static int
xrDestroySpatialAnchorMSFT(XrSpatialAnchorMSFT
a handle to an XrSpatialAnchorMSFT previously created by CreateSpatialAnchorMSFT.
anchor
)

Destroys a spatial anchor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFTback to summary
public static final int XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT

Extends XrResult.

XR_MSFT_SPATIAL_ANCHOR_EXTENSION_NAMEback to summary
public static final String XR_MSFT_SPATIAL_ANCHOR_EXTENSION_NAME

The extension name.

XR_MSFT_spatial_anchor_SPEC_VERSIONback to summary
public static final int XR_MSFT_spatial_anchor_SPEC_VERSION

The extension specification version.

XR_OBJECT_TYPE_SPATIAL_ANCHOR_MSFTback to summary
public static final int XR_OBJECT_TYPE_SPATIAL_ANCHOR_MSFT

Extends XrObjectType.

XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFTback to summary
public static final int XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT

Extends XrStructureType.

Enum values:
XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFTback to summary
public static final int XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT

Extends XrStructureType.

Enum values:

Constructor Detail

MSFTSpatialAnchorback to summary
protected MSFTSpatialAnchor()

Method Detail

nxrCreateSpatialAnchorMSFTback to summary
public static int nxrCreateSpatialAnchorMSFT(XrSession session, long createInfo, long anchor)

Unsafe version of: CreateSpatialAnchorMSFT

nxrCreateSpatialAnchorSpaceMSFTback to summary
public static int nxrCreateSpatialAnchorSpaceMSFT(XrSession session, long createInfo, long space)

Unsafe version of: CreateSpatialAnchorSpaceMSFT

xrCreateSpatialAnchorMSFTback to summary
public static int xrCreateSpatialAnchorMSFT(XrSession session, XrSpatialAnchorCreateInfoMSFT createInfo, PointerBuffer anchor)

Creates a spatial anchor.

C Specification

The CreateSpatialAnchorMSFT function is defined as:


XrResult xrCreateSpatialAnchorMSFT(
    XrSession                                   session,
    const XrSpatialAnchorCreateInfoMSFT*        createInfo,
    XrSpatialAnchorMSFT*                        anchor);
Description

Creates an XrSpatialAnchorMSFT handle representing a spatial anchor that will track a fixed location in the physical world over time. That real-world location is specified by the position and orientation of the specified pose within space at time.

The runtime must avoid long blocking operations such as networking or disk operations for CreateSpatialAnchorMSFT function. The application may safely use this function in UI thread. Though, the created anchor handle may not be ready immediately for certain operations yet. For example, the corresponding anchor space may not return valid location, or its location may not be successfully saved in anchor store.

If space cannot be located relative to the environment at the moment of the call to CreateSpatialAnchorMSFT, the runtime must return ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT.

After the anchor is created, the runtime should then adjust its position and orientation over time relative to other spaces so as to maintain maximum alignment to its original real-world location, even if that changes the anchor’s relationship to the original space used to initialize it.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorCreateInfoMSFT

Parameters
session:XrSession

a handle to an XrSession.

createInfo:XrSpatialAnchorCreateInfoMSFT

a pointer to an XrSpatialAnchorCreateInfoMSFT structure containing information about how to create the anchor.

anchor:PointerBuffer

a pointer to a handle in which the created XrSpatialAnchorMSFT is returned.

Annotations
@NativeType:XrResult
xrCreateSpatialAnchorSpaceMSFTback to summary
public static int xrCreateSpatialAnchorSpaceMSFT(XrSession session, XrSpatialAnchorSpaceCreateInfoMSFT createInfo, PointerBuffer space)

Creates a space from a spatial anchor.

C Specification

The CreateSpatialAnchorSpaceMSFT function is defined as:


XrResult xrCreateSpatialAnchorSpaceMSFT(
    XrSession                                   session,
    const XrSpatialAnchorSpaceCreateInfoMSFT*   createInfo,
    XrSpace*                                    space);
Description

Creates an XrSpace handle based on a spatial anchor. Application can provide an XrPosef to define the position and orientation of the new space’s origin relative to the anchor’s natural origin.

Multiple XrSpace handles may exist for a given XrSpatialAnchorMSFT simultaneously, up to some limit imposed by the runtime. The XrSpace handle must be eventually freed via the DestroySpace function or by destroying the parent XrSpatialAnchorMSFT handle.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrSpatialAnchorSpaceCreateInfoMSFT

Parameters
session:XrSession

a handle to an XrSession.

createInfo:XrSpatialAnchorSpaceCreateInfoMSFT

a pointer to an XrSpatialAnchorSpaceCreateInfoMSFT structure containing information about how to create the anchor.

space:PointerBuffer

a pointer to a handle in which the created XrSpace is returned.

Annotations
@NativeType:XrResult
xrDestroySpatialAnchorMSFTback to summary
public static int xrDestroySpatialAnchorMSFT(XrSpatialAnchorMSFT anchor)

Destroys a spatial anchor.

C Specification

The DestroySpatialAnchorMSFT function is defined as:


XrResult xrDestroySpatialAnchorMSFT(
    XrSpatialAnchorMSFT                         anchor);
Description

XrSpatialAnchorMSFT handles are destroyed using DestroySpatialAnchorMSFT. By destroying an anchor, the runtime can stop spending resources used to maintain tracking for that anchor’s origin.

Valid Usage (Implicit)
Thread Safety
  • Access to anchor, and any child handles, must be externally synchronized
Return Codes
On success, this command returns
On failure, this command returns
See Also

CreateSpatialAnchorMSFT

Parameters
anchor:XrSpatialAnchorMSFT

a handle to an XrSpatialAnchorMSFT previously created by CreateSpatialAnchorMSFT.

Annotations
@NativeType:XrResult