SpatialInteractionSourceLocation SpatialInteractionSourceLocation SpatialInteractionSourceLocation SpatialInteractionSourceLocation Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Represents the grip pose and pointer pose of a hand or motion controller.

public : sealed class SpatialInteractionSourceLocation : ISpatialInteractionSourceLocation, ISpatialInteractionSourceLocation2public sealed class SpatialInteractionSourceLocation : ISpatialInteractionSourceLocation, ISpatialInteractionSourceLocation2Public NotInheritable Class SpatialInteractionSourceLocation Implements ISpatialInteractionSourceLocation, ISpatialInteractionSourceLocation2// 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

Windows Mixed Reality supports motion controllers in a variety of form factors, with each controller's design differing in its relationship between the user's hand position and the natural "forward" direction that apps should use for pointing when rendering the controller.

To better represent these controllers, there are two kinds of poses you can investigate for each interaction source.

The grip pose represents the location of either the palm of a hand detected by a HoloLens, or the palm holding a motion controller. On immersive headsets, this pose is best used to render the user's hand or an object held in the user's hand, such as a sword or gun. The grip pose is represented by the position, orientation and velocity properties directly within this type.

The pointer pose represents the tip of a motion controller pointing forward. This pose is best used to raycast when pointing at UI when you are rendering the controller model itself. The pointer pose can be accessed through the SourcePointerPose property.

Properties

AngularVelocity AngularVelocity AngularVelocity AngularVelocity

Prerelease. Gets the angular velocity of a hand or motion controller.

public : IReference<Vector3> AngularVelocity { get; }public Nullable<Vector3> AngularVelocity { get; }Public ReadOnly Property AngularVelocity As Nullable<Vector3>// You can use this property in JavaScript.
Value
IReference<Vector3> Nullable<Vector3> Nullable<Vector3> Nullable<Vector3>

The angular velocity.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

The angular velocity is expressed in an axis-angle representation. The unit vector is the axis of rotation and the magnitude is the angular speed in radians per second, following the right-hand rule.

Orientation Orientation Orientation Orientation

Gets the grip pose orientation, representing the orientation of the user's hand as it holds a motion controller.

public : IReference<Quaternion> Orientation { get; }public Nullable<Quaternion> Orientation { get; }Public ReadOnly Property Orientation As Nullable<Quaternion>// You can use this property in JavaScript.
Value
IReference<Quaternion> Nullable<Quaternion> Nullable<Quaternion> Nullable<Quaternion>

The orientation.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This orientation is distinct from a motion controller's pointing ray, which points forward from the tip of the controller. The pointing ray for a controller is available through the SourcePointerPose property.

Note that orientation is only available for an interaction source if it can correlated with the specified coordinate system. Motion controllers that do not expose pointer poses do not expose orientation either.

Interactions from interaction sources that do not support pointing should be targeted using gaze, not using the controller as an "air mouse".

Position Position Position Position

Gets the grip pose position, representing the position of the user's hand, either directly or where it holds a motion controller.

public : IReference<Vector3> Position { get; }public Nullable<Vector3> Position { get; }Public ReadOnly Property Position As Nullable<Vector3>// You can use this property in JavaScript.
Value
IReference<Vector3> Nullable<Vector3> Nullable<Vector3> Nullable<Vector3>

The position.

Remarks

This position is distinct from the motion controller's pointing ray, which has its origin at the tip of the controller. The pointing ray for a controller is available through the SourcePointerPose property.

Note that position is only available for an interaction source if it can be correlated with the specified coordinate system.

Interactions from interaction sources that do not support pointing should be targeted using gaze, not using the controller as an "air mouse".

PositionAccuracy PositionAccuracy PositionAccuracy PositionAccuracy

Prerelease. Gets the accuracy of an interaction source's positional tracking.

public : SpatialInteractionSourcePositionAccuracy PositionAccuracy { get; }public SpatialInteractionSourcePositionAccuracy PositionAccuracy { get; }Public ReadOnly Property PositionAccuracy As SpatialInteractionSourcePositionAccuracy// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

When a visually-tracked motion controller loses tracking, the system may continue to synthesize a position, with the precise mechanism of synthesis varying based on the tracking technology. Apps may check this property to determine when the position does not represent the nominal positional accuracy for that controller.

For example, an app may choose to accept all positions when pointing at menus or interacting with world objects. Then, when the user starts painting in the world around them, the app may choose to accept only positions with a High accuracy, to ensure the quality of the painting remains high.

SourcePointerPose SourcePointerPose SourcePointerPose SourcePointerPose

Prerelease. Gets the pointer pose for a particular spatial interaction source, such as a motion controller, at a given timestamp.

public : SpatialPointerInteractionSourcePose SourcePointerPose { get; }public SpatialPointerInteractionSourcePose SourcePointerPose { get; }Public ReadOnly Property SourcePointerPose As SpatialPointerInteractionSourcePose// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

The pointer pose represents the tip of a motion controller pointing forward. This pose is best used to raycast when pointing at UI when you are rendering the controller model itself.

To examine the grip pose of a motion controller, examine the Position and Orientation properties directly on the SpatialInteractionSourceLocation instance.

This property will return null if the specified spatial interaction source does not support pointing (IsPointingSupported is false).

Velocity Velocity Velocity Velocity

Gets the velocity of a hand or motion controller.

public : IReference<Vector3> Velocity { get; }public Nullable<Vector3> Velocity { get; }Public ReadOnly Property Velocity As Nullable<Vector3>// You can use this property in JavaScript.
Value
IReference<Vector3> Nullable<Vector3> Nullable<Vector3> Nullable<Vector3>

The velocity.