Class XRHandDevice
An InputDevice that surfaces common controller data populated by hand joint poses. Devices will only be created if hand-tracking is enabled in the build settings for the target platform.
Inherited Members
Namespace: UnityEngine.XR.Hands
Assembly: Unity.XR.Hands.dll
Syntax
[InitializeOnLoad]
[Preserve]
[InputControlLayout(stateType = typeof(XRHandDeviceState), displayName = "XR Hand Device", commonUsages = new string[] { "LeftHand", "RightHand" })]
public class XRHandDevice : TrackedDevice
Remarks
The UnityEngine.InputSystem.TrackedDevice.devicePosition and UnityEngine.InputSystem.TrackedDevice.deviceRotation inherited from UnityEngine.InputSystem.TrackedDevice represent the wrist pose.
Use the XROrigin in the scene to position and orient the device
and gesture poses properly. If you are using this data to set the Transform of a GameObject in
the scene hierarchy, you can set the local position and rotation of the Transform and make
it a child of the CameraOffset
object below the XROrigin
. Otherwise, you can use the
Transform of the CameraOffset
to transform the data into world space.
Properties
aimActivateReady
Declaration
public ButtonControl aimActivateReady { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
aimActivateValue
An AxisControl that indicates the extent to which a user activated the aim action on the target that the user is pointing at with the aim pose.
Declaration
public AxisControl aimActivateValue { get; }
Property Value
Type | Description |
---|---|
AxisControl |
aimPosition
Position of the aim pose, representing an aiming ray cast to a target. When transformed relative to the XROrigin, the position will be in the correct position in the scene relative to the user.
Declaration
public Vector3Control aimPosition { get; }
Property Value
Type | Description |
---|---|
Vector3Control |
aimRotation
Rotation of the aim pose, representing an aiming ray cast to a target. When transformed relative to the XROrigin, the rotation will be in the correct orientation in the scene relative to the user.
Declaration
public QuaternionControl aimRotation { get; }
Property Value
Type | Description |
---|---|
QuaternionControl |
aimTrackingState
Tracking status of the aim position and rotation. See InputTrackingState for more.
Declaration
public IntegerControl aimTrackingState { get; }
Property Value
Type | Description |
---|---|
IntegerControl |
graspReady
Whether the hand performing the grasp action is properly tracked by the hand tracking device and it is observed to be ready to perform or is performing the grasp action.
Declaration
public ButtonControl graspReady { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
graspValue
AxisControl that indicates the extent to which a user is making a fist.
Declaration
public AxisControl graspValue { get; }
Property Value
Type | Description |
---|---|
AxisControl |
gripPosition
Position of the grip pose, representing the palm. When transformed relative to the XROrigin, the position will be in the correct position in the scene relative to the user.
Declaration
public Vector3Control gripPosition { get; }
Property Value
Type | Description |
---|---|
Vector3Control |
gripRotation
Rotation of the grip pose, representing the palm. When transformed relative to the XROrigin, the rotation will be in the correct orientation in the scene relative to the user.
Declaration
public QuaternionControl gripRotation { get; }
Property Value
Type | Description |
---|---|
QuaternionControl |
gripTrackingState
Tracking status of the grip position and rotation. See InputTrackingState for more.
Declaration
public IntegerControl gripTrackingState { get; }
Property Value
Type | Description |
---|---|
IntegerControl |
leftHand
Left-hand InputDevice that contains UnityEngine.InputSystem.InputControls that surface common hand data populated by hand joint poses.
Declaration
public static XRHandDevice leftHand { get; }
Property Value
Type | Description |
---|---|
XRHandDevice |
pinchPosition
Position of the pinch pose, representing the thumb's tip. When transformed relative to the XROrigin, the position will be in the correct position in the scene relative to the user.
Declaration
public Vector3Control pinchPosition { get; }
Property Value
Type | Description |
---|---|
Vector3Control |
pinchReady
Whether the fingers used to perform the "pinch" gesture are properly tracked by the hand tracking device and the hand shape is observed to be ready to perform or is performing a "pinch" gesture.
Declaration
public ButtonControl pinchReady { get; }
Property Value
Type | Description |
---|---|
ButtonControl |
pinchRotation
Rotation of the pinch pose, representing the thumb's tip. When transformed relative to the XROrigin, the rotation will be in the correct orientation in the scene relative to the user.
Declaration
public QuaternionControl pinchRotation { get; }
Property Value
Type | Description |
---|---|
QuaternionControl |
pinchTrackingState
Tracking status of the pinch position and rotation. See InputTrackingState for more.
Declaration
public IntegerControl pinchTrackingState { get; }
Property Value
Type | Description |
---|---|
IntegerControl |
pinchValue
AxisControl that represents the extent to which the user is bringing their finger and thumb together to perform a "pinch" gesture.
Declaration
public AxisControl pinchValue { get; }
Property Value
Type | Description |
---|---|
AxisControl |
pokePosition
Position of the poke pose, representing the index finger's tip. When transformed relative to the XROrigin, the position will be in the correct position in the scene relative to the user.
Declaration
public Vector3Control pokePosition { get; }
Property Value
Type | Description |
---|---|
Vector3Control |
pokeRotation
Rotation of the poke pose, representing the index finger's tip. When transformed relative to the XROrigin, the rotation will be in the correct orientation in the scene relative to the user.
Declaration
public QuaternionControl pokeRotation { get; }
Property Value
Type | Description |
---|---|
QuaternionControl |
pokeTrackingState
Tracking status of the poke position and rotation. See InputTrackingState for more.
Declaration
public IntegerControl pokeTrackingState { get; }
Property Value
Type | Description |
---|---|
IntegerControl |
rightHand
Right-hand InputDevice that contains UnityEngine.InputSystem.InputControls that surface common hand data populated by hand joint poses.
Declaration
public static XRHandDevice rightHand { get; }
Property Value
Type | Description |
---|---|
XRHandDevice |
Methods
FinishSetup()
Perform final initialization tasks after the control hierarchy has been put into place.
Declaration
protected override void FinishSetup()