Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / Hand

Interface: Hand ​

Defined in: hands/tracker.ts:102

One hand in view.

Properties ​

PropertyModifierTypeDescriptionDefined in
sidereadonlyHandSideThe person's own hand: left is their left hand, on any camera.hands/tracker.ts:104
pictureSidereadonlyHandSideWhich side of the picture it's on, which is what a game about the screen usually wants.hands/tracker.ts:106
posereadonlyHandPoseName | nullThe named pose it's holding, or null.hands/tracker.ts:108
pinchreadonlynumberHow close thumb and first finger are, 0 apart and 1 touching.hands/tracker.ts:110
landmarksreadonlyreadonly Point3[]All 21 landmarks, x and y 0 to 1 across the picture.hands/tracker.ts:112
metresreadonlyreadonly Point3[]All 21 landmarks in metres, around the hand.hands/tracker.ts:114

Methods ​

getPicturePosition() ​

ts
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 ​

ParameterType
point?HandPointName

Returns ​

ts
{
  x: number;
  y: number;
}
NameTypeDefined in
xnumberhands/tracker.ts:116
ynumberhands/tracker.ts:116

getScreenPosition() ​

ts
getScreenPosition(point?): ScreenPosition;

Defined in: hands/tracker.ts:118

Where a place on the hand is on screen.

Parameters ​

ParameterType
point?HandPointName

Returns ​

ScreenPosition


getWorldPosition() ​

ts
getWorldPosition(point?, target?): Vector3;

Defined in: hands/tracker.ts:120

Where a place on the hand is in the world.

Parameters ​

ParameterType
point?HandPointName
target?Vector3

Returns ​

Vector3


getWorldRotation() ​

ts
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 ​

ParameterType
target?Quaternion

Returns ​

Quaternion


getWorldSize() ​

ts
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() ​

ts
getScreenSize(): number;

Defined in: hands/tracker.ts:126

The length of the palm on screen, in CSS pixels.

Returns ​

number


isTouching() ​

ts
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 ​

ParameterType
pointHandPointName
positionVector3Like
radius?number

Returns ​

boolean