Wave Hand Gesture Interface¶
Refer to Wave XR Plugin Packages about VIVE Wave™ XR plugin packages.
The Essence package provides the Wave.Essence.Hand.HandManager and Wave.Essence.Hand.StaticGesture.CustomGestureProvider interfaces to access the default and custom Hand Gesture data.
Default Gesture¶
Before retrieving the Default Hand Gesture, add the Hand Manager component from the menu item Wave > GameObject > Add Hand Manager.
Check if the Hand Manager existed by using the following code.
using Wave.Essence.Hand;
if (HandManager.Instance != null)
GestureStatus¶
enum GestureStatus {
// Initial, can call Start API in this state.
NotStart,
StartFailure,
// Processing, should NOT call API in this state.
Starting,
Stopping,
// Running, can call Stop API in this state.
Available,
// Do nothing.
NoSupport
}
GestureType(default)¶
Note
Which gesture types are supported depends on the system version.
enum GestureType {
Invalid = WVR_HandGestureType.WVR_HandGestureType_Invalid,
Unknown = WVR_HandGestureType.WVR_HandGestureType_Unknown,
Fist = WVR_HandGestureType.WVR_HandGestureType_Fist,
Five = WVR_HandGestureType.WVR_HandGestureType_Five,
OK = WVR_HandGestureType.WVR_HandGestureType_OK,
ThumbUp = WVR_HandGestureType.WVR_HandGestureType_ThumbUp,
IndexUp = WVR_HandGestureType.WVR_HandGestureType_IndexUp,
Palm_Pinch = WVR_HandGestureType.WVR_HandGestureType_Palm_Pinch,
Yeah = WVR_HandGestureType.WVR_HandGestureType_Yeah,
}
GetHandGestureStatus¶
Retrieves the current hand gesture status.
GestureStatus GetHandGestureStatus()
GetHandGesture¶
Retrieves the current hand gesture of left/right hand.
GestureType(default) GetHandGesture(bool isLeft)
Native Types¶
WVR_HandGestureType¶
Note
Which gesture types are supported depends on the system version.
enum WVR_HandGestureType {
WVR_HandGestureType_Invalid = 0, /**< The gesture is invalid. */
WVR_HandGestureType_Unknown = 1, /**< Unknow gesture type. */
WVR_HandGestureType_Fist = 2, /**< Represent Fist gesture. */
WVR_HandGestureType_Five = 3, /**< Represent Five gesture. */
WVR_HandGestureType_OK = 4, /**< Represent OK gesture. */
WVR_HandGestureType_ThumbUp = 5, /**< Represent Like gesture. */
WVR_HandGestureType_IndexUp = 6, /**< Represent Point gesture. */
WVR_HandGestureType_Palm_Pinch = 7, /**< Represent inversed Pinch gesture. */
WVR_HandGestureType_Yeah = 8, /**< Represent yeah gesture. */
WVR_HandGestureType_Reserved2 = 33, /**< Reserved gesture. */
WVR_HandGestureType_Reserved3 = 34, /**< Reserved gesture. */
WVR_HandGestureType_Reserved4 = 35, /**< Reserved gesture. */
WVR_HandGestureType_Reserved5 = 36, /**< Reserved gesture. */
WVR_HandGestureType_Reserved6 = 37, /**< Reserved gesture. */
WVR_HandGestureType_Reserved7 = 38, /**< Reserved gesture. */
WVR_HandGestureType_Reserved8 = 39, /**< Reserved gesture. */
WVR_HandGestureType_Reserved9 = 40, /**< Reserved gesture. */
WVR_HandGestureType_Reserved10 = 41, /**< Reserved gesture. */
}
WVR_HandGestureData_t¶
struct WVR_HandGestureData_t {
public long timestamp;
public WVR_HandGestureType right;
public WVR_HandGestureType left;
}
Custom Gesture¶
Instead of default SDK-defined gestures, you can customize gestures by using the Custom Gesture Provider.
Add the Custom Gesture Provider component along with Hand Manager. You can refer to the sample Assets > Wave > Essence > Interaction > Mode > {version} > Demo > NaturalHand about the usage of Hand Gesture.
Use the namespace as the following code.
using Wave.Essence.Hand.StaticGesture;
Custom Gesture Reference Class¶
BaseSingleHandGestureProducer¶
Checks if left / right hand has a custom gesture.
SingleHandGestureProducer¶
Customizes an single-hand gesture type.
BaseDualHandGestureProducer¶
Checks if there is a dual-hand custom gesture.
DualHandGestureProducer¶
Customizes a dual-hand gesture type.
Custom Gesture Public Data¶
GesturePoint¶
enum GesturePoint {
Wrist = HandManager.HandJoint.Wrist,
Palm = HandManager.HandJoint.Palm,
Thumb_Joint0 = HandManager.HandJoint.Thumb_Joint0,
Thumb_Joint1 = HandManager.HandJoint.Thumb_Joint1,
Thumb_Joint2 = HandManager.HandJoint.Thumb_Joint2,
Thumb_Tip = HandManager.HandJoint.Thumb_Tip, // 5
Index_Joint1 = HandManager.HandJoint.Index_Joint1,
Index_Joint2 = HandManager.HandJoint.Index_Joint2,
Index_Joint3 = HandManager.HandJoint.Index_Joint3,
Index_Tip = HandManager.HandJoint.Index_Tip, // 9
Middle_Joint1 = HandManager.HandJoint.Middle_Joint1,
Middle_Joint2 = HandManager.HandJoint.Middle_Joint2,
Middle_Joint3 = HandManager.HandJoint.Middle_Joint3,
Middle_Tip = HandManager.HandJoint.Middle_Tip, // 13
Ring_Joint1 = HandManager.HandJoint.Ring_Joint1,
Ring_Joint2 = HandManager.HandJoint.Ring_Joint2,
Ring_Joint3 = HandManager.HandJoint.Ring_Joint3,
Ring_Tip = HandManager.HandJoint.Ring_Tip, // 17
Pinky_Joint1 = HandManager.HandJoint.Pinky_Joint1,
Pinky_Joint2 = HandManager.HandJoint.Pinky_Joint2,
Pinky_Joint3 = HandManager.HandJoint.Pinky_Joint3,
Pinky_Tip = HandManager.HandJoint.Pinky_Tip, // 21
}
GestureType¶
enum GestureType {
Unknown = 0, // All other gestures not in predefined set
Point = 1,
Fist = 2,
OK = 3,
Like = 4,
Five = 5,
Victory = 6,
}
GestureHandData¶
struct GestureHandData {
public bool valid;
public bool isTracked;
public bool isLeft;
public Vector3[] points;
public Quaternion[] rotations;
public GestureType gesture;
}
ThumbState¶
enum ThumbState { Close, Open }
FingerState¶
enum FingerState { Close, Relax, Open }
Custom Gesture Public Static Functions¶
WXRGestureHand.GetGesture¶
Retrieves the current default gesture type.
GestureType GetGesture(bool isLeftHand)
WXRGestureHand.GetSingleHandGesture¶
Retrieves the current single-hand (default or custom) gesture type in string.
You can customize the single-hand gesture type by using SingleHandGestureProducer.
VIVE Wave™ XR plugin provides an single-hand custom gesture type in Assets > Wave > Essence > Interaction > Mode > {version} > Demo > Gestures
string GetSingleHandGesture(bool isLeftHand)
WXRGestureHand.GetDualHandGesture¶
Retrieves the current custom dual-hand gesture type in string.
You can customize the dual-hand gesture type by using DualHandGestureProducer.
VIVE Wave™ XR plugin provides two dual-hand custom gesture types in Assets > Wave > Essence > Interaction > Mode > {version} > Demo > Gestures
string GetDualHandGesture()
WXRGestureHand.GetState¶
Retrieves the current hand state including each finger’s state.
Refer to ThumbState for thumb’s state.
Refer to FingerState for the other fingers’ state.
HandState GetState(bool isLeftHand)