Class XRHandJointIDUtility
Houses extension and utility methods for XRHand
Inherited Members
Namespace: UnityEngine .XR.Hands
Assembly: Unity.XR.Hands.dll
Syntax
public static class XRHandJointIDUtility
Methods
FromIndex(int)
Call this to get the corresponding XRHand
Declaration
public static XRHandJointID FromIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | Index to convert to an ID. |
Returns
Type | Description |
---|---|
XRHand |
The ID matching the index passed in. |
GetBackJointID(XRHandFingerID)
Gets the tip XRHand
Declaration
public static XRHandJointID GetBackJointID(this XRHandFingerID fingerId)
Parameters
Type | Name | Description |
---|---|---|
XRHand |
fingerId | ID of the finger you want the last XRHand |
Returns
Type | Description |
---|---|
XRHand |
Last XRHand |
Remarks
Use with Get
GetFrontJointID(XRHandFingerID)
Gets the metacarpal XRHand
Declaration
public static XRHandJointID GetFrontJointID(this XRHandFingerID fingerId)
Parameters
Type | Name | Description |
---|---|---|
XRHand |
fingerId | ID of the finger of which you want the first XRHand |
Returns
Type | Description |
---|---|
XRHand |
First XRHand |
Examples
You can use GetFrontJointID
and Get
for(var i = XRHandFingerID.Thumb.GetFrontJointID().ToIndex(); // metacarpal
i <= XRHandFingerID.Thumb.GetBackJointID().ToIndex(); // tip
i++)
{
// hand is an XRHand object
XRHandJoint fingerJoint = hand.GetJoint(XRHandJointIDUtility.FromIndex(i));
// Use data...
}
ToIndex(XRHandJointID)
Call .ToIndex()
on a XRHand
Declaration
public static int ToIndex(this XRHandJointID jointId)
Parameters
Type | Name | Description |
---|---|---|
XRHand |
jointId | ID of the joint to convert to an index. |
Returns
Type | Description |
---|---|
int | The index matching the ID passed in. |