Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / XrHandPoseEntry

Type Alias: XrHandPoseEntry ​

ts
type XrHandPoseEntry = {
  id: string;
  name: string;
  preset: string | null;
  curls: Record<XrFinger, number>;
  tolerance: number;
  directions: Record<XrFinger, XrHandPoseDirection[]>;
  directionTolerance: number;
  hand: "left" | "right" | null;
  orientation:   | XrHandPoseOrientation
     | null;
  minHoldSeconds: number;
  enabled: boolean;
};

Defined in: components/XRHandPose.ts:18

One pose an entity listens for.

A pose is either a named PRESET or a CUSTOM set of finger curls. Storing the preset id rather than a copy of its numbers means a preset improved in a later release reaches existing scenes, while custom poses stay pinned to exactly what the author dialled in.

Properties ​

PropertyTypeDescriptionDefined in
idstringStable id, unique within the component. Used in Behaviour hooks.components/XRHandPose.ts:20
namestringShown in the inspector and passed to scripts.components/XRHandPose.ts:22
presetstring | nullPreset id, or null for a custom pose.components/XRHandPose.ts:24
curlsRecord<XrFinger, number>Per-finger curl targets, 0 extended → 1 curled. Custom poses only.components/XRHandPose.ts:26
tolerancenumberSlack around each curl target. Larger is easier to perform.components/XRHandPose.ts:28
directionsRecord<XrFinger, XrHandPoseDirection[]>Directions each finger may point. Empty means the finger may point anywhere. Any ONE listed direction satisfies the finger, mirroring fingerpose's addDirection — "thumb up OR diagonally up" is one pose, not two.components/XRHandPose.ts:35
directionTolerancenumberHow far a finger may point from an accepted direction, in degrees.components/XRHandPose.ts:37
hand"left" | "right" | nullWhich hand may trigger it; null for either.components/XRHandPose.ts:39
orientation| XrHandPoseOrientation | nullOptional direction requirement.components/XRHandPose.ts:41
minHoldSecondsnumberSeconds the pose must be held before it fires.components/XRHandPose.ts:43
enabledboolean-components/XRHandPose.ts:44