Represents a coordinate system that is strongly anchored to a point in the user's surroundings.
public : sealed class SpatialAnchor
public sealed class SpatialAnchor
Public NotInheritable Class SpatialAnchor
// This class does not provide a public constructor.
Windows 10 requirements
Windows 10 (introduced v10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
Windows.Foundation.UniversalApiContract (introduced v2)
You can create a SpatialAnchor at any position and orientation within the SpatialCoordinateSystem of your choosing. The device must be able to locate that coordinate system at the moment, and the system must not have reached its limit of spatial anchors.
Once defined, the coordinate system of a SpatialAnchor adjusts continually to retain the precise position and orientation of its initial location. You can then use this SpatialAnchor to render holograms that will appear fixed in the user's surroundings at that exact location.
The effects of the adjustments that keep the anchor in place are magnified as distance from the anchor increases. You should avoid rendering content relative to an anchor that is more than 3 meters from that anchor's origin.
You can persist a SpatialAnchor using the SpatialAnchorStore class and then get it back in a future app session.
The CoordinateSystem property gets a coordinate system that lets you place content relative to the anchor, with easing applied when the device adjusts the anchor's precise location.
The coordinate system is right-handed, with +y up, +x to the right, and -z forward.
|Windows version||SDK version||Value added|
|CoordinateSystem CoordinateSystem CoordinateSystem CoordinateSystem CoordinateSystem||
Gets the coordinate system of the anchor, with easing adjustments applied.
|RawCoordinateSystem RawCoordinateSystem RawCoordinateSystem RawCoordinateSystem RawCoordinateSystem||
Gets the coordinate system of the anchor, without easing applied.
|RemovedByUser RemovedByUser RemovedByUser RemovedByUser RemovedByUser||
Gets a value indicating whether the persisted anchor was removed by the user.
|RawCoordinateSystemAdjusted RawCoordinateSystemAdjusted RawCoordinateSystemAdjusted RawCoordinateSystemAdjusted RawCoordinateSystemAdjusted||
Occurs when the device adjusts the anchor's precise location, which updates the RawCoordinateSystem.