Skip to content

@relu-interactives/spatial-ecs


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

Interface: HandTrackerRuntime ​

Defined in: hands/tracker.ts:184

What World.setHandTracker takes: hands, and what the world needs to run them.

Extends ​

Methods ​

status() ​

ts
status(): HandTrackingStatus;

Defined in: hands/tracker.ts:161

"loading" until the detector is up, then "ready", or "failed" if it couldn't start.

Returns ​

HandTrackingStatus

Inherited from ​

Hands.status


error() ​

ts
error(): string | null;

Defined in: hands/tracker.ts:163

Why it failed, for a person.

Returns ​

string | null

Inherited from ​

Hands.error


list() ​

ts
list(): readonly Hand[];

Defined in: hands/tracker.ts:165

Every hand in view.

Returns ​

readonly Hand[]

Inherited from ​

Hands.list


get() ​

ts
get(side): Hand | null;

Defined in: hands/tracker.ts:167

That hand if it's in view, or else null.

Parameters ​

ParameterType
sideHandSide

Returns ​

Hand | null

Inherited from ​

Hands.get


first() ​

ts
first(): Hand | null;

Defined in: hands/tracker.ts:169

The hand that's been in view longest, or null.

Returns ​

Hand | null

Inherited from ​

Hands.first


isPose() ​

ts
isPose(pose, side?): boolean;

Defined in: hands/tracker.ts:171

Whether a hand is holding a pose. With no side, either hand.

Parameters ​

ParameterType
poseHandPoseName
side?HandSide

Returns ​

boolean

Inherited from ​

Hands.isPose


didGesture() ​

ts
didGesture(name, side?): boolean;

Defined in: hands/tracker.ts:173

That gesture fired on this frame. For a script that would rather poll than listen.

Parameters ​

ParameterType
nameHandGestureName
side?HandSide

Returns ​

boolean

Inherited from ​

Hands.didGesture


on() ​

ts
on(name, listener): Unsubscribe;

Defined in: hands/tracker.ts:175

Calls listener each time a gesture fires, or any gesture with "*". Returns what takes it off.

Parameters ​

ParameterType
name"*" | HandGestureName
listener(event) => void

Returns ​

Unsubscribe

Inherited from ​

Hands.on


attach() ​

ts
attach(entityId, options?): void;

Defined in: hands/tracker.ts:177

Keeps an entity on a hand. Its Transform is written every frame until detach.

Parameters ​

ParameterType
entityIdnumber
options?HandAttachOptions

Returns ​

void

Inherited from ​

Hands.attach


detach() ​

ts
detach(entityId): void;

Defined in: hands/tracker.ts:178

Parameters ​

ParameterType
entityIdnumber

Returns ​

void

Inherited from ​

Hands.detach


stats() ​

ts
stats(): Record<string, number | string>;

Defined in: hands/tracker.ts:180

What the detector is costing, for a person looking at frame rate.

Returns ​

Record<string, number | string>

Inherited from ​

Hands.stats


update() ​

ts
update(deltaTime): void;

Defined in: hands/tracker.ts:186

One world update.

Parameters ​

ParameterType
deltaTimenumber

Returns ​

void


dispose() ​

ts
dispose(): void;

Defined in: hands/tracker.ts:187

Returns ​

void