@relu-interactives/spatial-ecs 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{System-TmC2EijF.d.cts → System-31wk-A0g.d.cts} +1 -1
- package/dist/{System-TmC2EijF.d.ts → System-31wk-A0g.d.ts} +1 -1
- package/dist/{XRInteractor-CCUzSqg9.d.ts → XRHandPose-CxPz8VBp.d.ts} +139 -20
- package/dist/{XRInteractor-I2q6TKtF.d.cts → XRHandPose-VuSbe4iz.d.cts} +139 -20
- package/dist/{chunk-FQTOC7HK.js → chunk-KIKIWCEB.js} +14 -5
- package/dist/chunk-KIKIWCEB.js.map +1 -0
- package/dist/{chunk-N4GKZ7IV.js → chunk-KVGGAL5V.js} +227 -3
- package/dist/chunk-KVGGAL5V.js.map +1 -0
- package/dist/{chunk-JRJ3CL5H.js → chunk-L5BP727H.js} +3 -3
- package/dist/{chunk-JRJ3CL5H.js.map → chunk-L5BP727H.js.map} +1 -1
- package/dist/{chunk-O6FJA4XW.js → chunk-LMTB4KQ4.js} +929 -42
- package/dist/chunk-LMTB4KQ4.js.map +1 -0
- package/dist/components/index.cjs +98 -0
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +4 -3
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.js +1 -1
- package/dist/docs/guide/vr-and-hand-poses.md +111 -0
- package/dist/factories/index.cjs +58 -0
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +6 -3
- package/dist/factories/index.d.ts +6 -3
- package/dist/factories/index.js +3 -3
- package/dist/handPose-dFxqbFFY.d.cts +240 -0
- package/dist/handPose-dFxqbFFY.d.ts +240 -0
- package/dist/{index-BltjPEhg.d.cts → index-BIQoaKAA.d.cts} +9 -3
- package/dist/{index-W8pUajCW.d.ts → index-BxdXgqiI.d.ts} +9 -3
- package/dist/{index-_q9TVDI5.d.ts → index-C7XQyrgE.d.ts} +79 -7
- package/dist/{index-B9nwRDf9.d.cts → index-DyN50JZo.d.cts} +79 -7
- package/dist/index.cjs +1187 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -9
- package/dist/index.d.ts +104 -9
- package/dist/index.js +8 -8
- package/dist/systems/index.cjs +1144 -37
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +3 -2
- package/dist/systems/index.d.ts +3 -2
- package/dist/systems/index.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/worldSnapshotUtils.d.cts +1 -1
- package/dist/worldSnapshotUtils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-FQTOC7HK.js.map +0 -1
- package/dist/chunk-N4GKZ7IV.js.map +0 -1
- package/dist/chunk-O6FJA4XW.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent,
|
|
2
|
-
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-
|
|
1
|
+
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, T as RigidbodyState, g as ColliderState, P as PhysicsComponent, o as EntityType, I as ImageComponent, q as ImageTargetAnchor, p as ImageTarget, L as LightComponent, M as MaterialComponent, B as MeshComponent, F as MeshGeometryComponent, J as ModelComponent, N as Name, O as Object3DRef, W as ScriptEntry, V as ScriptComponent, Y as ScriptObjectComponentInput, X as ScriptObjectComponent, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, w as InstancedMeshKind, G as MeshGeometryParameters, v as InstancedMeshComponent, t as InstanceSlotComponent, a6 as VideoComponent, af as XRRigComponent, a4 as VRTeleportAreaComponent, a8 as XRHandPoseComponent, aa as XRInteractableComponent, ac as XRInteractorComponent, ae as XRInteractorSideComponent } from '../XRHandPose-VuSbe4iz.cjs';
|
|
2
|
+
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-31wk-A0g.cjs';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
|
+
import '../handPose-dFxqbFFY.cjs';
|
|
5
6
|
|
|
6
7
|
declare function createAnimationComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof AnimationComponent>): AnimationComponent;
|
|
7
8
|
|
|
@@ -78,6 +79,8 @@ declare function createXRRigComponent(world: World, entityId: number, ...args: C
|
|
|
78
79
|
|
|
79
80
|
declare function createVRTeleportAreaComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof VRTeleportAreaComponent>): VRTeleportAreaComponent;
|
|
80
81
|
|
|
82
|
+
declare function createXRHandPoseComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRHandPoseComponent>): XRHandPoseComponent;
|
|
83
|
+
|
|
81
84
|
declare function createXRInteractableComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRInteractableComponent>): XRInteractableComponent;
|
|
82
85
|
|
|
83
86
|
declare function createXRInteractorComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRInteractorComponent>): XRInteractorComponent;
|
|
@@ -88,4 +91,4 @@ declare function registerDefaultComponentFactories(objectManagementSystem: Objec
|
|
|
88
91
|
|
|
89
92
|
declare function registerDefaultFactories(objectManagementSystem: ObjectManagementSystem): void;
|
|
90
93
|
|
|
91
|
-
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
|
|
94
|
+
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent,
|
|
2
|
-
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-
|
|
1
|
+
import { A as AnimationComponent, b as AudioComponent, c as CameraComponentOptions, C as CameraComponent, T as RigidbodyState, g as ColliderState, P as PhysicsComponent, o as EntityType, I as ImageComponent, q as ImageTargetAnchor, p as ImageTarget, L as LightComponent, M as MaterialComponent, B as MeshComponent, F as MeshGeometryComponent, J as ModelComponent, N as Name, O as Object3DRef, W as ScriptEntry, V as ScriptComponent, Y as ScriptObjectComponentInput, X as ScriptObjectComponent, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, w as InstancedMeshKind, G as MeshGeometryParameters, v as InstancedMeshComponent, t as InstanceSlotComponent, a6 as VideoComponent, af as XRRigComponent, a4 as VRTeleportAreaComponent, a8 as XRHandPoseComponent, aa as XRInteractableComponent, ac as XRInteractorComponent, ae as XRInteractorSideComponent } from '../XRHandPose-CxPz8VBp.js';
|
|
2
|
+
import { l as World, g as EnvironmentState, E as Environment, P as ParentId, i as PostprocessingState, h as Postprocessing, T as TransformComponent, O as ObjectManagementSystem } from '../System-31wk-A0g.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
|
+
import '../handPose-dFxqbFFY.js';
|
|
5
6
|
|
|
6
7
|
declare function createAnimationComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof AnimationComponent>): AnimationComponent;
|
|
7
8
|
|
|
@@ -78,6 +79,8 @@ declare function createXRRigComponent(world: World, entityId: number, ...args: C
|
|
|
78
79
|
|
|
79
80
|
declare function createVRTeleportAreaComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof VRTeleportAreaComponent>): VRTeleportAreaComponent;
|
|
80
81
|
|
|
82
|
+
declare function createXRHandPoseComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRHandPoseComponent>): XRHandPoseComponent;
|
|
83
|
+
|
|
81
84
|
declare function createXRInteractableComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRInteractableComponent>): XRInteractableComponent;
|
|
82
85
|
|
|
83
86
|
declare function createXRInteractorComponent(world: World, entityId: number, ...args: ConstructorParameters<typeof XRInteractorComponent>): XRInteractorComponent;
|
|
@@ -88,4 +91,4 @@ declare function registerDefaultComponentFactories(objectManagementSystem: Objec
|
|
|
88
91
|
|
|
89
92
|
declare function registerDefaultFactories(objectManagementSystem: ObjectManagementSystem): void;
|
|
90
93
|
|
|
91
|
-
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
|
|
94
|
+
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories };
|
package/dist/factories/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { createAnimationComponent, createAudioComponent, createCameraComponent, createEntityTypeComponent, createEnvironmentComponent, createImageComponent, createImageTargetAnchorComponent, createImageTargetComponent, createInstanceSlotComponent, createInstancedMeshComponent, createLightComponent, createMaterialComponent, createMeshComponent, createMeshGeometryComponent, createModelComponent, createNameComponent, createObject3DRefComponent, createParentIdComponent, createPhysicsComponent, createPostprocessingComponent, createScriptComponent, createScriptObjectComponent, createSelectableComponent, createSelectionTransformStateComponent, createSpriteComponent, createTransformComponent, createVRTeleportAreaComponent, createVideoComponent, createXRHandPoseComponent, createXRInteractableComponent, createXRInteractorComponent, createXRInteractorSideComponent, createXRRigComponent, registerDefaultComponentFactories, registerDefaultFactories } from '../chunk-KIKIWCEB.js';
|
|
2
|
+
import '../chunk-L5BP727H.js';
|
|
3
|
+
import '../chunk-KVGGAL5V.js';
|
|
4
4
|
import '../chunk-OY7ZODZP.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hand pose metrics and matching.
|
|
5
|
+
*
|
|
6
|
+
* The problem this solves: a raw hand is 25 joint positions, and no two users'
|
|
7
|
+
* hands are the same size. Comparing joint positions directly would mean a pose
|
|
8
|
+
* authored by an adult never matches a child. So we reduce the hand to a handful
|
|
9
|
+
* of SCALE-INVARIANT scalars — how curled each finger is, how spread, how close
|
|
10
|
+
* the tips are to the thumb — and match against those.
|
|
11
|
+
*
|
|
12
|
+
* Two conventions borrowed from the mature toolkits, both load-bearing:
|
|
13
|
+
*
|
|
14
|
+
* 1. Every distance threshold is expressed as a RATIO OF PALM WIDTH, never in
|
|
15
|
+
* metres. This is what makes a pose authored once work for every hand.
|
|
16
|
+
* 2. Curl is split into BASE (knuckle) and TIP (outer joints). A single curl
|
|
17
|
+
* number cannot tell a hook (base straight, tip curled) from a fist (both
|
|
18
|
+
* curled) from a flat bent hand (base curled, tip straight).
|
|
19
|
+
*
|
|
20
|
+
* Everything here is pure and position-only — no quaternions, no WebXR types —
|
|
21
|
+
* so poses can be unit-tested without a headset and fed from any joint source.
|
|
22
|
+
*/
|
|
23
|
+
/** The 25 joints of the WebXR hand skeleton. */
|
|
24
|
+
type XrHandJointName = "wrist" | "thumb-metacarpal" | "thumb-phalanx-proximal" | "thumb-phalanx-distal" | "thumb-tip" | "index-finger-metacarpal" | "index-finger-phalanx-proximal" | "index-finger-phalanx-intermediate" | "index-finger-phalanx-distal" | "index-finger-tip" | "middle-finger-metacarpal" | "middle-finger-phalanx-proximal" | "middle-finger-phalanx-intermediate" | "middle-finger-phalanx-distal" | "middle-finger-tip" | "ring-finger-metacarpal" | "ring-finger-phalanx-proximal" | "ring-finger-phalanx-intermediate" | "ring-finger-phalanx-distal" | "ring-finger-tip" | "pinky-finger-metacarpal" | "pinky-finger-phalanx-proximal" | "pinky-finger-phalanx-intermediate" | "pinky-finger-phalanx-distal" | "pinky-finger-tip";
|
|
25
|
+
type XrFinger = "thumb" | "index" | "middle" | "ring" | "pinky";
|
|
26
|
+
declare const XR_FINGERS: readonly XrFinger[];
|
|
27
|
+
/** Fingers that can oppose the thumb. The thumb cannot pinch itself. */
|
|
28
|
+
declare const PINCH_FINGERS: readonly Exclude<XrFinger, "thumb">[];
|
|
29
|
+
/**
|
|
30
|
+
* Joint positions, in world space.
|
|
31
|
+
*
|
|
32
|
+
* Partial because tracking drops joints, and because non-WebXR sources (a
|
|
33
|
+
* simulator, a recorded pose) may supply fewer.
|
|
34
|
+
*/
|
|
35
|
+
type XrHandJoints = Partial<Record<XrHandJointName, THREE.Vector3>>;
|
|
36
|
+
/** Fallback palm width when the hand is too poorly tracked to measure. */
|
|
37
|
+
declare const FALLBACK_HAND_SCALE = 0.08;
|
|
38
|
+
/**
|
|
39
|
+
* Straightness normalization.
|
|
40
|
+
*
|
|
41
|
+
* Adjacent bone directions are compared by dot product (cheaper than `acos` and
|
|
42
|
+
* monotonic, which is all we need). A dot at or above {@link STRAIGHT_COS} reads
|
|
43
|
+
* as perfectly straight; at or below {@link CURLED_COS} (~57°) as fully curled.
|
|
44
|
+
*/
|
|
45
|
+
declare const STRAIGHT_COS = 0.95;
|
|
46
|
+
declare const CURLED_COS = 0.55;
|
|
47
|
+
/** How curled one finger is. */
|
|
48
|
+
type XrFingerCurl = {
|
|
49
|
+
/** Knuckle bend alone — 0 straight, 1 bent square to the palm. */
|
|
50
|
+
baseCurl: number;
|
|
51
|
+
/** The outer joints — distinguishes a hook from a fist. */
|
|
52
|
+
tipCurl: number;
|
|
53
|
+
/** Whole-finger curl. The value a simple pose editor exposes. */
|
|
54
|
+
curl: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Curl for one finger, or null when the finger isn't tracked well enough.
|
|
58
|
+
*
|
|
59
|
+
* The thumb yields only two bend angles to the fingers' three, so `baseCurl` and
|
|
60
|
+
* `tipCurl` are its first and second bends respectively.
|
|
61
|
+
*/
|
|
62
|
+
declare function computeFingerCurl(joints: XrHandJoints, finger: XrFinger): XrFingerCurl | null;
|
|
63
|
+
/** Distance across the knuckles — our unit of hand size. */
|
|
64
|
+
declare function computePalmWidth(joints: XrHandJoints): number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Characteristic hand size in metres.
|
|
67
|
+
*
|
|
68
|
+
* Every distance threshold in this module is a multiple of this, which is what
|
|
69
|
+
* lets one authored pose match hands of any size.
|
|
70
|
+
*/
|
|
71
|
+
declare function estimateHandScale(joints: XrHandJoints): number;
|
|
72
|
+
/**
|
|
73
|
+
* How close a fingertip is to the thumb tip. 1 = touching, 0 = far apart.
|
|
74
|
+
*
|
|
75
|
+
* Scaled by hand size, so "pinching" means the same gesture on every hand
|
|
76
|
+
* rather than the same number of millimetres.
|
|
77
|
+
*/
|
|
78
|
+
declare function computePinch(joints: XrHandJoints, finger: Exclude<XrFinger, "thumb">): number | null;
|
|
79
|
+
/**
|
|
80
|
+
* Angular separation between two fingers. 0 = parallel, 1 = splayed wide.
|
|
81
|
+
*
|
|
82
|
+
* Measured on metacarpal→tip direction, which stays meaningful even when the
|
|
83
|
+
* fingers are partly curled.
|
|
84
|
+
*/
|
|
85
|
+
declare function computeSpread(joints: XrHandJoints, a: XrFinger, b: XrFinger): number | null;
|
|
86
|
+
/** An orthonormal frame attached to the palm. */
|
|
87
|
+
type XrPalmPose = {
|
|
88
|
+
center: THREE.Vector3;
|
|
89
|
+
/** Outward from the front of the palm. */
|
|
90
|
+
normal: THREE.Vector3;
|
|
91
|
+
/** Across the palm, thumb-ward. */
|
|
92
|
+
right: THREE.Vector3;
|
|
93
|
+
/** Along the fingers. */
|
|
94
|
+
up: THREE.Vector3;
|
|
95
|
+
width: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Palm frame, used for orientation conditions ("palm up", "thumb toward face").
|
|
99
|
+
*
|
|
100
|
+
* Handedness matters: the same cross product points opposite ways on left and
|
|
101
|
+
* right hands, so the left is mirrored to keep `normal` meaning "out of the
|
|
102
|
+
* front of the palm" on both.
|
|
103
|
+
*/
|
|
104
|
+
declare function computePalmPose(joints: XrHandJoints, handedness: "left" | "right"): XrPalmPose | null;
|
|
105
|
+
/** Everything a pose is matched against, derived once per hand per frame. */
|
|
106
|
+
type XrHandShape = {
|
|
107
|
+
handedness: "left" | "right";
|
|
108
|
+
fingers: Record<XrFinger, XrFingerCurl>;
|
|
109
|
+
/** Thumb-opposition per finger. */
|
|
110
|
+
pinch: Record<Exclude<XrFinger, "thumb">, number>;
|
|
111
|
+
spread: {
|
|
112
|
+
thumbIndex: number;
|
|
113
|
+
indexMiddle: number;
|
|
114
|
+
middleRing: number;
|
|
115
|
+
ringPinky: number;
|
|
116
|
+
};
|
|
117
|
+
palm: XrPalmPose | null;
|
|
118
|
+
/** Characteristic hand size, metres. */
|
|
119
|
+
scale: number;
|
|
120
|
+
/** Direction the thumb points, world space. */
|
|
121
|
+
thumbDirection: THREE.Vector3 | null;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Reduce tracked joints to the matchable shape.
|
|
125
|
+
*
|
|
126
|
+
* Returns null when the hand is too poorly tracked for ANY finger to be
|
|
127
|
+
* measured — better to report "no pose" than to match against garbage.
|
|
128
|
+
*/
|
|
129
|
+
declare function computeHandShape(joints: XrHandJoints, handedness: "left" | "right"): XrHandShape | null;
|
|
130
|
+
/** Target curl for one finger, with the slack allowed around it. */
|
|
131
|
+
type XrFingerTarget = {
|
|
132
|
+
/** 0 = extended, 1 = fully curled. */
|
|
133
|
+
curl: number;
|
|
134
|
+
/** Half-width of the accepted band. Larger = easier to perform. */
|
|
135
|
+
tolerance: number;
|
|
136
|
+
/** Optional knuckle constraint, for poses where whole-finger curl is ambiguous. */
|
|
137
|
+
baseCurl?: number;
|
|
138
|
+
/** Optional outer-joint constraint. */
|
|
139
|
+
tipCurl?: number;
|
|
140
|
+
};
|
|
141
|
+
/** Which way something on the hand must point for the pose to count. */
|
|
142
|
+
type XrHandPoseAxis = "palm-normal" | "fingers" | "thumb";
|
|
143
|
+
type XrHandPoseDirection = "up" | "down" | "forward" | "back" | "left" | "right" | "toward-head" | "away-from-head";
|
|
144
|
+
type XrHandPoseOrientation = {
|
|
145
|
+
axis: XrHandPoseAxis;
|
|
146
|
+
direction: XrHandPoseDirection;
|
|
147
|
+
/** How far off it may point and still match. */
|
|
148
|
+
toleranceDegrees: number;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* A matchable hand pose.
|
|
152
|
+
*
|
|
153
|
+
* Shape (finger curls) is kept separate from orientation deliberately: thumbs-up
|
|
154
|
+
* and thumbs-down are the SAME hand shape and differ only in where the thumb
|
|
155
|
+
* points. Folding orientation into the curl targets would force two nearly
|
|
156
|
+
* duplicate definitions and make neither editable in isolation.
|
|
157
|
+
*/
|
|
158
|
+
type XrHandPoseDefinition = {
|
|
159
|
+
id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
fingers: Record<XrFinger, XrFingerTarget>;
|
|
162
|
+
/** Optional thumb-to-finger contact requirement. */
|
|
163
|
+
pinch?: {
|
|
164
|
+
finger: Exclude<XrFinger, "thumb">;
|
|
165
|
+
/** 1 = touching. */
|
|
166
|
+
target: number;
|
|
167
|
+
tolerance: number;
|
|
168
|
+
};
|
|
169
|
+
orientation?: XrHandPoseOrientation;
|
|
170
|
+
/** Restrict to one hand; omit to match either. */
|
|
171
|
+
hand?: "left" | "right";
|
|
172
|
+
};
|
|
173
|
+
/** Confidence falls to zero this far outside a target's tolerance band. */
|
|
174
|
+
declare const MATCH_FALLOFF = 0.25;
|
|
175
|
+
type XrHandPoseMatch = {
|
|
176
|
+
/** Every constraint inside its tolerance. */
|
|
177
|
+
matched: boolean;
|
|
178
|
+
/** 0..1. Degrades smoothly outside tolerance, for live editor feedback. */
|
|
179
|
+
confidence: number;
|
|
180
|
+
/** The constraint furthest out of range — what to show the user when it fails. */
|
|
181
|
+
worstConstraint: string | null;
|
|
182
|
+
};
|
|
183
|
+
/** Extra world context needed only by head-relative orientation conditions. */
|
|
184
|
+
type XrHandPoseContext = {
|
|
185
|
+
headPosition?: THREE.Vector3;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Score a live hand against a pose.
|
|
189
|
+
*
|
|
190
|
+
* Confidence is the MINIMUM across constraints, not the average — a soft AND.
|
|
191
|
+
* Averaging lets three perfect fingers outvote one badly wrong one, which is how
|
|
192
|
+
* a fist ends up firing as a thumbs-up.
|
|
193
|
+
*/
|
|
194
|
+
declare function matchHandPose(shape: XrHandShape, definition: XrHandPoseDefinition, context?: XrHandPoseContext): XrHandPoseMatch;
|
|
195
|
+
type XrHandPoseEvent = "start" | "end" | null;
|
|
196
|
+
type HandPoseTrackerOptions = {
|
|
197
|
+
/** Confidence needed to begin holding. */
|
|
198
|
+
enterConfidence?: number;
|
|
199
|
+
/** Confidence below which an active pose ends. Must be < enter. */
|
|
200
|
+
exitConfidence?: number;
|
|
201
|
+
/** Seconds the pose must be held before it fires. */
|
|
202
|
+
minHoldSeconds?: number;
|
|
203
|
+
/** Grace period before tracking loss ends an active pose. */
|
|
204
|
+
lostGraceSeconds?: number;
|
|
205
|
+
};
|
|
206
|
+
declare const DEFAULT_ENTER_CONFIDENCE = 0.8;
|
|
207
|
+
declare const DEFAULT_EXIT_CONFIDENCE = 0.55;
|
|
208
|
+
declare const DEFAULT_MIN_HOLD_SECONDS = 0.15;
|
|
209
|
+
declare const DEFAULT_LOST_GRACE_SECONDS = 0.25;
|
|
210
|
+
/**
|
|
211
|
+
* Turns a stream of per-frame confidences into clean start/end events.
|
|
212
|
+
*
|
|
213
|
+
* Two mechanisms, both necessary:
|
|
214
|
+
*
|
|
215
|
+
* - HYSTERESIS. A single threshold makes confidence hovering at the boundary
|
|
216
|
+
* emit start/end at frame rate. Entering high and exiting low kills that.
|
|
217
|
+
* - HOLD TIME. Fingers pass through many shapes on the way to the intended one;
|
|
218
|
+
* without a hold requirement a fist fires "point" en route.
|
|
219
|
+
*
|
|
220
|
+
* Tracking loss gets a grace period rather than ending immediately, because
|
|
221
|
+
* hands drop out for a frame or two constantly at the edge of the camera FOV.
|
|
222
|
+
*/
|
|
223
|
+
declare class HandPoseTracker {
|
|
224
|
+
private readonly enterConfidence;
|
|
225
|
+
private readonly exitConfidence;
|
|
226
|
+
private readonly minHoldSeconds;
|
|
227
|
+
private readonly lostGraceSeconds;
|
|
228
|
+
private active;
|
|
229
|
+
private holdingSince;
|
|
230
|
+
private lostSince;
|
|
231
|
+
constructor(options?: HandPoseTrackerOptions);
|
|
232
|
+
isActive(): boolean;
|
|
233
|
+
/** Feed this frame's confidence. Returns an event on a transition. */
|
|
234
|
+
update(confidence: number, now: number): XrHandPoseEvent;
|
|
235
|
+
/** Feed a frame where the hand isn't tracked at all. */
|
|
236
|
+
miss(now: number): XrHandPoseEvent;
|
|
237
|
+
reset(): void;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export { CURLED_COS as C, DEFAULT_ENTER_CONFIDENCE as D, FALLBACK_HAND_SCALE as F, HandPoseTracker as H, MATCH_FALLOFF as M, PINCH_FINGERS as P, STRAIGHT_COS as S, type XrHandPoseDefinition as X, type XrFinger as a, type XrHandPoseOrientation as b, DEFAULT_EXIT_CONFIDENCE as c, DEFAULT_LOST_GRACE_SECONDS as d, DEFAULT_MIN_HOLD_SECONDS as e, type HandPoseTrackerOptions as f, XR_FINGERS as g, type XrFingerCurl as h, type XrFingerTarget as i, type XrHandJointName as j, type XrHandJoints as k, type XrHandPoseAxis as l, type XrHandPoseContext as m, type XrHandPoseDirection as n, type XrHandPoseEvent as o, type XrHandPoseMatch as p, type XrHandShape as q, type XrPalmPose as r, computeFingerCurl as s, computeHandShape as t, computePalmPose as u, computePalmWidth as v, computePinch as w, computeSpread as x, estimateHandScale as y, matchHandPose as z };
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hand pose metrics and matching.
|
|
5
|
+
*
|
|
6
|
+
* The problem this solves: a raw hand is 25 joint positions, and no two users'
|
|
7
|
+
* hands are the same size. Comparing joint positions directly would mean a pose
|
|
8
|
+
* authored by an adult never matches a child. So we reduce the hand to a handful
|
|
9
|
+
* of SCALE-INVARIANT scalars — how curled each finger is, how spread, how close
|
|
10
|
+
* the tips are to the thumb — and match against those.
|
|
11
|
+
*
|
|
12
|
+
* Two conventions borrowed from the mature toolkits, both load-bearing:
|
|
13
|
+
*
|
|
14
|
+
* 1. Every distance threshold is expressed as a RATIO OF PALM WIDTH, never in
|
|
15
|
+
* metres. This is what makes a pose authored once work for every hand.
|
|
16
|
+
* 2. Curl is split into BASE (knuckle) and TIP (outer joints). A single curl
|
|
17
|
+
* number cannot tell a hook (base straight, tip curled) from a fist (both
|
|
18
|
+
* curled) from a flat bent hand (base curled, tip straight).
|
|
19
|
+
*
|
|
20
|
+
* Everything here is pure and position-only — no quaternions, no WebXR types —
|
|
21
|
+
* so poses can be unit-tested without a headset and fed from any joint source.
|
|
22
|
+
*/
|
|
23
|
+
/** The 25 joints of the WebXR hand skeleton. */
|
|
24
|
+
type XrHandJointName = "wrist" | "thumb-metacarpal" | "thumb-phalanx-proximal" | "thumb-phalanx-distal" | "thumb-tip" | "index-finger-metacarpal" | "index-finger-phalanx-proximal" | "index-finger-phalanx-intermediate" | "index-finger-phalanx-distal" | "index-finger-tip" | "middle-finger-metacarpal" | "middle-finger-phalanx-proximal" | "middle-finger-phalanx-intermediate" | "middle-finger-phalanx-distal" | "middle-finger-tip" | "ring-finger-metacarpal" | "ring-finger-phalanx-proximal" | "ring-finger-phalanx-intermediate" | "ring-finger-phalanx-distal" | "ring-finger-tip" | "pinky-finger-metacarpal" | "pinky-finger-phalanx-proximal" | "pinky-finger-phalanx-intermediate" | "pinky-finger-phalanx-distal" | "pinky-finger-tip";
|
|
25
|
+
type XrFinger = "thumb" | "index" | "middle" | "ring" | "pinky";
|
|
26
|
+
declare const XR_FINGERS: readonly XrFinger[];
|
|
27
|
+
/** Fingers that can oppose the thumb. The thumb cannot pinch itself. */
|
|
28
|
+
declare const PINCH_FINGERS: readonly Exclude<XrFinger, "thumb">[];
|
|
29
|
+
/**
|
|
30
|
+
* Joint positions, in world space.
|
|
31
|
+
*
|
|
32
|
+
* Partial because tracking drops joints, and because non-WebXR sources (a
|
|
33
|
+
* simulator, a recorded pose) may supply fewer.
|
|
34
|
+
*/
|
|
35
|
+
type XrHandJoints = Partial<Record<XrHandJointName, THREE.Vector3>>;
|
|
36
|
+
/** Fallback palm width when the hand is too poorly tracked to measure. */
|
|
37
|
+
declare const FALLBACK_HAND_SCALE = 0.08;
|
|
38
|
+
/**
|
|
39
|
+
* Straightness normalization.
|
|
40
|
+
*
|
|
41
|
+
* Adjacent bone directions are compared by dot product (cheaper than `acos` and
|
|
42
|
+
* monotonic, which is all we need). A dot at or above {@link STRAIGHT_COS} reads
|
|
43
|
+
* as perfectly straight; at or below {@link CURLED_COS} (~57°) as fully curled.
|
|
44
|
+
*/
|
|
45
|
+
declare const STRAIGHT_COS = 0.95;
|
|
46
|
+
declare const CURLED_COS = 0.55;
|
|
47
|
+
/** How curled one finger is. */
|
|
48
|
+
type XrFingerCurl = {
|
|
49
|
+
/** Knuckle bend alone — 0 straight, 1 bent square to the palm. */
|
|
50
|
+
baseCurl: number;
|
|
51
|
+
/** The outer joints — distinguishes a hook from a fist. */
|
|
52
|
+
tipCurl: number;
|
|
53
|
+
/** Whole-finger curl. The value a simple pose editor exposes. */
|
|
54
|
+
curl: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Curl for one finger, or null when the finger isn't tracked well enough.
|
|
58
|
+
*
|
|
59
|
+
* The thumb yields only two bend angles to the fingers' three, so `baseCurl` and
|
|
60
|
+
* `tipCurl` are its first and second bends respectively.
|
|
61
|
+
*/
|
|
62
|
+
declare function computeFingerCurl(joints: XrHandJoints, finger: XrFinger): XrFingerCurl | null;
|
|
63
|
+
/** Distance across the knuckles — our unit of hand size. */
|
|
64
|
+
declare function computePalmWidth(joints: XrHandJoints): number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Characteristic hand size in metres.
|
|
67
|
+
*
|
|
68
|
+
* Every distance threshold in this module is a multiple of this, which is what
|
|
69
|
+
* lets one authored pose match hands of any size.
|
|
70
|
+
*/
|
|
71
|
+
declare function estimateHandScale(joints: XrHandJoints): number;
|
|
72
|
+
/**
|
|
73
|
+
* How close a fingertip is to the thumb tip. 1 = touching, 0 = far apart.
|
|
74
|
+
*
|
|
75
|
+
* Scaled by hand size, so "pinching" means the same gesture on every hand
|
|
76
|
+
* rather than the same number of millimetres.
|
|
77
|
+
*/
|
|
78
|
+
declare function computePinch(joints: XrHandJoints, finger: Exclude<XrFinger, "thumb">): number | null;
|
|
79
|
+
/**
|
|
80
|
+
* Angular separation between two fingers. 0 = parallel, 1 = splayed wide.
|
|
81
|
+
*
|
|
82
|
+
* Measured on metacarpal→tip direction, which stays meaningful even when the
|
|
83
|
+
* fingers are partly curled.
|
|
84
|
+
*/
|
|
85
|
+
declare function computeSpread(joints: XrHandJoints, a: XrFinger, b: XrFinger): number | null;
|
|
86
|
+
/** An orthonormal frame attached to the palm. */
|
|
87
|
+
type XrPalmPose = {
|
|
88
|
+
center: THREE.Vector3;
|
|
89
|
+
/** Outward from the front of the palm. */
|
|
90
|
+
normal: THREE.Vector3;
|
|
91
|
+
/** Across the palm, thumb-ward. */
|
|
92
|
+
right: THREE.Vector3;
|
|
93
|
+
/** Along the fingers. */
|
|
94
|
+
up: THREE.Vector3;
|
|
95
|
+
width: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Palm frame, used for orientation conditions ("palm up", "thumb toward face").
|
|
99
|
+
*
|
|
100
|
+
* Handedness matters: the same cross product points opposite ways on left and
|
|
101
|
+
* right hands, so the left is mirrored to keep `normal` meaning "out of the
|
|
102
|
+
* front of the palm" on both.
|
|
103
|
+
*/
|
|
104
|
+
declare function computePalmPose(joints: XrHandJoints, handedness: "left" | "right"): XrPalmPose | null;
|
|
105
|
+
/** Everything a pose is matched against, derived once per hand per frame. */
|
|
106
|
+
type XrHandShape = {
|
|
107
|
+
handedness: "left" | "right";
|
|
108
|
+
fingers: Record<XrFinger, XrFingerCurl>;
|
|
109
|
+
/** Thumb-opposition per finger. */
|
|
110
|
+
pinch: Record<Exclude<XrFinger, "thumb">, number>;
|
|
111
|
+
spread: {
|
|
112
|
+
thumbIndex: number;
|
|
113
|
+
indexMiddle: number;
|
|
114
|
+
middleRing: number;
|
|
115
|
+
ringPinky: number;
|
|
116
|
+
};
|
|
117
|
+
palm: XrPalmPose | null;
|
|
118
|
+
/** Characteristic hand size, metres. */
|
|
119
|
+
scale: number;
|
|
120
|
+
/** Direction the thumb points, world space. */
|
|
121
|
+
thumbDirection: THREE.Vector3 | null;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Reduce tracked joints to the matchable shape.
|
|
125
|
+
*
|
|
126
|
+
* Returns null when the hand is too poorly tracked for ANY finger to be
|
|
127
|
+
* measured — better to report "no pose" than to match against garbage.
|
|
128
|
+
*/
|
|
129
|
+
declare function computeHandShape(joints: XrHandJoints, handedness: "left" | "right"): XrHandShape | null;
|
|
130
|
+
/** Target curl for one finger, with the slack allowed around it. */
|
|
131
|
+
type XrFingerTarget = {
|
|
132
|
+
/** 0 = extended, 1 = fully curled. */
|
|
133
|
+
curl: number;
|
|
134
|
+
/** Half-width of the accepted band. Larger = easier to perform. */
|
|
135
|
+
tolerance: number;
|
|
136
|
+
/** Optional knuckle constraint, for poses where whole-finger curl is ambiguous. */
|
|
137
|
+
baseCurl?: number;
|
|
138
|
+
/** Optional outer-joint constraint. */
|
|
139
|
+
tipCurl?: number;
|
|
140
|
+
};
|
|
141
|
+
/** Which way something on the hand must point for the pose to count. */
|
|
142
|
+
type XrHandPoseAxis = "palm-normal" | "fingers" | "thumb";
|
|
143
|
+
type XrHandPoseDirection = "up" | "down" | "forward" | "back" | "left" | "right" | "toward-head" | "away-from-head";
|
|
144
|
+
type XrHandPoseOrientation = {
|
|
145
|
+
axis: XrHandPoseAxis;
|
|
146
|
+
direction: XrHandPoseDirection;
|
|
147
|
+
/** How far off it may point and still match. */
|
|
148
|
+
toleranceDegrees: number;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* A matchable hand pose.
|
|
152
|
+
*
|
|
153
|
+
* Shape (finger curls) is kept separate from orientation deliberately: thumbs-up
|
|
154
|
+
* and thumbs-down are the SAME hand shape and differ only in where the thumb
|
|
155
|
+
* points. Folding orientation into the curl targets would force two nearly
|
|
156
|
+
* duplicate definitions and make neither editable in isolation.
|
|
157
|
+
*/
|
|
158
|
+
type XrHandPoseDefinition = {
|
|
159
|
+
id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
fingers: Record<XrFinger, XrFingerTarget>;
|
|
162
|
+
/** Optional thumb-to-finger contact requirement. */
|
|
163
|
+
pinch?: {
|
|
164
|
+
finger: Exclude<XrFinger, "thumb">;
|
|
165
|
+
/** 1 = touching. */
|
|
166
|
+
target: number;
|
|
167
|
+
tolerance: number;
|
|
168
|
+
};
|
|
169
|
+
orientation?: XrHandPoseOrientation;
|
|
170
|
+
/** Restrict to one hand; omit to match either. */
|
|
171
|
+
hand?: "left" | "right";
|
|
172
|
+
};
|
|
173
|
+
/** Confidence falls to zero this far outside a target's tolerance band. */
|
|
174
|
+
declare const MATCH_FALLOFF = 0.25;
|
|
175
|
+
type XrHandPoseMatch = {
|
|
176
|
+
/** Every constraint inside its tolerance. */
|
|
177
|
+
matched: boolean;
|
|
178
|
+
/** 0..1. Degrades smoothly outside tolerance, for live editor feedback. */
|
|
179
|
+
confidence: number;
|
|
180
|
+
/** The constraint furthest out of range — what to show the user when it fails. */
|
|
181
|
+
worstConstraint: string | null;
|
|
182
|
+
};
|
|
183
|
+
/** Extra world context needed only by head-relative orientation conditions. */
|
|
184
|
+
type XrHandPoseContext = {
|
|
185
|
+
headPosition?: THREE.Vector3;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Score a live hand against a pose.
|
|
189
|
+
*
|
|
190
|
+
* Confidence is the MINIMUM across constraints, not the average — a soft AND.
|
|
191
|
+
* Averaging lets three perfect fingers outvote one badly wrong one, which is how
|
|
192
|
+
* a fist ends up firing as a thumbs-up.
|
|
193
|
+
*/
|
|
194
|
+
declare function matchHandPose(shape: XrHandShape, definition: XrHandPoseDefinition, context?: XrHandPoseContext): XrHandPoseMatch;
|
|
195
|
+
type XrHandPoseEvent = "start" | "end" | null;
|
|
196
|
+
type HandPoseTrackerOptions = {
|
|
197
|
+
/** Confidence needed to begin holding. */
|
|
198
|
+
enterConfidence?: number;
|
|
199
|
+
/** Confidence below which an active pose ends. Must be < enter. */
|
|
200
|
+
exitConfidence?: number;
|
|
201
|
+
/** Seconds the pose must be held before it fires. */
|
|
202
|
+
minHoldSeconds?: number;
|
|
203
|
+
/** Grace period before tracking loss ends an active pose. */
|
|
204
|
+
lostGraceSeconds?: number;
|
|
205
|
+
};
|
|
206
|
+
declare const DEFAULT_ENTER_CONFIDENCE = 0.8;
|
|
207
|
+
declare const DEFAULT_EXIT_CONFIDENCE = 0.55;
|
|
208
|
+
declare const DEFAULT_MIN_HOLD_SECONDS = 0.15;
|
|
209
|
+
declare const DEFAULT_LOST_GRACE_SECONDS = 0.25;
|
|
210
|
+
/**
|
|
211
|
+
* Turns a stream of per-frame confidences into clean start/end events.
|
|
212
|
+
*
|
|
213
|
+
* Two mechanisms, both necessary:
|
|
214
|
+
*
|
|
215
|
+
* - HYSTERESIS. A single threshold makes confidence hovering at the boundary
|
|
216
|
+
* emit start/end at frame rate. Entering high and exiting low kills that.
|
|
217
|
+
* - HOLD TIME. Fingers pass through many shapes on the way to the intended one;
|
|
218
|
+
* without a hold requirement a fist fires "point" en route.
|
|
219
|
+
*
|
|
220
|
+
* Tracking loss gets a grace period rather than ending immediately, because
|
|
221
|
+
* hands drop out for a frame or two constantly at the edge of the camera FOV.
|
|
222
|
+
*/
|
|
223
|
+
declare class HandPoseTracker {
|
|
224
|
+
private readonly enterConfidence;
|
|
225
|
+
private readonly exitConfidence;
|
|
226
|
+
private readonly minHoldSeconds;
|
|
227
|
+
private readonly lostGraceSeconds;
|
|
228
|
+
private active;
|
|
229
|
+
private holdingSince;
|
|
230
|
+
private lostSince;
|
|
231
|
+
constructor(options?: HandPoseTrackerOptions);
|
|
232
|
+
isActive(): boolean;
|
|
233
|
+
/** Feed this frame's confidence. Returns an event on a transition. */
|
|
234
|
+
update(confidence: number, now: number): XrHandPoseEvent;
|
|
235
|
+
/** Feed a frame where the hand isn't tracked at all. */
|
|
236
|
+
miss(now: number): XrHandPoseEvent;
|
|
237
|
+
reset(): void;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export { CURLED_COS as C, DEFAULT_ENTER_CONFIDENCE as D, FALLBACK_HAND_SCALE as F, HandPoseTracker as H, MATCH_FALLOFF as M, PINCH_FINGERS as P, STRAIGHT_COS as S, type XrHandPoseDefinition as X, type XrFinger as a, type XrHandPoseOrientation as b, DEFAULT_EXIT_CONFIDENCE as c, DEFAULT_LOST_GRACE_SECONDS as d, DEFAULT_MIN_HOLD_SECONDS as e, type HandPoseTrackerOptions as f, XR_FINGERS as g, type XrFingerCurl as h, type XrFingerTarget as i, type XrHandJointName as j, type XrHandJoints as k, type XrHandPoseAxis as l, type XrHandPoseContext as m, type XrHandPoseDirection as n, type XrHandPoseEvent as o, type XrHandPoseMatch as p, type XrHandShape as q, type XrPalmPose as r, computeFingerCurl as s, computeHandShape as t, computePalmPose as u, computePalmWidth as v, computePinch as w, computeSpread as x, estimateHandScale as y, matchHandPose as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind,
|
|
2
|
-
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-
|
|
1
|
+
import { A as AnimationComponent, a as AnimationComponentOptions, b as AudioComponent, C as CameraComponent, c as CameraComponentOptions, d as CameraProjection, e as CameraRuntimeType, f as ColliderShape, g as ColliderState, h as CubeMeshParameters, D as DEFAULT_COLLIDER_STATE, i as DEFAULT_INSTANCED_MESH_PARAMETERS, j as DEFAULT_INSTANCE_TRANSFORM, k as DEFAULT_MESH_GEOMETRY_PARAMETERS, l as DEFAULT_PHYSICS_STATE, m as DEFAULT_POSE_CURLS, n as DEFAULT_RIGIDBODY_STATE, E as EditableMeshObjectKind, o as EntityType, I as ImageComponent, p as ImageTarget, q as ImageTargetAnchor, r as ImageTargetAnchorOptions, s as ImageTargetReference, t as InstanceSlotComponent, u as InstanceTransform, v as InstancedMeshComponent, w as InstancedMeshKind, L as LightComponent, x as LightValueState, M as MaterialComponent, y as MaterialTypeValue, z as MaterialValueState, B as MeshComponent, F as MeshGeometryComponent, G as MeshGeometryParameters, H as MeshGeometryParametersByKind, J as ModelComponent, N as Name, O as Object3DRef, P as PhysicsComponent, K as PhysicsState, Q as PlaneMeshParameters, R as RadiusHeightMeshParameters, S as RadiusMeshParameters, T as RigidbodyState, U as RigidbodyType, V as ScriptComponent, W as ScriptEntry, X as ScriptObjectComponent, Y as ScriptObjectComponentInput, Z as ScriptObjectRuntimeState, _ as Selectable, $ as SelectionTransformState, a0 as SpriteComponent, a1 as TextureFilteringValue, a2 as TransformModeValue, a3 as TransformSpaceValue, a4 as VRTeleportAreaComponent, a5 as VRTeleportAreaOptions, a6 as VideoComponent, a7 as VrTeleportShape, a8 as XRHandPoseComponent, a9 as XRHandPoseOptions, aa as XRInteractableComponent, ab as XRInteractableOptions, ac as XRInteractorComponent, ad as XRInteractorOptions, ae as XRInteractorSideComponent, af as XRRigComponent, ag as XRRigOptions, ah as XrGrabMode, ai as XrHandPoseEntry, aj as XrHandPreset, ak as XrInteractorSide, al as XrInteractorType, am as XrLocomotionMode, an as XrTrackingOrigin, ao as createHandPoseEntry, ap as defaultMaterialValue, aq as handPoseDefinitionFor, ar as normalizePhysicsState, as as setPhysicsLiveRef } from './XRHandPose-VuSbe4iz.cjs';
|
|
2
|
+
import { C as Component, D as DEFAULT_ENVIRONMENT_STATE, a as DEFAULT_POSTPROCESSING_STATE, E as Environment, b as EnvironmentFogState, c as EnvironmentFogType, d as EnvironmentGradientEffect, e as EnvironmentSkyboxState, f as EnvironmentSkyboxType, g as EnvironmentState, P as ParentId, h as Postprocessing, i as PostprocessingState, T as TransformComponent, j as TransformData, V as Vec3 } from './System-31wk-A0g.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Marks the ROOT entity of a prefab instance and records its link to the
|
|
@@ -84,6 +84,7 @@ declare const index_DEFAULT_INSTANCED_MESH_PARAMETERS: typeof DEFAULT_INSTANCED_
|
|
|
84
84
|
declare const index_DEFAULT_INSTANCE_TRANSFORM: typeof DEFAULT_INSTANCE_TRANSFORM;
|
|
85
85
|
declare const index_DEFAULT_MESH_GEOMETRY_PARAMETERS: typeof DEFAULT_MESH_GEOMETRY_PARAMETERS;
|
|
86
86
|
declare const index_DEFAULT_PHYSICS_STATE: typeof DEFAULT_PHYSICS_STATE;
|
|
87
|
+
declare const index_DEFAULT_POSE_CURLS: typeof DEFAULT_POSE_CURLS;
|
|
87
88
|
declare const index_DEFAULT_POSTPROCESSING_STATE: typeof DEFAULT_POSTPROCESSING_STATE;
|
|
88
89
|
declare const index_DEFAULT_RIGIDBODY_STATE: typeof DEFAULT_RIGIDBODY_STATE;
|
|
89
90
|
declare const index_EditableMeshObjectKind: typeof EditableMeshObjectKind;
|
|
@@ -148,6 +149,8 @@ declare const index_VRTeleportAreaOptions: typeof VRTeleportAreaOptions;
|
|
|
148
149
|
declare const index_Vec3: typeof Vec3;
|
|
149
150
|
declare const index_VideoComponent: typeof VideoComponent;
|
|
150
151
|
declare const index_VrTeleportShape: typeof VrTeleportShape;
|
|
152
|
+
declare const index_XRHandPoseComponent: typeof XRHandPoseComponent;
|
|
153
|
+
declare const index_XRHandPoseOptions: typeof XRHandPoseOptions;
|
|
151
154
|
declare const index_XRInteractableComponent: typeof XRInteractableComponent;
|
|
152
155
|
declare const index_XRInteractableOptions: typeof XRInteractableOptions;
|
|
153
156
|
declare const index_XRInteractorComponent: typeof XRInteractorComponent;
|
|
@@ -156,16 +159,19 @@ declare const index_XRInteractorSideComponent: typeof XRInteractorSideComponent;
|
|
|
156
159
|
declare const index_XRRigComponent: typeof XRRigComponent;
|
|
157
160
|
declare const index_XRRigOptions: typeof XRRigOptions;
|
|
158
161
|
declare const index_XrGrabMode: typeof XrGrabMode;
|
|
162
|
+
declare const index_XrHandPoseEntry: typeof XrHandPoseEntry;
|
|
159
163
|
declare const index_XrHandPreset: typeof XrHandPreset;
|
|
160
164
|
declare const index_XrInteractorSide: typeof XrInteractorSide;
|
|
161
165
|
declare const index_XrInteractorType: typeof XrInteractorType;
|
|
162
166
|
declare const index_XrLocomotionMode: typeof XrLocomotionMode;
|
|
163
167
|
declare const index_XrTrackingOrigin: typeof XrTrackingOrigin;
|
|
168
|
+
declare const index_createHandPoseEntry: typeof createHandPoseEntry;
|
|
164
169
|
declare const index_defaultMaterialValue: typeof defaultMaterialValue;
|
|
170
|
+
declare const index_handPoseDefinitionFor: typeof handPoseDefinitionFor;
|
|
165
171
|
declare const index_normalizePhysicsState: typeof normalizePhysicsState;
|
|
166
172
|
declare const index_setPhysicsLiveRef: typeof setPhysicsLiveRef;
|
|
167
173
|
declare namespace index {
|
|
168
|
-
export { index_AnimationComponent as AnimationComponent, index_AnimationComponentOptions as AnimationComponentOptions, index_AudioComponent as AudioComponent, index_CameraComponent as CameraComponent, index_CameraComponentOptions as CameraComponentOptions, index_CameraProjection as CameraProjection, index_CameraRuntimeType as CameraRuntimeType, index_ColliderShape as ColliderShape, index_ColliderState as ColliderState, index_CubeMeshParameters as CubeMeshParameters, index_DEFAULT_COLLIDER_STATE as DEFAULT_COLLIDER_STATE, index_DEFAULT_ENVIRONMENT_STATE as DEFAULT_ENVIRONMENT_STATE, index_DEFAULT_INSTANCED_MESH_PARAMETERS as DEFAULT_INSTANCED_MESH_PARAMETERS, index_DEFAULT_INSTANCE_TRANSFORM as DEFAULT_INSTANCE_TRANSFORM, index_DEFAULT_MESH_GEOMETRY_PARAMETERS as DEFAULT_MESH_GEOMETRY_PARAMETERS, index_DEFAULT_PHYSICS_STATE as DEFAULT_PHYSICS_STATE, index_DEFAULT_POSTPROCESSING_STATE as DEFAULT_POSTPROCESSING_STATE, index_DEFAULT_RIGIDBODY_STATE as DEFAULT_RIGIDBODY_STATE, index_EditableMeshObjectKind as EditableMeshObjectKind, index_EntityType as EntityType, index_Environment as Environment, index_EnvironmentFogState as EnvironmentFogState, index_EnvironmentFogType as EnvironmentFogType, index_EnvironmentGradientEffect as EnvironmentGradientEffect, index_EnvironmentSkyboxState as EnvironmentSkyboxState, index_EnvironmentSkyboxType as EnvironmentSkyboxType, index_EnvironmentState as EnvironmentState, index_ImageComponent as ImageComponent, index_ImageTarget as ImageTarget, index_ImageTargetAnchor as ImageTargetAnchor, index_ImageTargetAnchorOptions as ImageTargetAnchorOptions, index_ImageTargetReference as ImageTargetReference, index_InstanceSlotComponent as InstanceSlotComponent, index_InstanceTransform as InstanceTransform, index_InstancedMeshComponent as InstancedMeshComponent, index_InstancedMeshKind as InstancedMeshKind, index_LightComponent as LightComponent, index_LightValueState as LightValueState, index_MaterialComponent as MaterialComponent, index_MaterialTypeValue as MaterialTypeValue, index_MaterialValueState as MaterialValueState, index_MeshComponent as MeshComponent, index_MeshGeometryComponent as MeshGeometryComponent, index_MeshGeometryParameters as MeshGeometryParameters, index_MeshGeometryParametersByKind as MeshGeometryParametersByKind, index_ModelComponent as ModelComponent, index_Name as Name, index_Object3DRef as Object3DRef, index_ParentId as ParentId, index_PhysicsComponent as PhysicsComponent, index_PhysicsState as PhysicsState, index_PlaneMeshParameters as PlaneMeshParameters, index_Postprocessing as Postprocessing, index_PostprocessingState as PostprocessingState, index_PrefabInstance as PrefabInstance, index_PrefabNode as PrefabNode, index_RadiusHeightMeshParameters as RadiusHeightMeshParameters, index_RadiusMeshParameters as RadiusMeshParameters, index_RigidbodyState as RigidbodyState, index_RigidbodyType as RigidbodyType, index_ScriptComponent as ScriptComponent, index_ScriptEntry as ScriptEntry, index_ScriptObjectComponent as ScriptObjectComponent, index_ScriptObjectComponentInput as ScriptObjectComponentInput, index_ScriptObjectRuntimeState as ScriptObjectRuntimeState, index_Selectable as Selectable, index_SelectionTransformState as SelectionTransformState, index_SpriteComponent as SpriteComponent, index_TextureFilteringValue as TextureFilteringValue, index_TransformComponent as TransformComponent, index_TransformData as TransformData, index_TransformModeValue as TransformModeValue, index_TransformSpaceValue as TransformSpaceValue, index_VRTeleportAreaComponent as VRTeleportAreaComponent, index_VRTeleportAreaOptions as VRTeleportAreaOptions, index_Vec3 as Vec3, index_VideoComponent as VideoComponent, index_VrTeleportShape as VrTeleportShape, index_XRInteractableComponent as XRInteractableComponent, index_XRInteractableOptions as XRInteractableOptions, index_XRInteractorComponent as XRInteractorComponent, index_XRInteractorOptions as XRInteractorOptions, index_XRInteractorSideComponent as XRInteractorSideComponent, index_XRRigComponent as XRRigComponent, index_XRRigOptions as XRRigOptions, index_XrGrabMode as XrGrabMode, index_XrHandPreset as XrHandPreset, index_XrInteractorSide as XrInteractorSide, index_XrInteractorType as XrInteractorType, index_XrLocomotionMode as XrLocomotionMode, index_XrTrackingOrigin as XrTrackingOrigin, index_defaultMaterialValue as defaultMaterialValue, index_normalizePhysicsState as normalizePhysicsState, index_setPhysicsLiveRef as setPhysicsLiveRef };
|
|
174
|
+
export { index_AnimationComponent as AnimationComponent, index_AnimationComponentOptions as AnimationComponentOptions, index_AudioComponent as AudioComponent, index_CameraComponent as CameraComponent, index_CameraComponentOptions as CameraComponentOptions, index_CameraProjection as CameraProjection, index_CameraRuntimeType as CameraRuntimeType, index_ColliderShape as ColliderShape, index_ColliderState as ColliderState, index_CubeMeshParameters as CubeMeshParameters, index_DEFAULT_COLLIDER_STATE as DEFAULT_COLLIDER_STATE, index_DEFAULT_ENVIRONMENT_STATE as DEFAULT_ENVIRONMENT_STATE, index_DEFAULT_INSTANCED_MESH_PARAMETERS as DEFAULT_INSTANCED_MESH_PARAMETERS, index_DEFAULT_INSTANCE_TRANSFORM as DEFAULT_INSTANCE_TRANSFORM, index_DEFAULT_MESH_GEOMETRY_PARAMETERS as DEFAULT_MESH_GEOMETRY_PARAMETERS, index_DEFAULT_PHYSICS_STATE as DEFAULT_PHYSICS_STATE, index_DEFAULT_POSE_CURLS as DEFAULT_POSE_CURLS, index_DEFAULT_POSTPROCESSING_STATE as DEFAULT_POSTPROCESSING_STATE, index_DEFAULT_RIGIDBODY_STATE as DEFAULT_RIGIDBODY_STATE, index_EditableMeshObjectKind as EditableMeshObjectKind, index_EntityType as EntityType, index_Environment as Environment, index_EnvironmentFogState as EnvironmentFogState, index_EnvironmentFogType as EnvironmentFogType, index_EnvironmentGradientEffect as EnvironmentGradientEffect, index_EnvironmentSkyboxState as EnvironmentSkyboxState, index_EnvironmentSkyboxType as EnvironmentSkyboxType, index_EnvironmentState as EnvironmentState, index_ImageComponent as ImageComponent, index_ImageTarget as ImageTarget, index_ImageTargetAnchor as ImageTargetAnchor, index_ImageTargetAnchorOptions as ImageTargetAnchorOptions, index_ImageTargetReference as ImageTargetReference, index_InstanceSlotComponent as InstanceSlotComponent, index_InstanceTransform as InstanceTransform, index_InstancedMeshComponent as InstancedMeshComponent, index_InstancedMeshKind as InstancedMeshKind, index_LightComponent as LightComponent, index_LightValueState as LightValueState, index_MaterialComponent as MaterialComponent, index_MaterialTypeValue as MaterialTypeValue, index_MaterialValueState as MaterialValueState, index_MeshComponent as MeshComponent, index_MeshGeometryComponent as MeshGeometryComponent, index_MeshGeometryParameters as MeshGeometryParameters, index_MeshGeometryParametersByKind as MeshGeometryParametersByKind, index_ModelComponent as ModelComponent, index_Name as Name, index_Object3DRef as Object3DRef, index_ParentId as ParentId, index_PhysicsComponent as PhysicsComponent, index_PhysicsState as PhysicsState, index_PlaneMeshParameters as PlaneMeshParameters, index_Postprocessing as Postprocessing, index_PostprocessingState as PostprocessingState, index_PrefabInstance as PrefabInstance, index_PrefabNode as PrefabNode, index_RadiusHeightMeshParameters as RadiusHeightMeshParameters, index_RadiusMeshParameters as RadiusMeshParameters, index_RigidbodyState as RigidbodyState, index_RigidbodyType as RigidbodyType, index_ScriptComponent as ScriptComponent, index_ScriptEntry as ScriptEntry, index_ScriptObjectComponent as ScriptObjectComponent, index_ScriptObjectComponentInput as ScriptObjectComponentInput, index_ScriptObjectRuntimeState as ScriptObjectRuntimeState, index_Selectable as Selectable, index_SelectionTransformState as SelectionTransformState, index_SpriteComponent as SpriteComponent, index_TextureFilteringValue as TextureFilteringValue, index_TransformComponent as TransformComponent, index_TransformData as TransformData, index_TransformModeValue as TransformModeValue, index_TransformSpaceValue as TransformSpaceValue, index_VRTeleportAreaComponent as VRTeleportAreaComponent, index_VRTeleportAreaOptions as VRTeleportAreaOptions, index_Vec3 as Vec3, index_VideoComponent as VideoComponent, index_VrTeleportShape as VrTeleportShape, index_XRHandPoseComponent as XRHandPoseComponent, index_XRHandPoseOptions as XRHandPoseOptions, index_XRInteractableComponent as XRInteractableComponent, index_XRInteractableOptions as XRInteractableOptions, index_XRInteractorComponent as XRInteractorComponent, index_XRInteractorOptions as XRInteractorOptions, index_XRInteractorSideComponent as XRInteractorSideComponent, index_XRRigComponent as XRRigComponent, index_XRRigOptions as XRRigOptions, index_XrGrabMode as XrGrabMode, index_XrHandPoseEntry as XrHandPoseEntry, index_XrHandPreset as XrHandPreset, index_XrInteractorSide as XrInteractorSide, index_XrInteractorType as XrInteractorType, index_XrLocomotionMode as XrLocomotionMode, index_XrTrackingOrigin as XrTrackingOrigin, index_createHandPoseEntry as createHandPoseEntry, index_defaultMaterialValue as defaultMaterialValue, index_handPoseDefinitionFor as handPoseDefinitionFor, index_normalizePhysicsState as normalizePhysicsState, index_setPhysicsLiveRef as setPhysicsLiveRef };
|
|
169
175
|
}
|
|
170
176
|
|
|
171
177
|
export { PrefabInstance as P, PrefabNode as a, index as i };
|