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

OpenXR.Extensions.XR_MSFT_spatial_anchor

Description

Name

XR_MSFT_spatial_anchor - instance extension

Specification

See XR_MSFT_spatial_anchor in the main specification for complete information.

Registered Extension Number

40

Revision

1

Extension and Version Dependencies

  • Requires OpenXR 1.0

See Also

createSpatialAnchorMSFT, createSpatialAnchorSpaceMSFT, destroySpatialAnchorMSFT

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

createSpatialAnchorMSFT Source #

Arguments

:: forall io. MonadIO io 
=> Session

session is a handle to an Session.

-> SpatialAnchorCreateInfoMSFT

createInfo is a pointer to an SpatialAnchorCreateInfoMSFT structure containing information about how to create the anchor.

-> io SpatialAnchorMSFT 

xrCreateSpatialAnchorMSFT - Creates a spatial anchor

Parameter Descriptions

Description

Creates an SpatialAnchorMSFT 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.

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

Success
Failure

See Also

Session, SpatialAnchorCreateInfoMSFT, SpatialAnchorMSFT

withSpatialAnchorMSFT :: forall io r. MonadIO io => Session -> SpatialAnchorCreateInfoMSFT -> (io SpatialAnchorMSFT -> (SpatialAnchorMSFT -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createSpatialAnchorMSFT 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.

createSpatialAnchorSpaceMSFT Source #

Arguments

:: forall io. MonadIO io 
=> Session

session is a handle to an Session.

-> SpatialAnchorSpaceCreateInfoMSFT

createInfo is a pointer to an SpatialAnchorSpaceCreateInfoMSFT structure containing information about how to create the anchor.

-> io Space 

xrCreateSpatialAnchorSpaceMSFT - Creates a space from a spatial anchor

Parameter Descriptions

Description

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

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

Valid Usage (Implicit)

Return Codes

Success
Failure

See Also

Session, Space, SpatialAnchorMSFT, SpatialAnchorSpaceCreateInfoMSFT

withSpatialAnchorSpaceMSFT :: forall io r. MonadIO io => Session -> SpatialAnchorSpaceCreateInfoMSFT -> (io Space -> (Space -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createSpatialAnchorSpaceMSFT and destroySpace

To ensure that destroySpace 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.

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

data SpatialAnchorCreateInfoMSFT Source #

XrSpatialAnchorCreateInfoMSFT - Information to create a spatial anchor

Valid Usage (Implicit)

See Also

Posef, Space, SpatialAnchorMSFT, StructureType, https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrTime, createSpatialAnchorMSFT

Constructors

SpatialAnchorCreateInfoMSFT 

Fields

Instances

Instances details
Show SpatialAnchorCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

Storable SpatialAnchorCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

Zero SpatialAnchorCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

ToCStruct SpatialAnchorCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

FromCStruct SpatialAnchorCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

data SpatialAnchorSpaceCreateInfoMSFT Source #

XrSpatialAnchorSpaceCreateInfoMSFT - Information to create a space from a spatial anchor

Valid Usage (Implicit)

See Also

Posef, Space, SpatialAnchorMSFT, StructureType, createSpatialAnchorSpaceMSFT

Constructors

SpatialAnchorSpaceCreateInfoMSFT 

Fields

Instances

Instances details
Show SpatialAnchorSpaceCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

Storable SpatialAnchorSpaceCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

Zero SpatialAnchorSpaceCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

ToCStruct SpatialAnchorSpaceCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

FromCStruct SpatialAnchorSpaceCreateInfoMSFT Source # 
Instance details

Defined in OpenXR.Extensions.XR_MSFT_spatial_anchor

type MSFT_SPATIAL_ANCHOR_EXTENSION_NAME = "XR_MSFT_spatial_anchor" Source #

pattern MSFT_SPATIAL_ANCHOR_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a 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