# Hand

```csharp
public class Hand
```

### Constructors

| Name                                                                                                                                                                                                                                                                  | Description                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Hand()                                                                                                                                                                                                                                                                | Creates a new Hand object.                                                            |
| Hand([Hand](https://handtracking.lightbuzz.com/api-reference/hand))                                                                                                                                                                                                   | Creates a new Hand object by copying the data from the specified hand.                |
| Hand(int, [HandSide](https://handtracking.lightbuzz.com/api-reference/handside), float, Dictionary<[FingerJointType](https://handtracking.lightbuzz.com/api-reference/fingerjointtype), [FingerJoint](https://handtracking.lightbuzz.com/api-reference/fingerjoint)>) | Creates a new Hand object with the specified id, type, confidence, and finger joints. |

### Properties

| Name                                                                                       | Type                                                                                                                                                                         | Description                                   |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| ID                                                                                         | int                                                                                                                                                                          | The ID of the hand.                           |
| Side                                                                                       | [HandSide](https://handtracking.lightbuzz.com/api-reference/handside)                                                                                                        | The side of the hand (left or right).         |
| Confidence                                                                                 | float                                                                                                                                                                        | The tracking confidence of the hand (0 to 1). |
| FingerJoints                                                                               | Dictionary<[FingerJointType](https://handtracking.lightbuzz.com/api-reference/fingerjointtype), [FingerJoint](https://handtracking.lightbuzz.com/api-reference/fingerjoint)> | The finger joints of the hand.                |
| Thumb                                                                                      | [Thumb](https://handtracking.lightbuzz.com/api-reference/finger/thumb)                                                                                                       | The thumb of the hand.                        |
| Index                                                                                      | [Index](https://handtracking.lightbuzz.com/api-reference/finger/index)                                                                                                       | The index finger of the hand.                 |
| Middle                                                                                     | [Middle](https://handtracking.lightbuzz.com/api-reference/finger/middle)                                                                                                     | The middle finger of the hand.                |
| Ring                                                                                       | [Ring](https://handtracking.lightbuzz.com/api-reference/finger/ring)                                                                                                         | The ring finger of the hand.                  |
| Pinky                                                                                      | [Pinky](https://handtracking.lightbuzz.com/api-reference/finger/pinky)                                                                                                       | The pinky finger of the hand.                 |
| Palm                                                                                       | [Palm](https://handtracking.lightbuzz.com/api-reference/finger/palm)                                                                                                         | The palm of the hand.                         |
| this\[[FingerJointType](https://handtracking.lightbuzz.com/api-reference/fingerjointtype)] | [FingerJoint](https://handtracking.lightbuzz.com/api-reference/fingerjoint)                                                                                                  | Read-Only. The specified finger joint.        |
| IsOpen                                                                                     | bool                                                                                                                                                                         | Read-Only. If the palm is open or closed.     |
| BoundingBox2D                                                                              | [UnityEngine.Rect](https://docs.unity3d.com/ScriptReference/Rect.html)                                                                                                       | Read-Only. The 3D bounding box of the hand.   |
| BoundingBox3D                                                                              | [UnityEngine.Rect](https://docs.unity3d.com/ScriptReference/Rect.html)                                                                                                       | Read-Only. The 3D bounding box of the hand.   |

### Methods

| Name                                                                                        | Return Type                                                                 | Description                                                     |
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------- |
| ToJson()                                                                                    | string                                                                      | Converts the value of this instance to a Json formatted string. |
| Parent([FingerJointType](https://handtracking.lightbuzz.com/api-reference/fingerjointtype)) | [FingerJoint](https://handtracking.lightbuzz.com/api-reference/fingerjoint) | Returns the Parent joint.                                       |
| Child([FingerJointType](https://handtracking.lightbuzz.com/api-reference/fingerjointtype))  | [FingerJoint](https://handtracking.lightbuzz.com/api-reference/fingerjoint) | Returns the Child joint.                                        |

### Example

The examples show how to manage a hand with the `Hand` class.

#### Create a hand object

To create a hand object, start by creating a dictionary of `FingerJoint` objects.

```csharp
Dictionary<FingerJointType, FingerJoint> fingerJoints = new Dictionary<FingerJointType, FingerJoint>();
fingerJoints.Add(FingerJointType.IndexTip, indexTip);
fingerJoints.Add(FingerJointType.IndexDIP, indexDIP);
```

Then, there are 3 supported constructors to create a hand object.

Create a hand object with the specified ID, type, confidence and finger joints.

```csharp
Hand rightHand = new Hand(1, HandSide.Right, 0.5f, fingerJoints);
```

Create an empty hand object and assign values to each property.

```csharp
Hand leftHand = new Hand();

leftHand.ID = 2;
leftHand.Side = HandSide.Left;
leftHand.Confidence = 0.5f;
leftHand.FingerJoints = fingerJoints;

```

Create a hand object by copying the values of another hand object.

```csharp
Hand rightHandCopy = new Hand(rightHand);
```

#### Get finger and joint information from a hand

To retrieve finger and finger joint information from a hand object, you can retrieve the finger from the hand and then get the finger joint from the finger.

```csharp
// Get the index finger from the hand.
Index index = rightHand.Index;

// Get the index tip joint from the retrieved finger.
FingerJoint rightIndexTip = index.Tip;
```

Alternatively, you can get the finger joint information directly from the hand object.

```csharp
FingerJoint rightIndexTipNew = rightHand.Index.Tip;
```
