SpatialLocator SpatialLocator SpatialLocator SpatialLocator SpatialLocator Class

Definition

Provides access to the location of a device that's tracked relative to the user's surroundings, such as a HoloLens or other Mixed Reality headset.

public : sealed class SpatialLocator : ISpatialLocator
struct winrt::Windows::Perception::Spatial::SpatialLocator : ISpatialLocator
public sealed class SpatialLocator : ISpatialLocator
Public NotInheritable Class SpatialLocator Implements ISpatialLocator
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

The SpatialLocator class represents a device whose position and orientation can be tracked by Windows relative to the user's surroundings. A SpatialLocator instance is the source for locator-attached and stationary frames of reference. On a Mixed Reality headset such as HoloLens, these frames of reference can be used for holographic rendering and for reasoning about surfaces in the world around the device.

Properties

Locatability Locatability Locatability Locatability Locatability

Gets the current state of the device's spatial location system.

Methods

CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading()

Creates a frame of reference that's positionally attached to this SpatialLocator with the current orientation as its fixed heading.

CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)

Creates a frame of reference that's positionally attached to this SpatialLocator with the current orientation as its fixed heading and with its origin offset by the specified relative position.

CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)

Creates a frame of reference that's positionally attached to this SpatialLocator with the current orientation as its fixed heading and with its origin offset and rotated by the specified relative position and orientation.

CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double) CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)

Creates a frame of reference that's positionally attached to this SpatialLocator with the supplied heading in radians relative to the current orientation and with its origin offset by the specified relative position and orientation.

CreateStationaryFrameOfReferenceAtCurrentLocation() CreateStationaryFrameOfReferenceAtCurrentLocation() CreateStationaryFrameOfReferenceAtCurrentLocation() CreateStationaryFrameOfReferenceAtCurrentLocation() CreateStationaryFrameOfReferenceAtCurrentLocation()

Creates a frame of reference that remains stationary relative to the user's surroundings, with its initial origin at the SpatialLocator's current location.

CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)

Creates a frame of reference that remains stationary relative to the user's surroundings, with its initial origin at the specified offset from the SpatialLocator's current location.

CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)

Creates a frame of reference that remains stationary relative to the user's surroundings, with its initial origin at the specified offset from the SpatialLocator's current location, and then rotated at the specified rotation.

CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double) CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)

Creates a frame of reference that remains stationary relative to the user's surroundings, with its initial origin at the specified offset from the SpatialLocator's current location along the specified relative heading in radians, and then rotated at the specified rotation.

GetDefault() GetDefault() GetDefault() GetDefault() GetDefault()

Gets the SpatialLocator instance that tracks the location of the current device, such as a HoloLens, relative to the user's surroundings.

TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem)

Returns a SpatialLocation representing the device's location at the specified timestamp. The coordinates within are expressed relative to the supplied coordinate system. If the device cannot be located in that coordinate system at the specified timestamp, the return value will be null. This can happen when the device has lost tracking, for example.

Events

LocatabilityChanged LocatabilityChanged LocatabilityChanged LocatabilityChanged LocatabilityChanged

Occurs when the state of the spatial location system changes.

PositionalTrackingDeactivating PositionalTrackingDeactivating PositionalTrackingDeactivating PositionalTrackingDeactivating PositionalTrackingDeactivating

Occurs when the device's spatial location system is deactivating due to inactivity.

See Also