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 : ISpatialLocatorpublic sealed class SpatialLocator : ISpatialLocatorPublic NotInheritable Class SpatialLocator Implements ISpatialLocator// You can use this class in JavaScript.
- Attributes
| 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
Gets the current state of the device's spatial location system.
public : SpatialLocatability Locatability { get; }public SpatialLocatability Locatability { get; }Public ReadOnly Property Locatability As SpatialLocatability// You can use this property in JavaScript.
The locatability.
Methods
CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading() CreateAttachedFrameOfReferenceAtCurrentHeading()
Creates a frame of reference that's positionally attached to this SpatialLocator with the current orientation as its fixed heading.
public : SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading()public SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading()Public Function CreateAttachedFrameOfReferenceAtCurrentHeading() As SpatialLocatorAttachedFrameOfReference// You can use this method in JavaScript.
The locator-attached frame of reference.
- See Also
-
CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)
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.
public : SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3 relativePosition)public SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3 relativePosition)Public Function CreateAttachedFrameOfReferenceAtCurrentHeading(relativePosition As Vector3) As SpatialLocatorAttachedFrameOfReference// You can use this method in JavaScript.
- relativePosition
- Vector3 Vector3 Vector3 Vector3
The positional offset of the origin of the frame of reference, expressed within its coordinate system.
The locator-attached frame of reference.
- See Also
-
CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)
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.
public : SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3 relativePosition, Quaternion relativeOrientation)public SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3 relativePosition, Quaternion relativeOrientation)Public Function CreateAttachedFrameOfReferenceAtCurrentHeading(relativePosition As Vector3, relativeOrientation As Quaternion) As SpatialLocatorAttachedFrameOfReference// You can use this method in JavaScript.
- relativePosition
- Vector3 Vector3 Vector3 Vector3
The positional offset of the origin of the frame of reference, expressed within its coordinate system.
- relativeOrientation
- Quaternion Quaternion Quaternion Quaternion
The rotation of the origin of the frame of reference, relative to the direction of the heading.
The locator-attached frame of reference.
- See Also
-
CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading()CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3, Quaternion, Double)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.
public : SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3 relativePosition, Quaternion relativeOrientation, double relativeHeadingInRadians)public SpatialLocatorAttachedFrameOfReference CreateAttachedFrameOfReferenceAtCurrentHeading(Vector3 relativePosition, Quaternion relativeOrientation, Double relativeHeadingInRadians)Public Function CreateAttachedFrameOfReferenceAtCurrentHeading(relativePosition As Vector3, relativeOrientation As Quaternion, relativeHeadingInRadians As Double) As SpatialLocatorAttachedFrameOfReference// You can use this method in JavaScript.
- relativePosition
- Vector3 Vector3 Vector3 Vector3
The positional offset of the origin of the frame of reference, expressed within its coordinate system.
- relativeOrientation
- Quaternion Quaternion Quaternion Quaternion
The rotation of the origin of the frame of reference, relative to the direction of the heading.
- relativeHeadingInRadians
- double Double Double Double
The amount to rotate the fixed heading from the SpatialLocator's current orientation, in radians.
The locator-attached frame of reference.
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.
public : SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation()public SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation()Public Function CreateStationaryFrameOfReferenceAtCurrentLocation() As SpatialStationaryFrameOfReference// You can use this method in JavaScript.
The stationary frame of reference.
- See Also
-
CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)
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.
public : SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3 relativePosition)public SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3 relativePosition)Public Function CreateStationaryFrameOfReferenceAtCurrentLocation(relativePosition As Vector3) As SpatialStationaryFrameOfReference// You can use this method in JavaScript.
- relativePosition
- Vector3 Vector3 Vector3 Vector3
The positional offset of the origin of the frame of reference, expressed within its coordinate system.
The stationary frame of reference.
- See Also
-
CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)
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.
public : SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3 relativePosition, Quaternion relativeOrientation)public SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3 relativePosition, Quaternion relativeOrientation)Public Function CreateStationaryFrameOfReferenceAtCurrentLocation(relativePosition As Vector3, relativeOrientation As Quaternion) As SpatialStationaryFrameOfReference// You can use this method in JavaScript.
- relativePosition
- Vector3 Vector3 Vector3 Vector3
The positional offset of the origin of the frame of reference, expressed within its coordinate system.
- relativeOrientation
- Quaternion Quaternion Quaternion Quaternion
The rotation of the origin of the frame of reference, relative to the orientation of the SpatialLocator.
The stationary frame of reference.
- See Also
-
CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation()CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3, Quaternion, Double)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.
public : SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3 relativePosition, Quaternion relativeOrientation, double relativeHeadingInRadians)public SpatialStationaryFrameOfReference CreateStationaryFrameOfReferenceAtCurrentLocation(Vector3 relativePosition, Quaternion relativeOrientation, Double relativeHeadingInRadians)Public Function CreateStationaryFrameOfReferenceAtCurrentLocation(relativePosition As Vector3, relativeOrientation As Quaternion, relativeHeadingInRadians As Double) As SpatialStationaryFrameOfReference// You can use this method in JavaScript.
- relativePosition
- Vector3 Vector3 Vector3 Vector3
The positional offset of the origin of the frame of reference, expressed within its coordinate system.
- relativeOrientation
- Quaternion Quaternion Quaternion Quaternion
The rotation of the origin of the frame of reference, relative to the direction of the heading.
- relativeHeadingInRadians
- double Double Double Double
The amount to rotate the fixed heading from the SpatialLocator's current orientation, in radians, before the positional offset.
The stationary frame of reference.
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.
public : static SpatialLocator GetDefault()public static SpatialLocator GetDefault()Public Static Function GetDefault() As SpatialLocator// You can use this method in JavaScript.
The spatial locator.
TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem) TryLocateAtTimestamp(PerceptionTimestamp, SpatialCoordinateSystem)
Creates a SpatialLocation representing the device's location at the specified timestamp. The coordinates within are expressed relative to the supplied coordinate system.
public : SpatialLocation TryLocateAtTimestamp(PerceptionTimestamp timestamp, SpatialCoordinateSystem coordinateSystem)public SpatialLocation TryLocateAtTimestamp(PerceptionTimestamp timestamp, SpatialCoordinateSystem coordinateSystem)Public Function TryLocateAtTimestamp(timestamp As PerceptionTimestamp, coordinateSystem As SpatialCoordinateSystem) As SpatialLocation// You can use this method in JavaScript.
The timestamp at which to locate the device.
- coordinateSystem
- SpatialCoordinateSystem SpatialCoordinateSystem SpatialCoordinateSystem SpatialCoordinateSystem
The coordinate system in which to express the location's coordinates.
The location.
Events
LocatabilityChanged LocatabilityChanged LocatabilityChanged LocatabilityChanged
Occurs when the state of the spatial location system changes.
public : event TypedEventHandler LocatabilityChanged<SpatialLocator, object>public event TypedEventHandler LocatabilityChanged<SpatialLocator, object>Public Event LocatabilityChanged<SpatialLocator, object>// You can use this event in JavaScript.
PositionalTrackingDeactivating PositionalTrackingDeactivating PositionalTrackingDeactivating PositionalTrackingDeactivating
Occurs when the device's spatial location system is deactivating due to inactivity.
public : event TypedEventHandler PositionalTrackingDeactivating<SpatialLocator, SpatialLocatorPositionalTrackingDeactivatingEventArgs>public event TypedEventHandler PositionalTrackingDeactivating<SpatialLocator, SpatialLocatorPositionalTrackingDeactivatingEventArgs>Public Event PositionalTrackingDeactivating<SpatialLocator, SpatialLocatorPositionalTrackingDeactivatingEventArgs>// You can use this event in JavaScript.