@woosh/meep-engine 2.147.0 → 2.149.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.
Files changed (61) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_bridge_islands.d.ts +23 -0
  3. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_bridge_islands.d.ts.map +1 -0
  4. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_bridge_islands.js +295 -0
  5. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts +4 -4
  6. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts.map +1 -1
  7. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.js +48 -52
  8. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts +23 -21
  9. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts.map +1 -1
  10. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.js +41 -406
  11. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts +5 -4
  12. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts.map +1 -1
  13. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.js +400 -395
  14. package/src/engine/navigation/mesh/NavigationMesh.d.ts +6 -2
  15. package/src/engine/navigation/mesh/NavigationMesh.d.ts.map +1 -1
  16. package/src/engine/navigation/mesh/NavigationMesh.js +234 -212
  17. package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts +7 -3
  18. package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
  19. package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +67 -73
  20. package/src/engine/navigation/mesh/build/enforce_agent_height_clearance.d.ts +16 -5
  21. package/src/engine/navigation/mesh/build/enforce_agent_height_clearance.d.ts.map +1 -1
  22. package/src/engine/navigation/mesh/build/enforce_agent_height_clearance.js +262 -147
  23. package/src/engine/navigation/mesh/build/navmesh_build_topology.d.ts.map +1 -1
  24. package/src/engine/navigation/mesh/build/navmesh_build_topology.js +33 -3
  25. package/src/engine/navigation/mesh/bvh_query_nearest_face.d.ts +4 -1
  26. package/src/engine/navigation/mesh/bvh_query_nearest_face.d.ts.map +1 -1
  27. package/src/engine/navigation/mesh/bvh_query_nearest_face.js +164 -131
  28. package/src/engine/physics/body/SolverBodyState.d.ts +142 -0
  29. package/src/engine/physics/body/SolverBodyState.d.ts.map +1 -0
  30. package/src/engine/physics/body/SolverBodyState.js +251 -0
  31. package/src/engine/physics/broadphase/generate_pairs.d.ts +2 -1
  32. package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
  33. package/src/engine/physics/broadphase/generate_pairs.js +110 -108
  34. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  35. package/src/engine/physics/constraint/solve_constraints.js +691 -673
  36. package/src/engine/physics/ecs/PhysicsSystem.d.ts +21 -18
  37. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  38. package/src/engine/physics/ecs/PhysicsSystem.js +223 -91
  39. package/src/engine/physics/inertia/world_inverse_inertia.d.ts +23 -0
  40. package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -1
  41. package/src/engine/physics/inertia/world_inverse_inertia.js +116 -77
  42. package/src/engine/physics/integration/integrate_position.d.ts +11 -1
  43. package/src/engine/physics/integration/integrate_position.d.ts.map +1 -1
  44. package/src/engine/physics/integration/integrate_position.js +97 -79
  45. package/src/engine/physics/integration/integrate_velocity.d.ts +12 -3
  46. package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -1
  47. package/src/engine/physics/integration/integrate_velocity.js +201 -160
  48. package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -1
  49. package/src/engine/physics/narrowphase/box_box_manifold.js +750 -665
  50. package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -1
  51. package/src/engine/physics/narrowphase/box_triangle_contact.js +4 -34
  52. package/src/engine/physics/narrowphase/clip_against_axis_uv.d.ts +16 -0
  53. package/src/engine/physics/narrowphase/clip_against_axis_uv.d.ts.map +1 -0
  54. package/src/engine/physics/narrowphase/clip_against_axis_uv.js +49 -0
  55. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  56. package/src/engine/physics/narrowphase/narrowphase_step.js +24 -3
  57. package/src/engine/physics/queries/raycast.d.ts.map +1 -1
  58. package/src/engine/physics/queries/raycast.js +201 -198
  59. package/src/engine/physics/solver/solve_contacts.d.ts +2 -2
  60. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
  61. package/src/engine/physics/solver/solve_contacts.js +1341 -1173
@@ -1,131 +1,164 @@
1
- import { assert } from "../../../core/assert.js";
2
- import {
3
- COLUMN_CHILD_1,
4
- COLUMN_CHILD_2,
5
- COLUMN_USER_DATA,
6
- ELEMENT_WORD_COUNT,
7
- NULL_NODE
8
- } from "../../../core/bvh2/bvh3/BVH.js";
9
- import { SCRATCH_UINT32_TRAVERSAL_STACK } from "../../../core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js";
10
- import {
11
- aabb3_unsigned_distance_sqr_to_point
12
- } from "../../../core/geom/3d/aabb/aabb3_unsigned_distance_sqr_to_point.js";
13
- import { NULL_POINTER } from "../../../core/geom/3d/topology/struct/binary/BinaryTopology.js";
14
- import {
15
- computeTriangleClosestPointToPointBarycentric
16
- } from "../../../core/geom/3d/triangle/computeTriangleClosestPointToPointBarycentric.js";
17
-
18
- const stack = SCRATCH_UINT32_TRAVERSAL_STACK;
19
-
20
- const scratch_barycentric = new Float32Array(2);
21
- const scratch_coord_a = new Float32Array(3);
22
- const scratch_coord_b = new Float32Array(3);
23
- const scratch_coord_c = new Float32Array(3);
24
-
25
- /**
26
- * Find the face of `mesh` whose surface is closest to the given point.
27
- * Expects `bvh` to have been built by {@link bvh_build_from_bt_mesh}, so each leaf's user data is a face ID.
28
- * Faces are expected to be triangles (as produced by the navmesh build pipeline).
29
- *
30
- * @param {BVH} bvh
31
- * @param {BinaryTopology} mesh
32
- * @param {number} x
33
- * @param {number} y
34
- * @param {number} z
35
- * @param {number} [max_distance=Infinity] optional cutoff, only faces within this distance are considered
36
- * @returns {number} face ID of the nearest face, or {@link NULL_POINTER} if no face was found within the cutoff
37
- */
38
- export function bvh_query_nearest_face(bvh, mesh, x, y, z, max_distance = Infinity) {
39
- assert.defined(bvh, "bvh");
40
- assert.defined(mesh, "mesh");
41
- assert.equal(mesh.isBinaryTopology, true, "mesh.isBinaryTopology !== true");
42
-
43
- const root = bvh.root;
44
-
45
- if (root === NULL_NODE) {
46
- return NULL_POINTER;
47
- }
48
-
49
- const stack_top = stack.pointer++;
50
-
51
- stack[stack_top] = root;
52
-
53
- let best_face = NULL_POINTER;
54
- let best_distance_sqr = max_distance * max_distance;
55
-
56
- const float32 = bvh.__data_float32;
57
- const uint32 = bvh.__data_uint32;
58
-
59
- do {
60
- stack.pointer--;
61
-
62
- const node = stack[stack.pointer];
63
- const address = node * ELEMENT_WORD_COUNT;
64
-
65
- // lower bound on distance via AABB
66
- const aabb_distance_sqr = aabb3_unsigned_distance_sqr_to_point(
67
- float32[address], float32[address + 1], float32[address + 2],
68
- float32[address + 3], float32[address + 4], float32[address + 5],
69
- x, y, z
70
- );
71
-
72
- if (aabb_distance_sqr >= best_distance_sqr) {
73
- // this subtree cannot contain a closer face
74
- continue;
75
- }
76
-
77
- const child_1 = uint32[address + COLUMN_CHILD_1];
78
-
79
- if (child_1 !== NULL_NODE) {
80
- // internal node, descend into both children
81
- stack[stack.pointer++] = child_1;
82
- stack[stack.pointer++] = uint32[address + COLUMN_CHILD_2];
83
- continue;
84
- }
85
-
86
- // leaf node: refine with actual triangle distance
87
- const face_id = uint32[address + COLUMN_USER_DATA];
88
-
89
- const loop_a = mesh.face_read_loop(face_id);
90
-
91
- if (loop_a === NULL_POINTER) {
92
- continue;
93
- }
94
-
95
- const loop_b = mesh.loop_read_next(loop_a);
96
- const loop_c = mesh.loop_read_next(loop_b);
97
-
98
- mesh.vertex_read_coordinate(scratch_coord_a, 0, mesh.loop_read_vertex(loop_a));
99
- mesh.vertex_read_coordinate(scratch_coord_b, 0, mesh.loop_read_vertex(loop_b));
100
- mesh.vertex_read_coordinate(scratch_coord_c, 0, mesh.loop_read_vertex(loop_c));
101
-
102
- computeTriangleClosestPointToPointBarycentric(
103
- scratch_barycentric, 0,
104
- x, y, z,
105
- scratch_coord_a[0], scratch_coord_a[1], scratch_coord_a[2],
106
- scratch_coord_b[0], scratch_coord_b[1], scratch_coord_b[2],
107
- scratch_coord_c[0], scratch_coord_c[1], scratch_coord_c[2]
108
- );
109
-
110
- const weight_a = scratch_barycentric[0];
111
- const weight_b = scratch_barycentric[1];
112
- const weight_c = 1 - weight_a - weight_b;
113
-
114
- const contact_x = scratch_coord_a[0] * weight_a + scratch_coord_b[0] * weight_b + scratch_coord_c[0] * weight_c;
115
- const contact_y = scratch_coord_a[1] * weight_a + scratch_coord_b[1] * weight_b + scratch_coord_c[1] * weight_c;
116
- const contact_z = scratch_coord_a[2] * weight_a + scratch_coord_b[2] * weight_b + scratch_coord_c[2] * weight_c;
117
-
118
- const dx = contact_x - x;
119
- const dy = contact_y - y;
120
- const dz = contact_z - z;
121
-
122
- const triangle_distance_sqr = dx * dx + dy * dy + dz * dz;
123
-
124
- if (triangle_distance_sqr < best_distance_sqr) {
125
- best_distance_sqr = triangle_distance_sqr;
126
- best_face = face_id;
127
- }
128
- } while (stack.pointer > stack_top);
129
-
130
- return best_face;
131
- }
1
+ import { assert } from "../../../core/assert.js";
2
+ import {
3
+ COLUMN_CHILD_1,
4
+ COLUMN_CHILD_2,
5
+ COLUMN_USER_DATA,
6
+ ELEMENT_WORD_COUNT,
7
+ NULL_NODE
8
+ } from "../../../core/bvh2/bvh3/BVH.js";
9
+ import { SCRATCH_UINT32_TRAVERSAL_STACK } from "../../../core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js";
10
+ import {
11
+ aabb3_unsigned_distance_sqr_to_point
12
+ } from "../../../core/geom/3d/aabb/aabb3_unsigned_distance_sqr_to_point.js";
13
+ import { NULL_POINTER } from "../../../core/geom/3d/topology/struct/binary/BinaryTopology.js";
14
+ import {
15
+ computeTriangleClosestPointToPointBarycentric
16
+ } from "../../../core/geom/3d/triangle/computeTriangleClosestPointToPointBarycentric.js";
17
+
18
+ const stack = SCRATCH_UINT32_TRAVERSAL_STACK;
19
+
20
+ // single reusable coordinate scratch; callers unpack into locals between the calls that fill it
21
+ const scratch_coords = new Float32Array(3);
22
+
23
+ /**
24
+ * Find the face of `mesh` whose surface is closest to the given point.
25
+ * Expects `bvh` to have been built by {@link bvh_build_from_bt_mesh}, so each leaf's user data is a face ID.
26
+ * Faces are expected to be triangles (as produced by the navmesh build pipeline).
27
+ *
28
+ * @param {BVH} bvh
29
+ * @param {BinaryTopology} mesh
30
+ * @param {number} x
31
+ * @param {number} y
32
+ * @param {number} z
33
+ * @param {Float32Array|number[]} out_point the closest point ON the winning face's surface (the snapped
34
+ * contact point) is written here when a face is found. Required, must not be null.
35
+ * @param {number} [out_point_offset=0] offset into `out_point` to write the snapped XYZ triple
36
+ * @param {number} [max_distance=Infinity] optional cutoff, only faces within this distance are considered
37
+ * @returns {number} face ID of the nearest face, or {@link NULL_POINTER} if no face was found within the cutoff
38
+ */
39
+ export function bvh_query_nearest_face(
40
+ bvh,
41
+ mesh,
42
+ x, y, z,
43
+ out_point,
44
+ out_point_offset = 0,
45
+ max_distance = Infinity
46
+ ) {
47
+
48
+ assert.defined(bvh, "bvh");
49
+ assert.defined(mesh, "mesh");
50
+ assert.notNull(out_point, "out_point");
51
+ assert.defined(out_point, "out_point");
52
+ assert.equal(mesh.isBinaryTopology, true, "mesh.isBinaryTopology !== true");
53
+
54
+ const root = bvh.root;
55
+
56
+ if (root === NULL_NODE) {
57
+ return NULL_POINTER;
58
+ }
59
+
60
+ const stack_top = stack.pointer++;
61
+
62
+ stack[stack_top] = root;
63
+
64
+ let best_face = NULL_POINTER;
65
+ let best_distance_sqr = max_distance * max_distance;
66
+
67
+ // closest point on the winning face's surface, tracked so callers can snap a query point onto the mesh
68
+ let best_contact_x = 0;
69
+ let best_contact_y = 0;
70
+ let best_contact_z = 0;
71
+
72
+ const float32 = bvh.__data_float32;
73
+ const uint32 = bvh.__data_uint32;
74
+
75
+ do {
76
+ stack.pointer--;
77
+
78
+ const node = stack[stack.pointer];
79
+ const address = node * ELEMENT_WORD_COUNT;
80
+
81
+ // lower bound on distance via AABB
82
+ const aabb_distance_sqr = aabb3_unsigned_distance_sqr_to_point(
83
+ float32[address], float32[address + 1], float32[address + 2],
84
+ float32[address + 3], float32[address + 4], float32[address + 5],
85
+ x, y, z
86
+ );
87
+
88
+ if (aabb_distance_sqr >= best_distance_sqr) {
89
+ // this subtree cannot contain a closer face
90
+ continue;
91
+ }
92
+
93
+ const child_1 = uint32[address + COLUMN_CHILD_1];
94
+
95
+ if (child_1 !== NULL_NODE) {
96
+ // internal node, descend into both children
97
+ stack[stack.pointer++] = child_1;
98
+ stack[stack.pointer++] = uint32[address + COLUMN_CHILD_2];
99
+ continue;
100
+ }
101
+
102
+ // leaf node: refine with actual triangle distance
103
+ const face_id = uint32[address + COLUMN_USER_DATA];
104
+
105
+ const loop_a = mesh.face_read_loop(face_id);
106
+
107
+ if (loop_a === NULL_POINTER) {
108
+ continue;
109
+ }
110
+
111
+ const loop_b = mesh.loop_read_next(loop_a);
112
+ const loop_c = mesh.loop_read_next(loop_b);
113
+
114
+ // read each vertex into the shared scratch, unpacking into locals before the next read overwrites it
115
+ mesh.vertex_read_coordinate(scratch_coords, 0, mesh.loop_read_vertex(loop_a));
116
+ const ax = scratch_coords[0], ay = scratch_coords[1], az = scratch_coords[2];
117
+
118
+ mesh.vertex_read_coordinate(scratch_coords, 0, mesh.loop_read_vertex(loop_b));
119
+ const bx = scratch_coords[0], by = scratch_coords[1], bz = scratch_coords[2];
120
+
121
+ mesh.vertex_read_coordinate(scratch_coords, 0, mesh.loop_read_vertex(loop_c));
122
+ const cx = scratch_coords[0], cy = scratch_coords[1], cz = scratch_coords[2];
123
+
124
+ // reuse the same scratch for the barycentric output (only the first two slots are written)
125
+ computeTriangleClosestPointToPointBarycentric(
126
+ scratch_coords, 0,
127
+ x, y, z,
128
+ ax, ay, az,
129
+ bx, by, bz,
130
+ cx, cy, cz
131
+ );
132
+
133
+ const weight_a = scratch_coords[0];
134
+ const weight_b = scratch_coords[1];
135
+ const weight_c = 1 - weight_a - weight_b;
136
+
137
+ const contact_x = ax * weight_a + bx * weight_b + cx * weight_c;
138
+ const contact_y = ay * weight_a + by * weight_b + cy * weight_c;
139
+ const contact_z = az * weight_a + bz * weight_b + cz * weight_c;
140
+
141
+ const dx = contact_x - x;
142
+ const dy = contact_y - y;
143
+ const dz = contact_z - z;
144
+
145
+ const triangle_distance_sqr = dx * dx + dy * dy + dz * dz;
146
+
147
+ if (triangle_distance_sqr < best_distance_sqr) {
148
+ best_distance_sqr = triangle_distance_sqr;
149
+ best_face = face_id;
150
+
151
+ best_contact_x = contact_x;
152
+ best_contact_y = contact_y;
153
+ best_contact_z = contact_z;
154
+ }
155
+ } while (stack.pointer > stack_top);
156
+
157
+ if (best_face !== NULL_POINTER) {
158
+ out_point[out_point_offset] = best_contact_x;
159
+ out_point[out_point_offset + 1] = best_contact_y;
160
+ out_point[out_point_offset + 2] = best_contact_z;
161
+ }
162
+
163
+ return best_face;
164
+ }
@@ -0,0 +1,142 @@
1
+ /**
2
+ * # SolverBodyState — data-oriented mirror of the per-body solver hot state
3
+ *
4
+ * The TGS substep window (contact solver, joint solver, gravity / position
5
+ * integration) reads and writes a small, fixed set of per-body quantities
6
+ * thousands of times per step: linear / angular velocity, inverse mass,
7
+ * inverse-inertia diagonal, and orientation. In the object world those live on
8
+ * the {@link RigidBody} and {@link Transform} *components*, reached via
9
+ * `system.__bodies[idx]` / `system.__transforms[idx]` — a chain of pointer
10
+ * dereferences (array → component object → `Vector3` field) on the hottest
11
+ * inner loop in the engine.
12
+ *
13
+ * This class packs exactly those quantities into one ArrayBuffer-backed,
14
+ * stride-{@link SBS_STRIDE} `Float64Array` indexed by **body slot index** (the
15
+ * same index the rest of the physics system already uses). A body's whole
16
+ * solver state sits in one contiguous span, so the solver reads it with flat
17
+ * typed-array indexing and no object dereference.
18
+ *
19
+ * ## Lifecycle within one `fixedUpdate`
20
+ *
21
+ * - {@link begin} once, after islands are built: ensures capacity and rolls
22
+ * the per-step gather stamp.
23
+ * - {@link gather} every body referenced this step (the awake set + the
24
+ * static / kinematic anchors referenced by contacts and joints). Idempotent
25
+ * per step via the stamp, so callers may gather the same body redundantly.
26
+ * MUST run after the once-per-step force integration (so the gathered
27
+ * velocity is post-force) and before any substep stage reads it.
28
+ * - the substep loop mutates `data` in place.
29
+ * - {@link scatter} once at the end: write the persistent linear / angular
30
+ * velocity back to each gathered body's `RigidBody`. Pose is NOT scattered
31
+ * here — `integrate_position` keeps the authoritative pose on the
32
+ * `Transform` (write-through, so its `onChanged` subscribers and the
33
+ * per-substep concave re-detection still see the moved pose); the
34
+ * orientation quaternion is mirrored into `data` purely for the impulse
35
+ * loop's world-inverse-inertia evaluation.
36
+ *
37
+ * ## Material content
38
+ *
39
+ * For Static / Kinematic bodies `invMass` and the inverse-inertia diagonal are
40
+ * stored as **zero** regardless of the component values — the solver treats
41
+ * "no inverse mass / no inverse inertia" as immovable, which is exactly how the
42
+ * object path's `kind !== Dynamic` guards behave. Velocity is mirrored as-is
43
+ * (a kinematic mover carries a real velocity the contact rows must see; a
44
+ * static reads zero). Scattering velocity back to a non-dynamic body is a
45
+ * no-op in value (the solver never moves it), so scatter need not special-case.
46
+ *
47
+ * The arithmetic the solver performs on this data is identical to the object
48
+ * path — only the *source of the operands* changes — so the engine's
49
+ * same-runtime bit-identical determinism contract is preserved.
50
+ *
51
+ * @author Alex Goldring
52
+ * @copyright Company Named Limited (c) 2026
53
+ */
54
+ /** Inverse mass (0 for Static / Kinematic). */
55
+ export const SBS_INV_MASS: 0;
56
+ /** Inverse-inertia diagonal, body-local principal frame (0,0,0 for non-dynamic). */
57
+ export const SBS_INV_I_X: 1;
58
+ export const SBS_INV_I_Y: 2;
59
+ export const SBS_INV_I_Z: 3;
60
+ /** Orientation quaternion (mirrors `transform.rotation`, refreshed per substep). */
61
+ export const SBS_QX: 4;
62
+ export const SBS_QY: 5;
63
+ export const SBS_QZ: 6;
64
+ export const SBS_QW: 7;
65
+ /** Persistent linear velocity. */
66
+ export const SBS_LV_X: 8;
67
+ export const SBS_LV_Y: 9;
68
+ export const SBS_LV_Z: 10;
69
+ /** Persistent angular velocity. */
70
+ export const SBS_AV_X: 11;
71
+ export const SBS_AV_Y: 12;
72
+ export const SBS_AV_Z: 13;
73
+ /** Doubles per body. */
74
+ export const SBS_STRIDE: 14;
75
+ export class SolverBodyState {
76
+ constructor(initial_capacity?: number);
77
+ /**
78
+ * Interleaved per-body state, `slot_index * SBS_STRIDE + field`.
79
+ * @type {Float64Array}
80
+ */
81
+ data: Float64Array;
82
+ /**
83
+ * Per-body "gathered this step" stamp; equals {@link __gen} when the
84
+ * body's slot has been gathered in the current step.
85
+ * @private
86
+ * @type {Int32Array}
87
+ */
88
+ private __stamp;
89
+ /**
90
+ * Dense list of slot indices gathered this step, for {@link scatter}.
91
+ * @private
92
+ * @type {Uint32Array}
93
+ */
94
+ private __gathered;
95
+ /** @private */
96
+ private __gathered_count;
97
+ /**
98
+ * Monotonic per-step generation. {@link begin} increments it so the
99
+ * previous step's stamps are stale without an O(n) clear.
100
+ * @private
101
+ */
102
+ private __gen;
103
+ /** @private */
104
+ private __capacity;
105
+ /**
106
+ * Number of bodies gathered in the current step.
107
+ * @returns {number}
108
+ */
109
+ get gathered_count(): number;
110
+ /**
111
+ * Ensure the typed arrays can index slot `[0, hwm)` and roll the per-step
112
+ * gather state. Call once per `fixedUpdate`, after islands are built.
113
+ *
114
+ * @param {number} hwm body-storage high-water mark
115
+ */
116
+ begin(hwm: number): void;
117
+ /**
118
+ * Mirror one body's solver state into `data` if not already gathered this
119
+ * step. Idempotent per step. Reads the body's current (post-force)
120
+ * velocity and current pose.
121
+ *
122
+ * @param {number} idx body slot index
123
+ * @param {RigidBody} rb
124
+ * @param {Transform} transform
125
+ */
126
+ gather(idx: number, rb: RigidBody, transform: Transform): void;
127
+ /**
128
+ * Write the solved persistent linear / angular velocity back onto every
129
+ * gathered body's `RigidBody`. Direct typed-array writes into the
130
+ * `Vector3` backing — the same observer-bypassing path the solver already
131
+ * uses for velocity (`lv[0] += …`), so no `onChanged` semantics change.
132
+ *
133
+ * @param {RigidBody[]} bodies sparse, indexed by slot
134
+ */
135
+ scatter(bodies: RigidBody[]): void;
136
+ /**
137
+ * @private
138
+ * @param {number} hwm
139
+ */
140
+ private __grow;
141
+ }
142
+ //# sourceMappingURL=SolverBodyState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolverBodyState.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/body/SolverBodyState.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,+CAA+C;AAC/C,6BAA8B;AAC9B,oFAAoF;AACpF,4BAA6B;AAC7B,4BAA6B;AAC7B,4BAA6B;AAC7B,oFAAoF;AACpF,uBAAwB;AACxB,uBAAwB;AACxB,uBAAwB;AACxB,uBAAwB;AACxB,kCAAkC;AAClC,yBAA0B;AAC1B,yBAA0B;AAC1B,0BAA2B;AAC3B,mCAAmC;AACnC,0BAA2B;AAC3B,0BAA2B;AAC3B,0BAA2B;AAE3B,wBAAwB;AACxB,4BAA6B;AAE7B;IACI,uCAoCC;IAjCG;;;OAGG;IACH,MAFU,YAAY,CAEwB;IAE9C;;;;;OAKG;IACH,gBAAkC;IAElC;;;;OAIG;IACH,mBAAsC;IAEtC,eAAe;IACf,yBAAyB;IAEzB;;;;OAIG;IACH,cAAc;IAEd,eAAe;IACf,mBAAqB;IAGzB;;;OAGG;IACH,6BAEC;IAED;;;;;OAKG;IACH,WAFW,MAAM,QAiBhB;IAED;;;;;;;;OAQG;IACH,YAJW,MAAM,6CA8ChB;IAED;;;;;;;OAOG;IACH,gBAFW,WAAW,QAoBrB;IAED;;;OAGG;IACH,eAcC;CACJ"}