XR · class

HandSkeleton

One hand's joints, allocated once and written into every frame.

Explained in XR.

class HandSkeleton
import { HandSkeleton } from '@driftengine/xr';

In depth

Sixteen floats a joint because a joint carries a full transform: a fingertip has an orientation as well as a position, and a consumer drawing a mesh needs both.

Properties

NameTypeDescription
matricesreadonlyFloat32Array<ArrayBuffer>Row-major transforms, JOINT_COUNT * 16, in world space.
radiireadonlyFloat32Array<ArrayBuffer>Joint radii in metres, or 0 where the runtime offered none.
trackedreadonlyUint8Array<ArrayBuffer>Whether each joint had a pose in the last frame that was read.
trackedCountnumberHow many joints were tracked in that frame. Zero means the hand is not visible.

Accessors

NameTypeDescription
visiblegetbooleanWhether anything at all was seen, which is what a consumer branches on before drawing.

Methods

clear

clear(): void

Forget everything, which is what a source going away means.

More

Separate from a frame where every joint is merely untracked: a hand that has left has no last known pose worth holding, and a consumer that fades on loss needs the two told apart.