AnchorConverter Class

Definition

Provides helper functions to convert an Unity Anchor object to underlying OpenXR anchor handle or SpatialAnchor COM object.

public static class AnchorConverter
type AnchorConverter = class
Public Class AnchorConverter
Inheritance
AnchorConverter

Methods

CreateFromOpenXRHandle(UInt64)

Create a new ARAnchor from the given OpenXR XRSpatialAnchorMSFT handle.

CreateFromPerceptionSpatialAnchor(Object)

Creating a new ARAnchor from the given Windows.Perception.Spatial.SpatialAnchor. If failed, the function returns TrackableId.invalidId. Creates an OpenXR anchor from a Windows.Perception.Spatial.SpatialAnchor and reports it to Unity.

FromPerceptionSpatialAnchor(Object)
Obsolete.

Creating a new ARAnchor from the given Windows.Perception.Spatial.SpatialAnchor. If failed, the function returns TrackableId.invalidId. Creates an OpenXR anchor from a Windows.Perception.Spatial.SpatialAnchor and reports it to Unity.

ReplaceSpatialAnchor(Object, TrackableId)

Replaces the underlying platform anchor for an existing XRAnchor/ARAnchor represented by the given TrackableId, so the Unity anchor will instead be located by the given SpatialAnchor.

ToOpenXRHandle(IntPtr)

Get the OpenXR handle of the given nativePtr from ARAnchor or XRAnchor object if available, or return 0.

ToPerceptionSpatialAnchor(IntPtr)

Get a COM wrapper object of Windows.Perception.Spatial.SpatialAnchor from the given ARAnchor's nativePtr.

ToPerceptionSpatialAnchor(TrackableId)

Get a COM wrapper object of Windows.Perception.Spatial.SpatialAnchor from the given TrackableId. If failed, the function returns nullptr.

Applies to