AnchorConverter.ReplaceSpatialAnchor(Object, TrackableId) Method
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.
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.
public static UnityEngine.XR.ARSubsystems.TrackableId ReplaceSpatialAnchor (object spatialAnchor, UnityEngine.XR.ARSubsystems.TrackableId existingId);
static member ReplaceSpatialAnchor : obj * UnityEngine.XR.ARSubsystems.TrackableId -> UnityEngine.XR.ARSubsystems.TrackableId
Public Shared Function ReplaceSpatialAnchor (spatialAnchor As Object, existingId As TrackableId) As TrackableId
Parameters
- spatialAnchor
- Object
Must be a Windows.Perception.Spatial.SpatialAnchor.
- existingId
- UnityEngine.XR.ARSubsystems.TrackableId
An id representing an existing XRAnchor/ARAnchor.
Returns
Returns the trackable id representing the Unity anchor or UnityEngine.XR.ARSubsystems.TrackableId.invalidId if the conversion was unsuccessful.
Remarks
Use this function instead of FromPerceptionSpatialAnchor(Object) to avoid creating new ARAnchor on every new platform anchor.