openxr-0.1: Bindings to the OpenXR API
Safe HaskellNone
LanguageHaskell2010

OpenXR.Extensions.XR_MSFT_perception_anchor_interop

Description

Name

XR_MSFT_perception_anchor_interop - instance extension

Specification

See XR_MSFT_perception_anchor_interop in the main specification for complete information.

Registered Extension Number

57

Revision

1

Extension and Version Dependencies

  • Requires OpenXR 1.0
  • Requires @@

See Also

createSpatialAnchorFromPerceptionAnchorMSFT, tryGetPerceptionAnchorFromSpatialAnchorMSFT

Document Notes

For more information, see the OpenXR Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

createSpatialAnchorFromPerceptionAnchorMSFT Source #

Arguments

:: forall io. MonadIO io 
=> Session

session is the specified Session.

-> ("perceptionAnchor" ::: Ptr IUnknown)

perceptionAnchor is an IUnknown pointer to a Windows.Perception.Spatial.SpatialAnchor object.

-> io SpatialAnchorMSFT 

xrCreateSpatialAnchorFromPerceptionAnchorMSFT - Create a SpatialAnchorMSFT from a Windows SpatialAnchor pointer

Parameter Descriptions

Description

The input perceptionAnchor must support successful QueryInterface to Windows.Perception.Spatial.SpatialAnchor , otherwise the runtime must return ERROR_VALIDATION_FAILURE.

If the function successfully returned, the output anchor must be a valid handle. This also increments the refcount of the perceptionAnchor object.

When application is done with the anchor handle, it can be destroyed using destroySpatialAnchorMSFT function. This also decrements the refcount of underlying windows perception anchor object.

Valid Usage (Implicit)

Return Codes

Success
Failure

See Also

Session, SpatialAnchorMSFT

withSpatialAnchorFromPerceptionAnchorMSFT :: forall io r. MonadIO io => Session -> Ptr IUnknown -> (io SpatialAnchorMSFT -> (SpatialAnchorMSFT -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createSpatialAnchorFromPerceptionAnchorMSFT and destroySpatialAnchorMSFT

To ensure that destroySpatialAnchorMSFT is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

tryGetPerceptionAnchorFromSpatialAnchorMSFT Source #

Arguments

:: forall io. MonadIO io 
=> Session

session is the specified Session.

-> SpatialAnchorMSFT

anchor is a valid SpatialAnchorMSFT handle.

-> io ("perceptionAnchor" ::: Ptr IUnknown) 

xrTryGetPerceptionAnchorFromSpatialAnchorMSFT - Convert a SpatialAnchorMSFT to a Windows SpatialAnchor

Parameter Descriptions

Description

If the runtime can convert the anchor to a Windows.Perception.Spatial.SpatialAnchor object, this function must return SUCCESS, and the output IUnknown in the pointer of perceptionAnchor must be not NULL. This also increments the refcount of the object. The application can then use QueryInterface to 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 as winrt::com_ptr.

If the runtime cannot convert the anchor to a Windows.Perception.Spatial.SpatialAnchor object, the function must return SUCCESS, and the output IUnknown in the pointer of perceptionAnchor must be NULL.

Valid Usage (Implicit)

  • session must be a valid Session handle
  • anchor must be a valid SpatialAnchorMSFT handle
  • perceptionAnchor must be a pointer to a pointer to an IUnknown value
  • anchor must have been created, allocated, or retrieved from session

Return Codes

Success
Failure

See Also

Session, SpatialAnchorMSFT

type MSFT_PERCEPTION_ANCHOR_INTEROP_EXTENSION_NAME = "XR_MSFT_perception_anchor_interop" Source #

data SpatialAnchorMSFT Source #

XrSpatialAnchorMSFT - Represents a spatial anchor

Description

Spatial anchors are often used in combination with an UNBOUNDED_MSFT reference space. UNBOUNDED_MSFT reference spaces adjust their origin as necessary to keep the viewer’s coordinates relative to the space’s origin stable. Such adjustments maintain the visual stability of content currently near the viewer, but may cause content placed far from the viewer to drift in its alignment to the real world by the time the user moves close again. By creating an SpatialAnchorMSFT where a piece of content is placed and then always rendering that content relative to its anchor’s space, an application can ensure that each piece of content stays at a fixed location in the environment.

See Also

SpatialAnchorSpaceCreateInfoMSFT, createSpatialAnchorFromPerceptionAnchorMSFT, createSpatialAnchorMSFT, destroySpatialAnchorMSFT, tryGetPerceptionAnchorFromSpatialAnchorMSFT

destroySpatialAnchorMSFT Source #

Arguments

:: forall io. MonadIO io 
=> SpatialAnchorMSFT

anchor is a handle to an SpatialAnchorMSFT previously created by createSpatialAnchorMSFT.

-> io () 

xrDestroySpatialAnchorMSFT - Destroys a spatial anchor

Parameter Descriptions

Description

SpatialAnchorMSFT 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)

Return Codes

Success
Failure

See Also

SpatialAnchorMSFT, createSpatialAnchorMSFT