Class XRCommonHandGestures
Access to common hand gesture data and callbacks.
Inherited Members
Namespace: UnityEngine.XR.Hands
Assembly: Unity.XR.Hands.dll
Syntax
public class XRCommonHandGestures
Fields
aimActivateValueUpdated
Called when the aim activate value is updated. Either the value changed, or the ability to retrieve it changed.
Declaration
public Action<XRCommonHandGestures.AimActivateValueUpdatedEventArgs> aimActivateValueUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.AimActivateValueUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.AimActivateValueUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
aimActivatedStateUpdated
Called when the aim activate state is updated. Either the state changed, or the ability to retrieve it changed.
Declaration
public Action<XRCommonHandGestures.AimActivatedStateUpdatedEventArgs> aimActivatedStateUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.AimActivatedStateUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.AimActivatedStateUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
aimPoseUpdated
Called when the aim pose is updated. Either the pose changed, the ability to retrieve it changed, or its tracking status changed.
Declaration
public Action<XRCommonHandGestures.AimPoseUpdatedEventArgs> aimPoseUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.AimPoseUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.AimPoseUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
graspFirmStateUpdated
Called when the firm grasp state is updated. Either the state changed, or the ability to retrieve it changed.
Declaration
public Action<XRCommonHandGestures.GraspFirmStateUpdatedEventArgs> graspFirmStateUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.GraspFirmStateUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.GraspFirmStateUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
graspValueUpdated
Called when the grasp value is updated. Either the value changed, or the ability to retrieve it changed.
Declaration
public Action<XRCommonHandGestures.GraspValueUpdatedEventArgs> graspValueUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.GraspValueUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.GraspValueUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
gripPoseUpdated
Called when the grip pose is updated. Either the pose changed, the ability to retrieve it changed, or its tracking status changed.
Declaration
public Action<XRCommonHandGestures.GripPoseUpdatedEventArgs> gripPoseUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.GripPoseUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.GripPoseUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
pinchPoseUpdated
Called when the pinch pose is updated. Either the pose changed, the ability to retrieve it changed, or its tracking status changed.
Declaration
public Action<XRCommonHandGestures.PinchPoseUpdatedEventArgs> pinchPoseUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.PinchPoseUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.PinchPoseUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
pinchTouchedStateUpdated
Called when the pinch state is updated. Either the state changed, or the ability to retrieve it changed.
Declaration
public Action<XRCommonHandGestures.PinchTouchedStateUpdatedEventArgs> pinchTouchedStateUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.PinchTouchedStateUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.PinchTouchedStateUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
pinchValueUpdated
Called when the pinch value is updated. Either the value changed, or the ability to retrieve it changed.
Declaration
public Action<XRCommonHandGestures.PinchValueUpdatedEventArgs> pinchValueUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.PinchValueUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.PinchValueUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
pokePoseUpdated
Called when the poke pose is updated. Either the pose changed, the ability to retrieve it changed, or its tracking status changed.
Declaration
public Action<XRCommonHandGestures.PokePoseUpdatedEventArgs> pokePoseUpdated
Field Value
| Type | Description |
|---|---|
| Action<XRCommonHandGestures.PokePoseUpdatedEventArgs> |
Remarks
The XRCommonHandGestures.PokePoseUpdatedEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
Properties
flags
Describes the validity of data found in this common gestures data.
Declaration
public XRCommonHandGesturesFlags flags { get; }
Property Value
| Type | Description |
|---|---|
| XRCommonHandGesturesFlags |
handedness
Denotes which hand this represents common gestures data for.
Declaration
public Handedness handedness { get; }
Property Value
| Type | Description |
|---|---|
| Handedness |
Methods
GetAimPoseIsTracked()
Gets whether the aim pose is tracked.
Declaration
public bool GetAimPoseIsTracked()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the aim pose is tracked. Returns false otherwise. |
See Also
GetGripPoseIsTracked()
Gets whether the grip pose is tracked.
Declaration
public bool GetGripPoseIsTracked()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the grip pose is tracked. Returns false otherwise. |
See Also
GetPinchPoseIsTracked()
Gets whether the pinch pose is tracked.
Declaration
public bool GetPinchPoseIsTracked()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the pinch pose is tracked. Returns false otherwise. |
See Also
GetPokePoseIsTracked()
Gets whether the poke pose is tracked.
Declaration
public bool GetPokePoseIsTracked()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the poke pose is tracked. Returns false otherwise. |
See Also
TryGetAimActivateValue(out float)
Attempts to get the aim activate value.
Declaration
public bool TryGetAimActivateValue(out float aimActivateValue)
Parameters
| Type | Name | Description |
|---|---|---|
| float | aimActivateValue | Will be filled out with the aim activate value, if successful. |
Returns
| Type | Description |
|---|---|
| bool | Returns true and a valid value is filled out. Returns false otherwise. |
TryGetAimActivatedState(out bool)
Attempts to get whether the aim is fully activated.
Declaration
public bool TryGetAimActivatedState(out bool isAimActivated)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isAimActivated | Will be set to true if the aim is fully activated, otherwise false. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if a valid evaluation of the activation state is available. Returns false otherwise. |
Remarks
Data to evaluate the aim activation state might not be available when you call this function.
When data is available, the function returns true and sets isAimActivated
to indicate whether the aim is fully activated. If this function returns false,
isAimActivated will be false whether or not the aim is actually activated.
TryGetAimPose(out Pose)
Attempts to get the aim pose.
Declaration
public bool TryGetAimPose(out Pose aimPose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | aimPose | Will be filled out with the aim pose, if successful. |
Returns
| Type | Description |
|---|---|
| bool |
TryGetGraspFirmState(out bool)
Attempts to get whether the user is making a fist.
Declaration
public bool TryGetGraspFirmState(out bool isGraspFirm)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isGraspFirm | Will be set to true if the user is making a fist, otherwise false. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if a valid evaluation of the gesture is available. Returns false otherwise. |
Remarks
Data to evaluate the gesture might not be available when you call this function. When data is available,
the function returns true and sets isGraspFirm to indicate
whether the user is making a fist (firm grasp). If this function returns false,
isGraspFirm will be false whether or not the user is making a fist.
TryGetGraspValue(out float)
Attempts to get the grasp value.
Declaration
public bool TryGetGraspValue(out float graspValue)
Parameters
| Type | Name | Description |
|---|---|---|
| float | graspValue | Will be filled out with the grasp value, if successful. |
Returns
| Type | Description |
|---|---|
| bool | Returns true and a valid value is filled out. Returns false otherwise. |
TryGetGripPose(out Pose)
Attempts to get the grip pose.
Declaration
public bool TryGetGripPose(out Pose gripPose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | gripPose | Will be filled out with the grip pose, if successful. |
Returns
| Type | Description |
|---|---|
| bool |
TryGetPinchPose(out Pose)
Attempts to get the pinch pose.
Declaration
public bool TryGetPinchPose(out Pose pinchPose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | pinchPose | Will be filled out with the pinch pose, if successful. |
Returns
| Type | Description |
|---|---|
| bool |
TryGetPinchTouchedState(out bool)
Attempts to get whether the hand is performing a pinch gesture.
Declaration
public bool TryGetPinchTouchedState(out bool isPinchTouched)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isPinchTouched | Will be set to true if the hand is pinching, otherwise false. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if a valid evaluation of the gesture is available. Returns false otherwise. |
Remarks
Data to evaluate the pinch gesture might not be available when you call this function. When data is available,
the function returns true and sets isPinchTouched to indicate
whether the hand is currently pinching. If this function returns false,
isPinchTouched will be false whether or not the hand is pinching.
TryGetPinchValue(out float)
Attempts to get the pinch value.
Declaration
public bool TryGetPinchValue(out float pinchValue)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pinchValue | Will be filled out with the pinch value, if successful. |
Returns
| Type | Description |
|---|---|
| bool | Returns true and a valid value is filled out. Returns false otherwise. |
TryGetPokePose(out Pose)
Attempts to get the poke pose.
Declaration
public bool TryGetPokePose(out Pose pokePose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | pokePose | Will be filled out with the poke pose, if successful. |
Returns
| Type | Description |
|---|---|
| bool |