Class MSFTPerceptionAnchorInterop
This extension supports conversion between XrSpatialAnchorMSFT and Windows.Perception.Spatial.SpatialAnchor. An application can use this extension to persist spatial anchors on the Windows device through SpatialAnchorStore or transfer spatial anchors between devices through SpatialAnchorTransferManager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCreateSpatialAnchorFromPerceptionAnchorMSFT(XrSession session, long perceptionAnchor, long anchor) Unsafe version of:CreateSpatialAnchorFromPerceptionAnchorMSFTstatic intnxrTryGetPerceptionAnchorFromSpatialAnchorMSFT(XrSession session, XrSpatialAnchorMSFT anchor, long perceptionAnchor) Unsafe version of:TryGetPerceptionAnchorFromSpatialAnchorMSFTstatic intxrCreateSpatialAnchorFromPerceptionAnchorMSFT(XrSession session, long perceptionAnchor, org.lwjgl.PointerBuffer anchor) Create anXrSpatialAnchorMSFTfrom a Windows SpatialAnchor pointer.static intxrTryGetPerceptionAnchorFromSpatialAnchorMSFT(XrSession session, XrSpatialAnchorMSFT anchor, org.lwjgl.PointerBuffer perceptionAnchor) Convert anXrSpatialAnchorMSFTto a Windows SpatialAnchor.
-
Field Details
-
XR_MSFT_perception_anchor_interop_SPEC_VERSION
public static final int XR_MSFT_perception_anchor_interop_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_MSFT_PERCEPTION_ANCHOR_INTEROP_EXTENSION_NAME
The extension name.- See Also:
-
-
Method Details
-
nxrCreateSpatialAnchorFromPerceptionAnchorMSFT
public static int nxrCreateSpatialAnchorFromPerceptionAnchorMSFT(XrSession session, long perceptionAnchor, long anchor) Unsafe version of:CreateSpatialAnchorFromPerceptionAnchorMSFT -
xrCreateSpatialAnchorFromPerceptionAnchorMSFT
public static int xrCreateSpatialAnchorFromPerceptionAnchorMSFT(XrSession session, long perceptionAnchor, org.lwjgl.PointerBuffer anchor) Create anXrSpatialAnchorMSFTfrom a Windows SpatialAnchor pointer.C Specification
The
CreateSpatialAnchorFromPerceptionAnchorMSFTfunction creates aXrSpatialAnchorMSFThandle from anIUnknownpointer to Windows.Perception.Spatial.SpatialAnchor.XrResult xrCreateSpatialAnchorFromPerceptionAnchorMSFT( XrSession session, IUnknown* perceptionAnchor, XrSpatialAnchorMSFT* anchor);Description
The input
perceptionAnchormust support successfulQueryInterfaceto Windows.Perception.Spatial.SpatialAnchor , otherwise the runtime must returnERROR_VALIDATION_FAILURE.If the function successfully returned, the output
anchormust be a valid handle. This also increments the refcount of theperceptionAnchorobject.When application is done with the
anchorhandle, it can be destroyed usingDestroySpatialAnchorMSFTfunction. This also decrements the refcount of underlying windows perception anchor object.Valid Usage (Implicit)
- The
XR_MSFT_perception_anchor_interopextension must be enabled prior to callingCreateSpatialAnchorFromPerceptionAnchorMSFT sessionmust be a validXrSessionhandleperceptionAnchormust be a pointer to anIUnknownvalueanchormust be a pointer to anXrSpatialAnchorMSFThandle
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
session- the specifiedXrSession.perceptionAnchor- an IUnknown pointer to a Windows.Perception.Spatial.SpatialAnchor object.anchor- a pointer toXrSpatialAnchorMSFTto receive the returned anchor handle.
- The
-
nxrTryGetPerceptionAnchorFromSpatialAnchorMSFT
public static int nxrTryGetPerceptionAnchorFromSpatialAnchorMSFT(XrSession session, XrSpatialAnchorMSFT anchor, long perceptionAnchor) Unsafe version of:TryGetPerceptionAnchorFromSpatialAnchorMSFT -
xrTryGetPerceptionAnchorFromSpatialAnchorMSFT
public static int xrTryGetPerceptionAnchorFromSpatialAnchorMSFT(XrSession session, XrSpatialAnchorMSFT anchor, org.lwjgl.PointerBuffer perceptionAnchor) Convert anXrSpatialAnchorMSFTto a Windows SpatialAnchor.C Specification
The
TryGetPerceptionAnchorFromSpatialAnchorMSFTfunction converts aXrSpatialAnchorMSFThandle into anIUnknownpointer to Windows.Perception.Spatial.SpatialAnchor.XrResult xrTryGetPerceptionAnchorFromSpatialAnchorMSFT( XrSession session, XrSpatialAnchorMSFT anchor, IUnknown** perceptionAnchor);Description
If the runtime can convert the
anchorto a Windows.Perception.Spatial.SpatialAnchor object, this function must returnSUCCESS, and the outputIUnknownin the pointer ofperceptionAnchormust be notNULL. This also increments the refcount of the object. The application can then useQueryInterfaceto get the pointer for Windows.Perception.Spatial.SpatialAnchor object. The application should release the COM pointer after done with the object, or attach it to a smart COM pointer such aswinrt::com_ptr.If the runtime cannot convert the
anchorto a Windows.Perception.Spatial.SpatialAnchor object, the function must returnSUCCESS, and the outputIUnknownin the pointer ofperceptionAnchormust beNULL.Valid Usage (Implicit)
- The
XR_MSFT_perception_anchor_interopextension must be enabled prior to callingTryGetPerceptionAnchorFromSpatialAnchorMSFT sessionmust be a validXrSessionhandleanchormust be a validXrSpatialAnchorMSFThandleperceptionAnchormust be a pointer to a pointer to anIUnknownvalueanchormust have been created, allocated, or retrieved fromsession
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
session- the specifiedXrSession.anchor- a validXrSpatialAnchorMSFThandle.perceptionAnchor- a valid pointer to IUnknown pointer to receive the output Windows.Perception.Spatial.SpatialAnchor object.
- The
-