SpatialLocatorAttachedFrameOfReference SpatialLocatorAttachedFrameOfReference SpatialLocatorAttachedFrameOfReference SpatialLocatorAttachedFrameOfReference Class

Definition

Represents a frame of reference that is positionally attached to the device.

public : sealed class SpatialLocatorAttachedFrameOfReference : ISpatialLocatorAttachedFrameOfReferencepublic sealed class SpatialLocatorAttachedFrameOfReference : ISpatialLocatorAttachedFrameOfReferencePublic NotInheritable Class SpatialLocatorAttachedFrameOfReference Implements ISpatialLocatorAttachedFrameOfReference// You can use this class in JavaScript.
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 SpatialLocatorAttachedFrameOfReference class represents a device-relative frame of reference that tracks changes in the position reported by the device's SpatialLocator. This frame has a fixed heading relative to the user's surroundings that points in the direction the user was facing when the frame was created. From then on, all orientations in this frame of reference are relative to that fixed heading, even as the user rotates the device.

For a headset such as HoloLens, the origin of this frame's coordinate system is located at the center of rotation of the user's head, so that its position is not affected by head rotation.

To get a SpatialLocatorAttachedFrameOfReference, use the SpatialLocator class and call CreateAttachedFrameOfReferenceAtCurrentHeading.

Properties

RelativeOrientation RelativeOrientation RelativeOrientation RelativeOrientation

Gets or sets the orientation of this frame of reference's origin relative to the direction of the heading.

public : Quaternion RelativeOrientation { get; set; }public Quaternion RelativeOrientation { get; set; }Public ReadWrite Property RelativeOrientation As Quaternion// You can use this property in JavaScript.
Value
Quaternion Quaternion Quaternion Quaternion

The orientation.

RelativePosition RelativePosition RelativePosition RelativePosition

Gets or sets the position of this frame of reference's origin relative to the SpatialLocator that it is tracking.

public : Vector3 RelativePosition { get; set; }public Vector3 RelativePosition { get; set; }Public ReadWrite Property RelativePosition As Vector3// You can use this property in JavaScript.
Value
Vector3 Vector3 Vector3 Vector3

The offset.

Methods

AdjustHeading(Double) AdjustHeading(Double) AdjustHeading(Double) AdjustHeading(Double)

Adjusts the fixed heading of this frame of reference relative to its current heading.

public : void AdjustHeading(double headingOffsetInRadians)public void AdjustHeading(Double headingOffsetInRadians)Public Function AdjustHeading(headingOffsetInRadians As Double) As void// You can use this method in JavaScript.
Parameters
headingOffsetInRadians
double Double Double Double

The amount to change the heading, in radians.

GetStationaryCoordinateSystemAtTimestamp(PerceptionTimestamp) GetStationaryCoordinateSystemAtTimestamp(PerceptionTimestamp) GetStationaryCoordinateSystemAtTimestamp(PerceptionTimestamp) GetStationaryCoordinateSystemAtTimestamp(PerceptionTimestamp)

Gets a coordinate system whose origin is the position of the device at the specified timestamp, oriented at this frame of reference's fixed heading. This coordinate system stays stationary and does not track any further movement of the device.

public : SpatialCoordinateSystem GetStationaryCoordinateSystemAtTimestamp(PerceptionTimestamp timestamp)public SpatialCoordinateSystem GetStationaryCoordinateSystemAtTimestamp(PerceptionTimestamp timestamp)Public Function GetStationaryCoordinateSystemAtTimestamp(timestamp As PerceptionTimestamp) As SpatialCoordinateSystem// You can use this method in JavaScript.
Parameters
timestamp
PerceptionTimestamp PerceptionTimestamp PerceptionTimestamp PerceptionTimestamp

The timestamp to compute the coordinate system for.

Returns

The coordinate system that corresponds with the timestamp.

Remarks

The coordinate system is right-handed, with +y up, +x to the right, and -z forward.

TryGetRelativeHeadingAtTimestamp(PerceptionTimestamp) TryGetRelativeHeadingAtTimestamp(PerceptionTimestamp) TryGetRelativeHeadingAtTimestamp(PerceptionTimestamp) TryGetRelativeHeadingAtTimestamp(PerceptionTimestamp)

Computes the device's heading in radians for the specified timestamp, relative to this frame's fixed heading.

public : IReference<double> TryGetRelativeHeadingAtTimestamp(PerceptionTimestamp timestamp)public Nullable<double> TryGetRelativeHeadingAtTimestamp(PerceptionTimestamp timestamp)Public Function TryGetRelativeHeadingAtTimestamp(timestamp As PerceptionTimestamp) As Nullable( Of double )// You can use this method in JavaScript.
Parameters
timestamp
PerceptionTimestamp PerceptionTimestamp PerceptionTimestamp PerceptionTimestamp

The timestamp to compute the relative heading for.

Returns
IReference<double> Nullable<double> Nullable<double> Nullable<double>

The relative heading in radians that corresponds with the timestamp, or null if it is not available for the specified time.

Remarks

This method will return null if the timestamp is too far in the past or future.