Dela via


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 ref class SpatialLocator sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SpatialLocator final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SpatialLocator
Public NotInheritable Class SpatialLocator
Inheritance
Object Platform::Object IInspectable SpatialLocator
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)

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

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

Methods

CreateAttachedFrameOfReferenceAtCurrentHeading()

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

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.

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)

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.

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, 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.

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)

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.

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)

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

Occurs when the state of the spatial location system changes.

PositionalTrackingDeactivating

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

Applies to

See also