Partilhar via


AnchorConverter.FromPerceptionSpatialAnchor(Object) Method

Definition

Caution

Obsolete and will be removed in future releases. Use the CreateFromPerceptionSpatialAnchor function instead.

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.

[System.Obsolete("Obsolete and will be removed in future releases.  Use the `CreateFromPerceptionSpatialAnchor` function instead.")]
public static UnityEngine.XR.ARSubsystems.TrackableId FromPerceptionSpatialAnchor (object spatialAnchor);
public static UnityEngine.XR.ARSubsystems.TrackableId FromPerceptionSpatialAnchor (object spatialAnchor);
[<System.Obsolete("Obsolete and will be removed in future releases.  Use the `CreateFromPerceptionSpatialAnchor` function instead.")>]
static member FromPerceptionSpatialAnchor : obj -> UnityEngine.XR.ARSubsystems.TrackableId
static member FromPerceptionSpatialAnchor : obj -> UnityEngine.XR.ARSubsystems.TrackableId
Public Shared Function FromPerceptionSpatialAnchor (spatialAnchor As Object) As TrackableId

Parameters

spatialAnchor
Object

Must be a Windows.Perception.Spatial.SpatialAnchor.

Returns

UnityEngine.XR.ARSubsystems.TrackableId

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

Attributes

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