API reference
API reference
Select your platform
No SDKs available
No versions available

OVRHand Class

Extends MonoBehaviour, OVRInputModule.InputSource
Implements OVRSkeleton.IOVRSkeletonDataProvider, OVRSkeletonRenderer.IOVRSkeletonRendererDataProvider, OVRMesh.IOVRMeshDataProvider, OVRMeshRenderer.IOVRMeshRendererDataProvider
The OVRHand class provides hand related data which can be used by other classes such as the OVRSkeleton, the OVRMesh or the OVRSkeletonRenderer.
For example, it can detect whether a given finger is currently pinching, the pinch’s strength, and the confidence level of a finger pose.

Fields

m_showState : OVRInput.InputDeviceShowState
Determines if the controller should be hidden based on held state.
Signature
OVRInput.InputDeviceShowState m_showState
RayHelper : OVRRayHelper
An optional component for provind shell like ray functionality - highlighting where you're selecting in the UI and responding to pinches / button presses.
Signature
OVRRayHelper RayHelper

Properties

HandConfidence : TrackingConfidence
[Get]
The level of confidence of the data being provided about this hand.
Signature
TrackingConfidence HandConfidence
HandScale : float
[Get]
Signature
float HandScale
IsDataHighConfidence : bool
[Get]
True when there is high confidence on the data being provided.
Signature
bool IsDataHighConfidence
IsDataValid : bool
[Get]
True when the data received from this hand is valid.
Data can be invalid for different reasons. For example, the OVRPlugin might not have finished initializing.
Signature
bool IsDataValid
IsDominantHand : bool
[Get]
True when this hand is the same type (left/right) as the user's dominant hand.
Signature
bool IsDominantHand
IsPointerPoseValid : bool
[Get]
True when the PointerPose is valid.
The PointerPose may or may not be valid, depending on the user’s hand position, tracking status, and other factors.
Signature
bool IsPointerPoseValid
IsSystemGestureInProgress : bool
[Get]
True when a system gesture is in progress.
A system gesture is a reserved gesture that allows users to transition to the Meta Quest universal menu. This behavior occurs when users place their dominant hand up with the palm facing the user and pinch with their index finger.
Signature
bool IsSystemGestureInProgress
IsTracked : bool
[Get]
True when the hand is being tracked.
If this is false, the OVRPlugin might not have finished initializing, or hand tracking was lost.
Signature
bool IsTracked
PointerPose : Transform
[Get]
The pointer pose determines the direction that the user is pointing in.
It indicates the starting point and position of the pointing ray in the tracking space. It's useful for things like UI interactions where the user pinches to click on something.
Signature
Transform PointerPose

Methods

GetFingerConfidence ( finger )
Returns the confidence of a finger's pose as low or high, which indicates the amount of confidence that the tracking system has for the finger pose.
Signature
TrackingConfidence GetFingerConfidence(HandFinger finger)
Parameters
finger: HandFinger  The finger you want to test, for example Middle, Index, Pinky, etc.
GetFingerIsPinching ( finger )
Returns true if the given HandFinger is currently pinching.
If the hand data overall is not valid, it will return false. This method only returns true or false, if you want more information on how much the user has pinched, try GetFingerPinchStrength(HandFinger).
Signature
bool GetFingerIsPinching(HandFinger finger)
Parameters
finger: HandFinger  The finger you want to test, for example Middle, Index, Pinky, etc.
Returns
bool
GetFingerPinchStrength ( finger )
Returns the strength of the user's pinch.
The value it returns ranges from 0 to 1, where 0 indicates no pinch and 1 is a full pinch with the finger touching the thumb. Based on the values returned, you can provide feedback to the user by changing the color of the fingertip, adding an audible pop when fingers have fully pinched, or integrate physics interactions based on the pinch status.
Signature
float GetFingerPinchStrength(HandFinger finger)
Parameters
finger: HandFinger  The finger you want to test, for example Middle, Index, Pinky, etc.
Returns
float
GetHand ()
Returns the type of this Hand (left or right), see Hand for more info.
Signature
OVRPlugin.Hand GetHand()
Returns
OVRPlugin.Hand
GetMicrogestureType ()
Retrieves the current microgesture type based on the hand tracking state.
Returns the current type of microgesture being performed by the hand. If the hand tracking state is not valid, it returns MicrogestureType.Invalid.
Signature
MicrogestureType GetMicrogestureType()
GetPointerRayTransform ()
Returns the PointerPose.
See PointerPose for more information.
Signature
Transform GetPointerRayTransform()
Returns
Transform
IsActive ()
Returns true if IsDataValid is true and if the hand pointer ray should be shown.
Signature
bool IsActive()
Returns
bool
IsPressed ()
When the index finger is pinching, this will return true as it's considered a "press".
Signature
bool IsPressed()
Returns
bool
IsReleased ()
If the index finger was pinching (in other words, if IsPressed was true) and then it stops pinching, this will return true.
Signature
bool IsReleased()
Returns
bool
IsValid ()
True when this object is not null.
This is different from IsDataValid, which refers to the validity of the data itself.
Signature
bool IsValid()
Returns
bool
OnDisable ()
Signature
void OnDisable()
Returns
void
OnEnable ()
Signature
void OnEnable()
Returns
void
OnValidate ()
Signature
void OnValidate()
Returns
void
UpdatePointerRay ( rayData )
If RayHelper is being used, this will update it with the strength of the current pinch (as explained in GetFingerPinchStrength(HandFinger).
Signature
void UpdatePointerRay(OVRInputRayData rayData)
Parameters
Returns
void

Inner Enums

Hand Enum

This enum dictates if a hand is a left or right hand.
It's used in many scenarios such as choosing which hand mesh to return to OVRMesh, which skeleton to return, etc.

Enumeration Constants

MemberValue
None
OVRPlugin.Hand.None
HandLeft
OVRPlugin.Hand.HandLeft
HandRight
OVRPlugin.Hand.HandRight

HandFinger Enum

This enum is used for clarifying which finger you are currently working with or need data on.
For example, you can pass "HandFinger.Ring" to GetFingerIsPinching(HandFinger) to check if the ring finger is pinching.

Enumeration Constants

MemberValue
Thumb
OVRPlugin.HandFinger.Thumb
Index
OVRPlugin.HandFinger.Index
Middle
OVRPlugin.HandFinger.Middle
Ring
OVRPlugin.HandFinger.Ring
Pinky
OVRPlugin.HandFinger.Pinky
Max
OVRPlugin.HandFinger.Max

TrackingConfidence Enum

This enum refers to the level of confidence of a pose.
For an example of how this can be used, see method GetFingerConfidence(HandFinger)

Enumeration Constants

MemberValue
Low
OVRPlugin.TrackingConfidence.Low
High
OVRPlugin.TrackingConfidence.High

MicrogestureType Enum

Enumerates the types of microgestures that can be recognized by the OVR hand tracking system.
Each microgesture corresponds to a specific hand movement or gesture recognized by the system.

Enumeration Constants

MemberValue
NoGesture
OVRPlugin.MicrogestureType.NoGesture
SwipeLeft
OVRPlugin.MicrogestureType.SwipeLeft
SwipeRight
OVRPlugin.MicrogestureType.SwipeRight
SwipeForward
OVRPlugin.MicrogestureType.SwipeForward
SwipeBackward
OVRPlugin.MicrogestureType.SwipeBackward
ThumbTap
OVRPlugin.MicrogestureType.ThumbTap
Invalid
OVRPlugin.MicrogestureType.Invalid