@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / Hand
Interface: Hand ​
Defined in: hands/tracker.ts:102
One hand in view.
Properties ​
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
side | readonly | HandSide | The person's own hand: left is their left hand, on any camera. | hands/tracker.ts:104 |
pictureSide | readonly | HandSide | Which side of the picture it's on, which is what a game about the screen usually wants. | hands/tracker.ts:106 |
pose | readonly | HandPoseName | null | The named pose it's holding, or null. | hands/tracker.ts:108 |
pinch | readonly | number | How close thumb and first finger are, 0 apart and 1 touching. | hands/tracker.ts:110 |
landmarks | readonly | readonly Point3[] | All 21 landmarks, x and y 0 to 1 across the picture. | hands/tracker.ts:112 |
metres | readonly | readonly Point3[] | All 21 landmarks in metres, around the hand. | hands/tracker.ts:114 |
Methods ​
getPicturePosition() ​
getPicturePosition(point?): {
x: number;
y: number;
};Defined in: hands/tracker.ts:116
Where a place on the hand is in the picture, x and y 0 to 1.
Parameters ​
| Parameter | Type |
|---|---|
point? | HandPointName |
Returns ​
{
x: number;
y: number;
}| Name | Type | Defined in |
|---|---|---|
x | number | hands/tracker.ts:116 |
y | number | hands/tracker.ts:116 |
getScreenPosition() ​
getScreenPosition(point?): ScreenPosition;Defined in: hands/tracker.ts:118
Where a place on the hand is on screen.
Parameters ​
| Parameter | Type |
|---|---|
point? | HandPointName |
Returns ​
getWorldPosition() ​
getWorldPosition(point?, target?): Vector3;Defined in: hands/tracker.ts:120
Where a place on the hand is in the world.
Parameters ​
| Parameter | Type |
|---|---|
point? | HandPointName |
target? | Vector3 |
Returns ​
Vector3
getWorldRotation() ​
getWorldRotation(target?): Quaternion;Defined in: hands/tracker.ts:122
Which way the hand is turned in the world: +Y along the fingers, +Z out of the palm.
Parameters ​
| Parameter | Type |
|---|---|
target? | Quaternion |
Returns ​
Quaternion
getWorldSize() ​
getWorldSize(): number;Defined in: hands/tracker.ts:124
The length of the palm in world units, for scaling something to the hand.
Returns ​
number
getScreenSize() ​
getScreenSize(): number;Defined in: hands/tracker.ts:126
The length of the palm on screen, in CSS pixels.
Returns ​
number
isTouching() ​
isTouching(
point,
position,
radius?): boolean;Defined in: hands/tracker.ts:131
Whether a world position lands on a place on the hand, as the viewer sees it. Depth doesn't count. radius is in palm lengths.
Parameters ​
| Parameter | Type |
|---|---|
point | HandPointName |
position | Vector3Like |
radius? | number |
Returns ​
boolean

