SpatialInteractionSource SpatialInteractionSource SpatialInteractionSource SpatialInteractionSource 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 one detected instance of a hand, motion controller, or user's voice that can cause interactions and gestures.

public : sealed class SpatialInteractionSource : ISpatialInteractionSource, ISpatialInteractionSource2, ISpatialInteractionSource3public sealed class SpatialInteractionSource : ISpatialInteractionSource, ISpatialInteractionSource2, ISpatialInteractionSource3Public NotInheritable Class SpatialInteractionSource Implements ISpatialInteractionSource, ISpatialInteractionSource2, ISpatialInteractionSource3// 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

For hands and controllers, each detected hand or motion controller will get its own ID. For as long as the system can track that a hand is the same hand that was previously detected, it will share an ID.

For the user's voice, a single ID will be used for all voice input.

Properties

Controller Controller Controller Controller

Represents the specifics of a detected motion controller.

public : SpatialInteractionController Controller { get; }public SpatialInteractionController Controller { get; }Public ReadOnly Property Controller As SpatialInteractionController// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

This property will return null if this source is not a motion controller.

Handedness Handedness Handedness Handedness

Prerelease. Gets whether the interaction source represents the user's left hand or right hand.

public : SpatialInteractionSourceHandedness Handedness { get; }public SpatialInteractionSourceHandedness Handedness { get; }Public ReadOnly Property Handedness As SpatialInteractionSourceHandedness// 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

For controllers that have an inherent handedness, this will always return that handedness, regardless of which hand the controller is physically held in.

For controllers that do not support positional tracking and do not have an inherent handedness, such as the HoloLens clicker, this will always return Unspecified.

For controllers that may be held equivalently in either hand, the system may use a heuristic to determine which controller is which, returning Unspecified until this is determined. If such a controller changes its Handedness, the source will be lost and then detected again with the alternate handedness.

For hand and voice sources on HoloLens, this will always return Unspecified.

Id Id Id Id

Gets the identifier for the hand, motion controller, or user's voice.

public : unsigned int Id { get; }public uint Id { get; }Public ReadOnly Property Id As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The ID.

Remarks

For hands and motion controllers, each detected hand or controller will get its own ID. For as long as the system can track that a hand is the same hand that was previously detected, it will share an ID.

For the user's voice, a single ID will be used for all voice input.

IsGraspSupported IsGraspSupported IsGraspSupported IsGraspSupported

Gets whether the source supports detecting grasps.

public : PlatForm::Boolean IsGraspSupported { get; }public bool IsGraspSupported { get; }Public ReadOnly Property IsGraspSupported As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

Whether the source supports grasps.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

This will be true for some motion controllers and false for other interaction sources.

IsMenuSupported IsMenuSupported IsMenuSupported IsMenuSupported

Gets whether the source supports Menu presses.

public : PlatForm::Boolean IsMenuSupported { get; }public bool IsMenuSupported { get; }Public ReadOnly Property IsMenuSupported As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

Whether the source supports menu presses.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

This will be true for most motion controllers and false for other interaction sources.

IsPointingSupported IsPointingSupported IsPointingSupported IsPointingSupported

Gets whether the source can provide pointer poses.

public : PlatForm::Boolean IsPointingSupported { get; }public bool IsPointingSupported { get; }Public ReadOnly Property IsPointingSupported As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

Whether the source can provide pointer poses.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

This will be true for motion controllers that support positional tracking and false for other interaction sources.

To get this source's pointer pose, pass the source to SpatialPointingPose.TryGetInteractionSourcePose. Note that a pointing-capable motion controller can still return a null pointer pose if the controller has lost positional tracking.

Kind Kind Kind Kind

Gets the kind of the interaction source.

public : SpatialInteractionSourceKind Kind { get; }public SpatialInteractionSourceKind Kind { get; }Public ReadOnly Property Kind As SpatialInteractionSourceKind// You can use this property in JavaScript.

Methods

TryGetStateAtTimestamp(PerceptionTimestamp) TryGetStateAtTimestamp(PerceptionTimestamp) TryGetStateAtTimestamp(PerceptionTimestamp) TryGetStateAtTimestamp(PerceptionTimestamp)

Get the state of this source as of the specified timestamp.

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

The time to query for the state of this interaction source.

Returns
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)