AnchorConverter.CreateFromOpenXRHandle(UInt64) Method

Definition

Create a new ARAnchor from the given OpenXR XRSpatialAnchorMSFT handle.

public static UnityEngine.XR.ARSubsystems.TrackableId CreateFromOpenXRHandle (ulong openxrAnchorHandle);
static member CreateFromOpenXRHandle : uint64 -> UnityEngine.XR.ARSubsystems.TrackableId
Public Shared Function CreateFromOpenXRHandle (openxrAnchorHandle As ULong) As TrackableId

Parameters

openxrAnchorHandle
UInt64

A valid OpenXR XRSpatialAnchorMSFT handle.

Returns

UnityEngine.XR.ARSubsystems.TrackableId

Returns the trackable id representing the Unity anchor or UnityEngine.XR.ARSubsystems.TrackableId.invalidId if the conversion was unsuccessful.

Remarks

The newly created TrackableId will not be added to UnityEngine.XR.ARFoundation.ARTrackableManager`5.trackables collection until the next frame's Update. The app should listen to the UnityEngine.XR.ARFoundation.ARAnchorManager.anchorsChanged event for the added ARAnchor object with the returned trackableId.

Applies to