AnchorConverter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |