# XrHand

Class · extends [`EventHandler`](https://api.playcanvas.com/engine/classes/EventHandler.md) · category: XR

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/xr/xr-hand.js#L37

Represents a hand with fingers and joints.

## Accessors

### fingers

```ts
get fingers(): XrFinger[]
```

Array of fingers of the hand.

### joints

```ts
get joints(): XrJoint[]
```

Array of joints in the hand.

### tips

```ts
get tips(): XrJoint[]
```

Array of joints that are fingertips.

### tracking

```ts
get tracking(): boolean
```

True if tracking is available, otherwise tracking might be lost.

### wrist

```ts
get wrist(): XrJoint | null
```

Wrist of a hand, or null if it is not available by WebXR underlying system.

## Methods

### getJointById

```ts
getJointById(id: string): XrJoint | null
```

Returns joint by its XRHand id.

**Parameters**

- `id` (`string`): Id of a joint based on specs ID's in XRHand: https://immersive-web.github.io/webxr-hand-input/#skeleton-joints-section.

**Returns** [`XrJoint`](https://api.playcanvas.com/engine/classes/XrJoint.md) `| null`: Joint or null if not available.

## Events

### EVENT_TRACKING

```ts
static EVENT_TRACKING: string = 'tracking'
```

Fired when tracking becomes available.

**Example**

```ts
hand.on('tracking', () => {
    console.log('Hand tracking is available');
});
```

### EVENT_TRACKINGLOST

```ts
static EVENT_TRACKINGLOST: string = 'trackinglost'
```

Fired when tracking is lost.

**Example**

```ts
hand.on('trackinglost', () => {
    console.log('Hand tracking is lost');
});
```

## Inherited from [EventHandler](https://api.playcanvas.com/engine/classes/EventHandler.md)

- `fire(name: string, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, arg6?: any, arg7?: any, arg8?: any): EventHandler`
- `hasEvent(name: string): boolean`
- `off(name?: string, callback?: HandleEventCallback, scope?: any): EventHandler`
- `on(name: string, callback: HandleEventCallback, scope?: any): EventHandle`
- `once(name: string, callback: HandleEventCallback, scope?: any): EventHandle`
