@opsydyn/effect-three 0.0.0-stage → 0.1.0
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/CHANGELOG.md +58 -0
- package/LICENSE +21 -0
- package/README.md +191 -2
- package/dist/index-4045wme0.js +129 -0
- package/dist/index-4045wme0.js.map +10 -0
- package/dist/index-ef8pbv9g.js +5118 -0
- package/dist/index-ef8pbv9g.js.map +40 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1361 -0
- package/dist/index.js.map +14 -0
- package/dist/kernel/animation.d.ts +14 -0
- package/dist/kernel/animation.d.ts.map +1 -0
- package/dist/kernel/behaviours.d.ts +16 -0
- package/dist/kernel/behaviours.d.ts.map +1 -0
- package/dist/kernel/bodies.d.ts +60 -0
- package/dist/kernel/bodies.d.ts.map +1 -0
- package/dist/kernel/bodySources.d.ts +47 -0
- package/dist/kernel/bodySources.d.ts.map +1 -0
- package/dist/kernel/build.d.ts +564 -0
- package/dist/kernel/build.d.ts.map +1 -0
- package/dist/kernel/cameraMotion.d.ts +39 -0
- package/dist/kernel/cameraMotion.d.ts.map +1 -0
- package/dist/kernel/clock.d.ts +17 -0
- package/dist/kernel/clock.d.ts.map +1 -0
- package/dist/kernel/contactShadowPasses.d.ts +47 -0
- package/dist/kernel/contactShadowPasses.d.ts.map +1 -0
- package/dist/kernel/description.d.ts +1120 -0
- package/dist/kernel/description.d.ts.map +1 -0
- package/dist/kernel/diff.d.ts +90 -0
- package/dist/kernel/diff.d.ts.map +1 -0
- package/dist/kernel/environmentPresets.d.ts +30 -0
- package/dist/kernel/environmentPresets.d.ts.map +1 -0
- package/dist/kernel/equality.d.ts +64 -0
- package/dist/kernel/equality.d.ts.map +1 -0
- package/dist/kernel/frames.d.ts +55 -0
- package/dist/kernel/frames.d.ts.map +1 -0
- package/dist/kernel/index.d.ts +37 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +335 -0
- package/dist/kernel/index.js.map +9 -0
- package/dist/kernel/instances.d.ts +26 -0
- package/dist/kernel/instances.d.ts.map +1 -0
- package/dist/kernel/labels.d.ts +45 -0
- package/dist/kernel/labels.d.ts.map +1 -0
- package/dist/kernel/loop.d.ts +49 -0
- package/dist/kernel/loop.d.ts.map +1 -0
- package/dist/kernel/materials.d.ts +24 -0
- package/dist/kernel/materials.d.ts.map +1 -0
- package/dist/kernel/motion.d.ts +36 -0
- package/dist/kernel/motion.d.ts.map +1 -0
- package/dist/kernel/orbit.d.ts +127 -0
- package/dist/kernel/orbit.d.ts.map +1 -0
- package/dist/kernel/overlays.d.ts +16 -0
- package/dist/kernel/overlays.d.ts.map +1 -0
- package/dist/kernel/performance.d.ts +41 -0
- package/dist/kernel/performance.d.ts.map +1 -0
- package/dist/kernel/physics.d.ts +166 -0
- package/dist/kernel/physics.d.ts.map +1 -0
- package/dist/kernel/physicsDebug.d.ts +18 -0
- package/dist/kernel/physicsDebug.d.ts.map +1 -0
- package/dist/kernel/pointer.d.ts +357 -0
- package/dist/kernel/pointer.d.ts.map +1 -0
- package/dist/kernel/renderKit.d.ts +48 -0
- package/dist/kernel/renderKit.d.ts.map +1 -0
- package/dist/kernel/renderer.d.ts +83 -0
- package/dist/kernel/renderer.d.ts.map +1 -0
- package/dist/kernel/resources.d.ts +112 -0
- package/dist/kernel/resources.d.ts.map +1 -0
- package/dist/kernel/sceneGraph.d.ts +155 -0
- package/dist/kernel/sceneGraph.d.ts.map +1 -0
- package/dist/kernel/sceneIndex.d.ts +90 -0
- package/dist/kernel/sceneIndex.d.ts.map +1 -0
- package/dist/kernel/stage.d.ts +87 -0
- package/dist/kernel/stage.d.ts.map +1 -0
- package/dist/kernel/textLayout.d.ts +29 -0
- package/dist/kernel/textLayout.d.ts.map +1 -0
- package/dist/kernel/tween.d.ts +35 -0
- package/dist/kernel/tween.d.ts.map +1 -0
- package/dist/kernel/xrInput.d.ts +107 -0
- package/dist/kernel/xrInput.d.ts.map +1 -0
- package/dist/kernel/xrLocomotion.d.ts +38 -0
- package/dist/kernel/xrLocomotion.d.ts.map +1 -0
- package/dist/runtime/FrameSource.d.ts +29 -0
- package/dist/runtime/FrameSource.d.ts.map +1 -0
- package/dist/runtime/ResourceRegistry.d.ts +18 -0
- package/dist/runtime/ResourceRegistry.d.ts.map +1 -0
- package/dist/runtime/SceneRuntime.d.ts +68 -0
- package/dist/runtime/SceneRuntime.d.ts.map +1 -0
- package/dist/runtime/SceneSchema.d.ts +2536 -0
- package/dist/runtime/SceneSchema.d.ts.map +1 -0
- package/dist/runtime/errors.d.ts +19 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +11 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/webgl/contactShadows.d.ts +5 -0
- package/dist/webgl/contactShadows.d.ts.map +1 -0
- package/dist/webgl/index.d.ts +11 -0
- package/dist/webgl/index.d.ts.map +1 -0
- package/dist/webgl/index.js +239 -0
- package/dist/webgl/index.js.map +13 -0
- package/dist/webgl/shaderGrid.d.ts +27 -0
- package/dist/webgl/shaderGrid.d.ts.map +1 -0
- package/dist/webgl/sky.d.ts +4 -0
- package/dist/webgl/sky.d.ts.map +1 -0
- package/dist/webgpu/contactShadows.d.ts +5 -0
- package/dist/webgpu/contactShadows.d.ts.map +1 -0
- package/dist/webgpu/index.d.ts +10 -0
- package/dist/webgpu/index.d.ts.map +1 -0
- package/dist/webgpu/index.js +216 -0
- package/dist/webgpu/index.js.map +13 -0
- package/dist/webgpu/shaderGrid.d.ts +5 -0
- package/dist/webgpu/shaderGrid.d.ts.map +1 -0
- package/dist/webgpu/sky.d.ts +4 -0
- package/dist/webgpu/sky.d.ts.map +1 -0
- package/package.json +82 -4
- package/src/index.ts +11 -0
- package/src/kernel/animation.ts +24 -0
- package/src/kernel/behaviours.ts +36 -0
- package/src/kernel/bodies.ts +338 -0
- package/src/kernel/bodySources.ts +203 -0
- package/src/kernel/build.ts +1325 -0
- package/src/kernel/cameraMotion.ts +202 -0
- package/src/kernel/clock.ts +35 -0
- package/src/kernel/contactShadowPasses.ts +207 -0
- package/src/kernel/description.ts +1197 -0
- package/src/kernel/diff.ts +383 -0
- package/src/kernel/environmentPresets.ts +38 -0
- package/src/kernel/equality.ts +604 -0
- package/src/kernel/frames.ts +124 -0
- package/src/kernel/index.ts +274 -0
- package/src/kernel/instances.ts +97 -0
- package/src/kernel/labels.ts +48 -0
- package/src/kernel/loop.ts +248 -0
- package/src/kernel/materials.ts +258 -0
- package/src/kernel/motion.ts +75 -0
- package/src/kernel/orbit.ts +554 -0
- package/src/kernel/overlays.ts +130 -0
- package/src/kernel/performance.ts +101 -0
- package/src/kernel/physics.ts +361 -0
- package/src/kernel/physicsDebug.ts +68 -0
- package/src/kernel/pointer.ts +785 -0
- package/src/kernel/renderKit.ts +53 -0
- package/src/kernel/renderer.ts +136 -0
- package/src/kernel/resources.ts +504 -0
- package/src/kernel/sceneGraph.ts +1440 -0
- package/src/kernel/sceneIndex.ts +219 -0
- package/src/kernel/stage.ts +157 -0
- package/src/kernel/textLayout.ts +102 -0
- package/src/kernel/tween.ts +80 -0
- package/src/kernel/xrInput.ts +230 -0
- package/src/kernel/xrLocomotion.ts +72 -0
- package/src/runtime/FrameSource.ts +41 -0
- package/src/runtime/ResourceRegistry.ts +24 -0
- package/src/runtime/SceneRuntime.ts +229 -0
- package/src/runtime/SceneSchema.ts +983 -0
- package/src/runtime/errors.ts +18 -0
- package/src/runtime/index.ts +10 -0
- package/src/webgl/contactShadows.ts +67 -0
- package/src/webgl/index.ts +19 -0
- package/src/webgl/shaderGrid.ts +196 -0
- package/src/webgl/sky.ts +42 -0
- package/src/webgpu/contactShadows.ts +83 -0
- package/src/webgpu/index.ts +19 -0
- package/src/webgpu/shaderGrid.ts +158 -0
- package/src/webgpu/sky.ts +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orbit.d.ts","sourceRoot":"","sources":["../../src/kernel/orbit.ts"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AG,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAA;CAAE,CAAC;AAiC7D;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,UAClC,CAAC,UACD;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,KAClC,CAA+C,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,WACZ,MAAM,OACT,GAAG,QACF;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,sBAExD,MA6BF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,WACb,MAAM,OACT,GAAG,QACF;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,sBAExD,MAGF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SceneGraph } from './sceneGraph.ts';
|
|
2
|
+
/** Where to show one overlay's HTML, in CSS pixels from the canvas's top left. */
|
|
3
|
+
export type OverlayPlacement = {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
/** 1, or the distance scale when the overlay has a `distanceFactor`. */
|
|
8
|
+
readonly scale: number;
|
|
9
|
+
readonly zIndex: number;
|
|
10
|
+
/** False behind the camera, or behind a mesh when the overlay occludes. */
|
|
11
|
+
readonly visible: boolean;
|
|
12
|
+
readonly center: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Places every overlay of the graph's scene, after its world matrices are current. */
|
|
15
|
+
export declare const placeOverlays: (graph: SceneGraph) => ReadonlyArray<OverlayPlacement>;
|
|
16
|
+
//# sourceMappingURL=overlays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../src/kernel/overlays.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,CAAC;AAyFF,uFAAuF;AACvF,eAAO,MAAM,aAAa,UAAW,UAAU,KAAG,aAAa,CAAC,gBAAgB,CAK/E,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-rate monitoring with a performance factor, after Drei's `PerformanceMonitor`
|
|
3
|
+
* (`drei-main/src/core/PerformanceMonitor.tsx` at `bf6f4ad`): frames are averaged over
|
|
4
|
+
* windows of `ms`; once `iterations` averages are in, the factor steps down when more than
|
|
5
|
+
* `threshold` of them fell below the lower bound, and up when more than `threshold` rose
|
|
6
|
+
* above the upper bound. The application decides what the factor means, typically a
|
|
7
|
+
* render resolution.
|
|
8
|
+
*
|
|
9
|
+
* Two differences from Drei: the factor starts at 1 (draw at full resolution until proven
|
|
10
|
+
* slow), and a gap between frames longer than `idleMs` restarts the window, because an
|
|
11
|
+
* on-demand scene that is asleep is idle, not slow.
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
export type PerformanceOptions = {
|
|
16
|
+
/** Milliseconds per fps average. Default 250. */
|
|
17
|
+
readonly ms?: number;
|
|
18
|
+
/** Averages per decision. Default 10. */
|
|
19
|
+
readonly iterations?: number;
|
|
20
|
+
/** Share of averages that must agree to move the factor. Default 0.75. */
|
|
21
|
+
readonly threshold?: number;
|
|
22
|
+
/** How far one decision moves the factor. Default 0.1. */
|
|
23
|
+
readonly step?: number;
|
|
24
|
+
/** Lower and upper fps bounds for a refresh rate. Default as Drei. */
|
|
25
|
+
readonly bounds?: (refreshRate: number) => readonly [lower: number, upper: number];
|
|
26
|
+
/** A pause between frames longer than this restarts measurement. Default 100. */
|
|
27
|
+
readonly idleMs?: number;
|
|
28
|
+
};
|
|
29
|
+
/** A change of performance factor, with the fps average that caused it. */
|
|
30
|
+
export type PerformanceChange = {
|
|
31
|
+
readonly fps: number;
|
|
32
|
+
readonly factor: number;
|
|
33
|
+
};
|
|
34
|
+
export type PerformanceMonitor = {
|
|
35
|
+
/** Records a frame at `nowMs`; returns a change when the factor moved. */
|
|
36
|
+
readonly sample: (nowMs: number) => PerformanceChange | undefined;
|
|
37
|
+
readonly factor: () => number;
|
|
38
|
+
};
|
|
39
|
+
/** Creates a frame-rate monitor. Allocation-free per frame except when a decision is made. */
|
|
40
|
+
export declare const createPerformanceMonitor: (options?: PerformanceOptions) => PerformanceMonitor;
|
|
41
|
+
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/kernel/performance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACnF,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,iBAAiB,GAAG,SAAS,CAAC;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAC;CAC/B,CAAC;AAKF,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,aAAa,kBAAkB,KAAQ,kBAyD3E,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kernel's side of physics: an engine-neutral world contract, and colliders worked
|
|
3
|
+
* out from geometry. An engine package (Rapier, in `@opsydyn/effect-three-rapier`)
|
|
4
|
+
* implements `PhysicsEngine`; the scene graph steps it and moves meshes to its poses.
|
|
5
|
+
*
|
|
6
|
+
* Behavioural reference: react-three-rapier at `ae5c3fe` (2.2.0):
|
|
7
|
+
* `getColliderArgsFromGeometry` in `src/utils/utils-collider.ts` for colliders (a cuboid
|
|
8
|
+
* from the bounding box, a ball from the bounding sphere, a hull or trimesh from the
|
|
9
|
+
* vertices, each scaled by the mesh's world scale), and the step loop in
|
|
10
|
+
* `src/components/Physics.tsx` (fixed steps, delta clamped to 0.5 s, poses interpolated
|
|
11
|
+
* between the last two steps).
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import { type BufferGeometry, type Object3D, Vector3 } from 'three';
|
|
16
|
+
import type { Body, BodyCollider, ColliderDescription, InteractionGroups, JointKind, Physics, Vec3 } from './description.ts';
|
|
17
|
+
/** A quaternion, `[x, y, z, w]`. */
|
|
18
|
+
export type Quat = readonly [x: number, y: number, z: number, w: number];
|
|
19
|
+
/** Where a body is, in world space. */
|
|
20
|
+
export type BodyPose = {
|
|
21
|
+
readonly position: Vec3;
|
|
22
|
+
readonly quaternion: Quat;
|
|
23
|
+
};
|
|
24
|
+
/** A collider's shape, scaled as its mesh is, centred on its own origin. */
|
|
25
|
+
export type ColliderShape = {
|
|
26
|
+
readonly _tag: 'Cuboid';
|
|
27
|
+
readonly halfExtents: Vec3;
|
|
28
|
+
} | {
|
|
29
|
+
readonly _tag: 'Ball';
|
|
30
|
+
readonly radius: number;
|
|
31
|
+
} | {
|
|
32
|
+
readonly _tag: 'Hull';
|
|
33
|
+
readonly points: Float32Array;
|
|
34
|
+
}
|
|
35
|
+
/** Along y: a cylinder `halfHeight` each way, capped by `radius` (Rapier's capsule). */
|
|
36
|
+
| {
|
|
37
|
+
readonly _tag: 'Capsule';
|
|
38
|
+
readonly halfHeight: number;
|
|
39
|
+
readonly radius: number;
|
|
40
|
+
} | {
|
|
41
|
+
readonly _tag: 'Cylinder';
|
|
42
|
+
readonly halfHeight: number;
|
|
43
|
+
readonly radius: number;
|
|
44
|
+
} | {
|
|
45
|
+
readonly _tag: 'Cone';
|
|
46
|
+
readonly halfHeight: number;
|
|
47
|
+
readonly radius: number;
|
|
48
|
+
} | {
|
|
49
|
+
readonly _tag: 'Trimesh';
|
|
50
|
+
readonly vertices: Float32Array;
|
|
51
|
+
readonly indices: Uint32Array;
|
|
52
|
+
};
|
|
53
|
+
/** A collider placed in its body's space: one per mesh in the body. */
|
|
54
|
+
export type Collider = {
|
|
55
|
+
readonly shape: ColliderShape;
|
|
56
|
+
readonly translation: Vec3;
|
|
57
|
+
readonly rotation: Quat;
|
|
58
|
+
/** The part of its body it is, for collisions to name: a mesh's or collider's name. */
|
|
59
|
+
readonly part?: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Two bodies began (`started`) or stopped touching, by the ids they were added with: a
|
|
63
|
+
* node's key, or for an instance the node's and instance's keys joined by a NUL.
|
|
64
|
+
*/
|
|
65
|
+
export type Collision = {
|
|
66
|
+
readonly a: string;
|
|
67
|
+
readonly b: string;
|
|
68
|
+
/** The colliders' parts, when they have names. */
|
|
69
|
+
readonly aPart?: string;
|
|
70
|
+
readonly bPart?: string;
|
|
71
|
+
readonly started: boolean;
|
|
72
|
+
};
|
|
73
|
+
/** A joint as an engine makes it: a fixed joint's frames as quaternions. */
|
|
74
|
+
export type PhysicsJoint = {
|
|
75
|
+
readonly anchorA: Vec3;
|
|
76
|
+
readonly anchorB: Vec3;
|
|
77
|
+
readonly contacts: boolean;
|
|
78
|
+
readonly kind: Exclude<JointKind, {
|
|
79
|
+
readonly _tag: 'Fixed';
|
|
80
|
+
}> | {
|
|
81
|
+
readonly _tag: 'Fixed';
|
|
82
|
+
readonly frameA: Quat;
|
|
83
|
+
readonly frameB: Quat;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Groups as Rapier packs them (react-three-rapier's `interactionGroups`): memberships in
|
|
88
|
+
* the high 16 bits, filters in the low 16 (all when `null`). `null` groups are all-all.
|
|
89
|
+
*/
|
|
90
|
+
export declare const interactionBits: (groups: InteractionGroups | null) => number;
|
|
91
|
+
/**
|
|
92
|
+
* Two bodies pushing on each other harder than a body's `contactForces` threshold in one
|
|
93
|
+
* step, by the ids they were added with: Rapier's contact force event.
|
|
94
|
+
*/
|
|
95
|
+
export type ContactForce = {
|
|
96
|
+
readonly a: string;
|
|
97
|
+
readonly b: string;
|
|
98
|
+
readonly aPart?: string;
|
|
99
|
+
readonly bPart?: string;
|
|
100
|
+
readonly totalForce: Vec3;
|
|
101
|
+
readonly totalForceMagnitude: number;
|
|
102
|
+
readonly maxForceDirection: Vec3;
|
|
103
|
+
readonly maxForceMagnitude: number;
|
|
104
|
+
};
|
|
105
|
+
/** Lines drawing a world's colliders and joints: segment ends, and RGBA per end. */
|
|
106
|
+
export type DebugLines = {
|
|
107
|
+
readonly vertices: Float32Array;
|
|
108
|
+
readonly colors: Float32Array;
|
|
109
|
+
};
|
|
110
|
+
/** One physics world, its bodies keyed by id. Every method is synchronous. */
|
|
111
|
+
export type PhysicsWorld = {
|
|
112
|
+
readonly configure: (physics: Physics) => void;
|
|
113
|
+
/** Adds a body with its colliders (none, for a model not yet loaded). */
|
|
114
|
+
readonly add: (key: string, body: Body, colliders: ReadonlyArray<Collider>, pose: BodyPose) => void;
|
|
115
|
+
/** Applies a body's settings that need no new collider: type, mass, friction and so on. */
|
|
116
|
+
readonly update: (key: string, body: Body) => void;
|
|
117
|
+
/** Puts a body at `pose`, at rest. */
|
|
118
|
+
readonly teleport: (key: string, pose: BodyPose) => void;
|
|
119
|
+
/** Where a kinematic body is to be after the next step. */
|
|
120
|
+
readonly moveKinematic: (key: string, pose: BodyPose) => void;
|
|
121
|
+
readonly applyImpulse: (key: string, impulse: Vec3) => void;
|
|
122
|
+
/** Removes a body, and any joint holding it. */
|
|
123
|
+
readonly remove: (key: string) => void;
|
|
124
|
+
/** Joins bodies `a` and `b` (both added). */
|
|
125
|
+
readonly addJoint: (id: string, joint: PhysicsJoint, a: string, b: string) => void;
|
|
126
|
+
/** Removes a joint; nothing if it is gone already (with one of its bodies). */
|
|
127
|
+
readonly removeJoint: (id: string) => void;
|
|
128
|
+
/** Advances by `seconds` and returns the collisions that began or ended. */
|
|
129
|
+
readonly step: (seconds: number) => ReadonlyArray<Collision>;
|
|
130
|
+
/** Contact forces over their bodies' thresholds in the steps since the last call. */
|
|
131
|
+
readonly contactForces: () => ReadonlyArray<ContactForce>;
|
|
132
|
+
/** The world as lines, for `physics({ debug: true })`. */
|
|
133
|
+
readonly debugLines: () => DebugLines;
|
|
134
|
+
readonly pose: (key: string) => BodyPose | undefined;
|
|
135
|
+
/** Whether any dynamic body is still moving (not asleep). */
|
|
136
|
+
readonly awake: () => boolean;
|
|
137
|
+
readonly dispose: () => void;
|
|
138
|
+
};
|
|
139
|
+
/** Makes physics worlds. Provide one to the scene graph (in Foldkit, the environment). */
|
|
140
|
+
export type PhysicsEngine = {
|
|
141
|
+
readonly createWorld: (physics: Physics) => PhysicsWorld;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* The collider for one geometry at world `scale`, centred where its geometry is: what a
|
|
145
|
+
* mesh with a body of its own gets.
|
|
146
|
+
*/
|
|
147
|
+
export declare const colliderFor: (geometry: BufferGeometry, collider: BodyCollider, scale: Vector3) => Collider;
|
|
148
|
+
/**
|
|
149
|
+
* A body's own colliders at its world `scale`: each shape scaled, its position too. Unlike
|
|
150
|
+
* react-three-rapier's `scaleColliderArgs`, which scales arguments by position (x, y, z,
|
|
151
|
+
* x, x), each length scales along its own axis.
|
|
152
|
+
*/
|
|
153
|
+
export declare const describedColliders: (colliders: ReadonlyArray<ColliderDescription>, scale: Vector3) => ReadonlyArray<Collider>;
|
|
154
|
+
/**
|
|
155
|
+
* A collider for every visible mesh in `body` (itself included), placed by its transform
|
|
156
|
+
* relative to the body and sized by its world scale, as react-three-rapier's
|
|
157
|
+
* `createColliderPropsFromChildren` makes a group's or a model's colliders. Unlike there,
|
|
158
|
+
* a geometry's off-centre middle is turned with its mesh.
|
|
159
|
+
*/
|
|
160
|
+
export declare const collidersFor: (body: Object3D, collider: BodyCollider) => ReadonlyArray<Collider>;
|
|
161
|
+
/**
|
|
162
|
+
* What a body's colliders are made from: each visible mesh's geometry and placement.
|
|
163
|
+
* When it changes, the colliders must be made again.
|
|
164
|
+
*/
|
|
165
|
+
export declare const colliderSignature: (body: Object3D) => string;
|
|
166
|
+
//# sourceMappingURL=physics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physics.d.ts","sourceRoot":"","sources":["../../src/kernel/physics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,KAAK,cA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ACtC,OAAO,KACb,aAAa,CAAC,QAAQ,CAAoE,CAAC;AA+D9F;;;;;GAKG;AACH,eAAO,MAAM,YAAY,SAAU,QAAQ,YAAY,YAAY,KAAG,aAAa,CAAC,QAAQ,CAI3F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAU,QAAQ,KAAG,MAIlD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The physics world drawn as lines, as react-three-rapier's `Debug` (`ae5c3fe`,
|
|
3
|
+
* `src/components/Debug.tsx`) draws `world.debugRender()`: one `LineSegments` with
|
|
4
|
+
* per-vertex colours, never culled. Here its buffers are reused while their size holds.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { type Object3D } from 'three';
|
|
9
|
+
import type { DebugLines } from './physics.ts';
|
|
10
|
+
export type PhysicsDebug = {
|
|
11
|
+
/** Shows `lines` (adding the drawing to the scene the first time). */
|
|
12
|
+
readonly show: (lines: DebugLines) => void;
|
|
13
|
+
/** Takes the drawing away and frees it. */
|
|
14
|
+
readonly hide: () => void;
|
|
15
|
+
};
|
|
16
|
+
/** Creates the debug drawing for a scene. */
|
|
17
|
+
export declare const createPhysicsDebug: (scene: Object3D) => PhysicsDebug;
|
|
18
|
+
//# sourceMappingURL=physicsDebug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physicsDebug.d.ts","sourceRoot":"","sources":["../../src/kernel/physicsDebug.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG;IACzB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAkBF,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB,UAAW,QAAQ,KAAG,YA0BpD,CAAC"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import type { Gestures, Vec3 } from './description.ts';
|
|
2
|
+
import type { SceneGraph } from './sceneGraph.ts';
|
|
3
|
+
import type { XrButtonName, XrHand, XrMesh, XrPlane, XrStickDirection } from './xrInput.ts';
|
|
4
|
+
/** Modifier keys held during an input, as on `MouseEvent`. */
|
|
5
|
+
export type Modifiers = {
|
|
6
|
+
readonly shift: boolean;
|
|
7
|
+
readonly control: boolean;
|
|
8
|
+
readonly meta: boolean;
|
|
9
|
+
readonly alt: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Pointer input in normalised device coordinates. `button` follows `MouseEvent.button`.
|
|
13
|
+
* `pointer` is the input's `PointerEvent.pointerId` (0 when absent): with two pointers
|
|
14
|
+
* pressed (two fingers), the second only takes part in pinches.
|
|
15
|
+
*/
|
|
16
|
+
export type PointerInput = {
|
|
17
|
+
readonly _tag: 'PointerMove';
|
|
18
|
+
readonly x: number;
|
|
19
|
+
readonly y: number;
|
|
20
|
+
readonly pointer?: number;
|
|
21
|
+
} | {
|
|
22
|
+
readonly _tag: 'PointerDown';
|
|
23
|
+
readonly x: number;
|
|
24
|
+
readonly y: number;
|
|
25
|
+
readonly button: number;
|
|
26
|
+
readonly pointer?: number;
|
|
27
|
+
readonly modifiers?: Modifiers;
|
|
28
|
+
} | {
|
|
29
|
+
readonly _tag: 'PointerUp';
|
|
30
|
+
readonly x: number;
|
|
31
|
+
readonly y: number;
|
|
32
|
+
readonly button: number;
|
|
33
|
+
readonly pointer?: number;
|
|
34
|
+
} | {
|
|
35
|
+
readonly _tag: 'DoubleClick';
|
|
36
|
+
readonly x: number;
|
|
37
|
+
readonly y: number;
|
|
38
|
+
readonly button: number;
|
|
39
|
+
} | {
|
|
40
|
+
readonly _tag: 'ContextMenu';
|
|
41
|
+
readonly x: number;
|
|
42
|
+
readonly y: number;
|
|
43
|
+
} | {
|
|
44
|
+
readonly _tag: 'Wheel';
|
|
45
|
+
readonly x: number;
|
|
46
|
+
readonly y: number;
|
|
47
|
+
/** In CSS pixels: line and page deltas are converted, as three.js's controls do. */
|
|
48
|
+
readonly deltaX: number;
|
|
49
|
+
readonly deltaY: number;
|
|
50
|
+
readonly modifiers?: Modifiers;
|
|
51
|
+
} | {
|
|
52
|
+
readonly _tag: 'PointerLeave';
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* A gesture on the canvas, reported when the scene claims gestures (`gestures: 'scene'`).
|
|
56
|
+
* Distances are CSS pixels, right and down positive, since the previous gesture event;
|
|
57
|
+
* `width` and `height` are the CSS size of the canvas, or of the view the gesture began
|
|
58
|
+
* in, for turning pixels into angles and distances. `view` names that view. `x` and `y`
|
|
59
|
+
* locate the gesture in it (−1 to 1, y up): where a drag was pressed, the wheel turned,
|
|
60
|
+
* or a pinch's midpoint is, for zooming toward the cursor.
|
|
61
|
+
*
|
|
62
|
+
* - `Drag`: the pointer moved while pressed, with the button and modifiers of the press.
|
|
63
|
+
* `key` names the interactive mesh the press landed on, if any, so a Model can leave
|
|
64
|
+
* the camera alone while that mesh is dragged.
|
|
65
|
+
* - `Wheel`: the wheel turned, anywhere over the canvas.
|
|
66
|
+
* - `Pinch`: two pointers moved: `scale` is their new distance over the old (above 1
|
|
67
|
+
* when spreading), and the deltas are how far their midpoint moved.
|
|
68
|
+
*/
|
|
69
|
+
export type Gesture = {
|
|
70
|
+
readonly _tag: 'Drag';
|
|
71
|
+
readonly button: number;
|
|
72
|
+
readonly modifiers: Modifiers;
|
|
73
|
+
readonly key?: string;
|
|
74
|
+
readonly view?: string;
|
|
75
|
+
readonly deltaX: number;
|
|
76
|
+
readonly deltaY: number;
|
|
77
|
+
readonly width: number;
|
|
78
|
+
readonly height: number;
|
|
79
|
+
readonly x: number;
|
|
80
|
+
readonly y: number;
|
|
81
|
+
} | {
|
|
82
|
+
readonly _tag: 'Wheel';
|
|
83
|
+
readonly modifiers: Modifiers;
|
|
84
|
+
readonly view?: string;
|
|
85
|
+
readonly deltaX: number;
|
|
86
|
+
readonly deltaY: number;
|
|
87
|
+
readonly width: number;
|
|
88
|
+
readonly height: number;
|
|
89
|
+
readonly x: number;
|
|
90
|
+
readonly y: number;
|
|
91
|
+
} | {
|
|
92
|
+
readonly _tag: 'Pinch';
|
|
93
|
+
readonly view?: string;
|
|
94
|
+
readonly scale: number;
|
|
95
|
+
readonly deltaX: number;
|
|
96
|
+
readonly deltaY: number;
|
|
97
|
+
readonly width: number;
|
|
98
|
+
readonly height: number;
|
|
99
|
+
readonly x: number;
|
|
100
|
+
readonly y: number;
|
|
101
|
+
};
|
|
102
|
+
/** No modifier keys held. */
|
|
103
|
+
export declare const noModifiers: Modifiers;
|
|
104
|
+
/**
|
|
105
|
+
* The nearest interactive mesh under a point.
|
|
106
|
+
*
|
|
107
|
+
* - `point`: world-space hit point. `distance`: from the camera, in world units.
|
|
108
|
+
* - `normal`: world-space normal of the face hit. `uv`: texture coordinates at the hit.
|
|
109
|
+
* Every kernel-built geometry has both; a geometry without them reports zeros.
|
|
110
|
+
*/
|
|
111
|
+
export type Hit = {
|
|
112
|
+
readonly key: string;
|
|
113
|
+
/** For an `instances` node, the key of the instance hit. */
|
|
114
|
+
readonly instance?: string;
|
|
115
|
+
/** For a `borrowed` node, the `name` of the object hit inside it, when it has one. */
|
|
116
|
+
readonly part?: string;
|
|
117
|
+
/** With several views, the key of the view the pointer was over. */
|
|
118
|
+
readonly view?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Keys of the hit mesh's ancestor groups, nearest first. Match on it to handle every
|
|
121
|
+
* mesh in a group with one handler: React Three Fiber's bubbling, as data.
|
|
122
|
+
*/
|
|
123
|
+
readonly path: ReadonlyArray<string>;
|
|
124
|
+
readonly point: Vec3;
|
|
125
|
+
readonly distance: number;
|
|
126
|
+
readonly normal: Vec3;
|
|
127
|
+
readonly uv: readonly [u: number, v: number];
|
|
128
|
+
/** The world-space ray through the pointer, as on every React Three Fiber event. */
|
|
129
|
+
readonly ray: Ray;
|
|
130
|
+
};
|
|
131
|
+
/** A world-space ray from the camera through the pointer. `direction` is unit length. */
|
|
132
|
+
export type Ray = {
|
|
133
|
+
readonly origin: Vec3;
|
|
134
|
+
readonly direction: Vec3;
|
|
135
|
+
};
|
|
136
|
+
/** A plane `normal · p + constant = 0`, as three.js's `Plane`. */
|
|
137
|
+
export type PlaneEquation = {
|
|
138
|
+
readonly normal: Vec3;
|
|
139
|
+
readonly constant: number;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Where a ray meets a plane, or `undefined` when it runs parallel or the plane is behind
|
|
143
|
+
* it. Turns drag rays into points: `pointOnPlane(ray, { normal: [0, 1, 0], constant: 0 })`
|
|
144
|
+
* is the point on the ground.
|
|
145
|
+
*/
|
|
146
|
+
export declare const pointOnPlane: (ray: Ray, plane: PlaneEquation) => Vec3 | undefined;
|
|
147
|
+
/** A hit with a tag and extra fields, flattened into one object type. */
|
|
148
|
+
type HitEvent<Tag extends string, Extra = unknown> = {
|
|
149
|
+
readonly [K in keyof ({
|
|
150
|
+
readonly _tag: Tag;
|
|
151
|
+
} & Hit & Extra)]: ({
|
|
152
|
+
readonly _tag: Tag;
|
|
153
|
+
} & Hit & Extra)[K];
|
|
154
|
+
};
|
|
155
|
+
/** Interaction with an interactive mesh, identified by its key, plus misses. */
|
|
156
|
+
export type SceneEvent = HitEvent<'PointerEnter'> | {
|
|
157
|
+
readonly _tag: 'PointerLeave';
|
|
158
|
+
readonly key: string;
|
|
159
|
+
} | HitEvent<'PointerMove'> | HitEvent<'PointerDown', {
|
|
160
|
+
readonly button: number;
|
|
161
|
+
}> | HitEvent<'PointerUp', {
|
|
162
|
+
readonly button: number;
|
|
163
|
+
}> | HitEvent<'Click', {
|
|
164
|
+
readonly button: number;
|
|
165
|
+
}> | HitEvent<'DoubleClick', {
|
|
166
|
+
readonly button: number;
|
|
167
|
+
}> | HitEvent<'ContextMenu'> | HitEvent<'Wheel', {
|
|
168
|
+
readonly deltaX: number;
|
|
169
|
+
readonly deltaY: number;
|
|
170
|
+
}>
|
|
171
|
+
/** A click that hit no interactive mesh: useful for clearing a selection. */
|
|
172
|
+
| {
|
|
173
|
+
readonly _tag: 'PointerMissed';
|
|
174
|
+
readonly button: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The pointer moved while pressed on mesh `key`, anywhere: the press captures the
|
|
178
|
+
* pointer, as React Three Fiber's `setPointerCapture` does, until release.
|
|
179
|
+
*/
|
|
180
|
+
| {
|
|
181
|
+
readonly _tag: 'Drag';
|
|
182
|
+
readonly key: string;
|
|
183
|
+
readonly button: number;
|
|
184
|
+
readonly ray: Ray;
|
|
185
|
+
}
|
|
186
|
+
/** A drag on `key` ended: released anywhere, or the pointer left. Only after a `Drag`. */
|
|
187
|
+
| {
|
|
188
|
+
readonly _tag: 'DragEnd';
|
|
189
|
+
readonly key: string;
|
|
190
|
+
readonly button: number;
|
|
191
|
+
readonly ray: Ray;
|
|
192
|
+
}
|
|
193
|
+
/** A drag, wheel or pinch on the canvas, when the scene claims gestures. */
|
|
194
|
+
| {
|
|
195
|
+
readonly _tag: 'Gesture';
|
|
196
|
+
readonly gesture: Gesture;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* A gesture is about to begin on a camera that has turned by itself (`autoRotate`):
|
|
200
|
+
* where it got to, so the Model can keep it (`autoRotated(camera, detail)`) and the
|
|
201
|
+
* gesture moves on from there. `view` names a view's camera; without it, the scene's.
|
|
202
|
+
*/
|
|
203
|
+
| {
|
|
204
|
+
readonly _tag: 'AutoRotated';
|
|
205
|
+
readonly view?: string;
|
|
206
|
+
readonly position: Vec3;
|
|
207
|
+
}
|
|
208
|
+
/** In an immersive session, a thumbstick pushed past halfway in a direction, or let back. */
|
|
209
|
+
| {
|
|
210
|
+
readonly _tag: 'XrStick';
|
|
211
|
+
readonly hand: XrHand;
|
|
212
|
+
readonly direction: XrStickDirection;
|
|
213
|
+
}
|
|
214
|
+
/** In an immersive session, a controller button pressed or released. */
|
|
215
|
+
| {
|
|
216
|
+
readonly _tag: 'XrButton';
|
|
217
|
+
readonly hand: XrHand;
|
|
218
|
+
readonly button: XrButtonName;
|
|
219
|
+
readonly pressed: boolean;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Gliding with the sticks (`xr({ glide })`) stopped: where the player stands, to keep
|
|
223
|
+
* in the Model's `xr({ origin, heading })`.
|
|
224
|
+
*/
|
|
225
|
+
| {
|
|
226
|
+
readonly _tag: 'XrMoved';
|
|
227
|
+
readonly origin: Vec3;
|
|
228
|
+
readonly heading: number;
|
|
229
|
+
}
|
|
230
|
+
/** The session's detected planes changed (`xr({ planes: true })`): all of them, now. */
|
|
231
|
+
| {
|
|
232
|
+
readonly _tag: 'XrPlanes';
|
|
233
|
+
readonly planes: ReadonlyArray<XrPlane>;
|
|
234
|
+
}
|
|
235
|
+
/** The session's detected meshes changed (`xr({ meshes: true })`): all of them, now. */
|
|
236
|
+
| {
|
|
237
|
+
readonly _tag: 'XrMeshes';
|
|
238
|
+
readonly meshes: ReadonlyArray<XrMesh>;
|
|
239
|
+
}
|
|
240
|
+
/** In AR, a select whose ray met a real surface (`xr({ hitTest: true })`). */
|
|
241
|
+
| {
|
|
242
|
+
readonly _tag: 'XrSurface';
|
|
243
|
+
readonly hand: XrHand;
|
|
244
|
+
readonly point: Vec3;
|
|
245
|
+
readonly normal: Vec3;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Two bodies began (`started`) or stopped touching, by their nodes' keys (and, for a body
|
|
249
|
+
* on an instance, the instance's): Rapier's collision events, as react-three-rapier's
|
|
250
|
+
* `onCollisionEnter` and `onCollisionExit`. Not a pointer event: it travels with them so
|
|
251
|
+
* one stream carries everything.
|
|
252
|
+
*/
|
|
253
|
+
| {
|
|
254
|
+
readonly _tag: 'Collision';
|
|
255
|
+
readonly a: string;
|
|
256
|
+
readonly aInstance?: string;
|
|
257
|
+
readonly aPart?: string;
|
|
258
|
+
readonly b: string;
|
|
259
|
+
readonly bInstance?: string;
|
|
260
|
+
readonly bPart?: string;
|
|
261
|
+
readonly started: boolean;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Two bodies pushed on each other harder than a body's `contactForces` threshold during
|
|
265
|
+
* a step: react-three-rapier's `onContactForce` payload, named as collisions are.
|
|
266
|
+
*/
|
|
267
|
+
| {
|
|
268
|
+
readonly _tag: 'ContactForce';
|
|
269
|
+
readonly a: string;
|
|
270
|
+
readonly aInstance?: string;
|
|
271
|
+
readonly aPart?: string;
|
|
272
|
+
readonly b: string;
|
|
273
|
+
readonly bInstance?: string;
|
|
274
|
+
readonly bPart?: string;
|
|
275
|
+
readonly totalForce: Vec3;
|
|
276
|
+
readonly totalForceMagnitude: number;
|
|
277
|
+
readonly maxForceDirection: Vec3;
|
|
278
|
+
readonly maxForceMagnitude: number;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* A measured label's laid-out size changed (`scene({ measure })`, after its glyphs are
|
|
282
|
+
* laid out): in its own units, before its scale, for sizing what goes behind it, as
|
|
283
|
+
* Drei's `Text` `onSync` reads troika's `textRenderInfo`.
|
|
284
|
+
*/
|
|
285
|
+
| {
|
|
286
|
+
readonly _tag: 'LabelMeasured';
|
|
287
|
+
readonly key: string;
|
|
288
|
+
readonly block: readonly [number, number, number, number];
|
|
289
|
+
readonly visible: readonly [number, number, number, number];
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* A measured node's world bounding box changed (`scene({ measure })`): Drei's `Bounds`
|
|
293
|
+
* `box.setFromObject`, reported rather than read. Not a pointer event either.
|
|
294
|
+
*/
|
|
295
|
+
| {
|
|
296
|
+
readonly _tag: 'Measured';
|
|
297
|
+
readonly key: string;
|
|
298
|
+
readonly min: Vec3;
|
|
299
|
+
readonly max: Vec3;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* The frame-rate monitor moved the performance factor (0 to 1). Not a pointer event:
|
|
303
|
+
* it travels with them so one stream carries everything the scene reports.
|
|
304
|
+
*/
|
|
305
|
+
| {
|
|
306
|
+
readonly _tag: 'PerformanceChanged';
|
|
307
|
+
readonly fps: number;
|
|
308
|
+
readonly factor: number;
|
|
309
|
+
};
|
|
310
|
+
export type Picker = {
|
|
311
|
+
/** Hit-tests at NDC `(x, y)`. Updates world matrices first, so it works headless. */
|
|
312
|
+
readonly pick: (x: number, y: number) => Hit | undefined;
|
|
313
|
+
/** The world-space ray through NDC `(x, y)`. */
|
|
314
|
+
readonly ray: (x: number, y: number) => Ray;
|
|
315
|
+
/** Hit-tests along a world-space ray: an XR controller's, say. */
|
|
316
|
+
readonly pickRay: (ray: Ray) => Hit | undefined;
|
|
317
|
+
/** The picked graph's viewport in CSS pixels, for pixel thresholds. */
|
|
318
|
+
readonly viewport: () => {
|
|
319
|
+
readonly width: number;
|
|
320
|
+
readonly height: number;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* The CSS size of what is under NDC `(x, y)`: the view there, with its key, or the
|
|
324
|
+
* whole canvas.
|
|
325
|
+
*/
|
|
326
|
+
readonly region: (x: number, y: number) => Region;
|
|
327
|
+
/** Whether the scene claims the pointer's gestures. */
|
|
328
|
+
readonly gestures: () => Gestures;
|
|
329
|
+
/** Holds the cameras' turning (`autoRotate`) while a gesture is pressed. */
|
|
330
|
+
readonly holdCameras: (held: boolean) => void;
|
|
331
|
+
/** Where turning has taken a view's camera (or the scene's), if it has turned. */
|
|
332
|
+
readonly turned: (view: string | undefined) => Vec3 | undefined;
|
|
333
|
+
};
|
|
334
|
+
/** A part of the canvas in CSS pixels: a view, named by `view`, or the whole canvas. */
|
|
335
|
+
export type Region = {
|
|
336
|
+
readonly view?: string;
|
|
337
|
+
readonly width: number;
|
|
338
|
+
readonly height: number;
|
|
339
|
+
/** The point in the region's own normalised coordinates: −1 to 1, y up. */
|
|
340
|
+
readonly x: number;
|
|
341
|
+
readonly y: number;
|
|
342
|
+
};
|
|
343
|
+
/** Creates a raycasting picker over a graph's interactive meshes and groups. */
|
|
344
|
+
export declare const createPicker: (graph: SceneGraph) => Picker;
|
|
345
|
+
export type PointerTracker = {
|
|
346
|
+
/** Applies one input and returns the resulting events. */
|
|
347
|
+
readonly input: (input: PointerInput) => ReadonlyArray<SceneEvent>;
|
|
348
|
+
/**
|
|
349
|
+
* Re-tests hover at the last pointer position. Call once per frame: objects can move
|
|
350
|
+
* under a stationary pointer. Returns only enter and leave transitions.
|
|
351
|
+
*/
|
|
352
|
+
readonly frame: () => ReadonlyArray<SceneEvent>;
|
|
353
|
+
};
|
|
354
|
+
/** Creates the pointer state machine for one scene. */
|
|
355
|
+
export declare const createPointerTracker: (picker: Picker) => PointerTracker;
|
|
356
|
+
export {};
|
|
357
|
+
//# sourceMappingURL=pointer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../src/kernel/pointer.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5F,8DAA8D;AAC9D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB;IACE,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