@woosh/meep-engine 2.139.0 → 2.141.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 (199) hide show
  1. package/package.json +1 -1
  2. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts +3 -3
  3. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts.map +1 -1
  4. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.js +4 -4
  5. package/src/{engine/physics/broadphase/aabb_transform_oriented.d.ts → core/geom/3d/aabb/aabb3_transform_oriented.d.ts} +2 -2
  6. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -0
  7. package/src/{engine/physics/broadphase/aabb_transform_oriented.js → core/geom/3d/aabb/aabb3_transform_oriented.js} +1 -1
  8. package/src/core/geom/3d/quaternion/quat3_multiply.d.ts +21 -0
  9. package/src/core/geom/3d/quaternion/quat3_multiply.d.ts.map +1 -0
  10. package/src/core/geom/3d/quaternion/quat3_multiply.js +25 -0
  11. package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts +54 -0
  12. package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts.map +1 -0
  13. package/src/core/geom/3d/quaternion/quat3_to_matrix3.js +69 -0
  14. package/src/core/geom/3d/shape/AbstractShape3D.d.ts +24 -2
  15. package/src/core/geom/3d/shape/AbstractShape3D.d.ts.map +1 -1
  16. package/src/core/geom/3d/shape/AbstractShape3D.js +24 -1
  17. package/src/core/geom/3d/shape/HeightMapShape3D.d.ts +148 -0
  18. package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -0
  19. package/src/core/geom/3d/shape/HeightMapShape3D.js +451 -0
  20. package/src/core/geom/3d/shape/MeshShape3D.d.ts +210 -0
  21. package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -0
  22. package/src/core/geom/3d/shape/MeshShape3D.js +593 -0
  23. package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
  24. package/src/core/geom/3d/shape/TransformedShape3D.js +46 -2
  25. package/src/core/geom/3d/shape/Triangle3D.d.ts +95 -0
  26. package/src/core/geom/3d/shape/Triangle3D.d.ts.map +1 -0
  27. package/src/core/geom/3d/shape/Triangle3D.js +318 -0
  28. package/src/core/geom/3d/shape/UnionShape3D.js +13 -0
  29. package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts +30 -0
  30. package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts.map +1 -0
  31. package/src/core/geom/3d/shape/shape_mesh_from_geometry.js +64 -0
  32. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +9 -11
  33. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts +28 -0
  34. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts.map +1 -0
  35. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.js +48 -0
  36. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -1
  37. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +40 -18
  38. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +9 -5
  39. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -1
  40. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +38 -10
  41. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +14 -5
  42. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -1
  43. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +47 -5
  44. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +19 -0
  45. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
  46. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +75 -13
  47. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts +2 -2
  48. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -1
  49. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.js +1 -1
  50. package/src/core/geom/vec3/v3_dot_array_array.d.ts +3 -3
  51. package/src/core/geom/vec3/v3_dot_array_array.d.ts.map +1 -1
  52. package/src/core/geom/vec3/v3_dot_array_array.js +2 -2
  53. package/src/core/geom/vec3/v3_negate_array.d.ts +3 -3
  54. package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -1
  55. package/src/core/geom/vec3/v3_negate_array.js +2 -2
  56. package/src/core/geom/vec3/v3_quat3_apply.d.ts +29 -0
  57. package/src/core/geom/vec3/v3_quat3_apply.d.ts.map +1 -0
  58. package/src/core/geom/vec3/v3_quat3_apply.js +39 -0
  59. package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +30 -0
  60. package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts.map +1 -0
  61. package/src/core/geom/vec3/v3_quat3_apply_inverse.js +41 -0
  62. package/src/core/geom/vec3/v3_triple_cross_product.d.ts +32 -0
  63. package/src/core/geom/vec3/v3_triple_cross_product.d.ts.map +1 -0
  64. package/src/core/geom/vec3/v3_triple_cross_product.js +45 -0
  65. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +16 -3
  66. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  67. package/src/engine/control/first-person/FirstPersonPlayerController.js +211 -211
  68. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +72 -8
  69. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  70. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +37 -5
  71. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +101 -3
  72. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  73. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +1789 -1416
  74. package/src/engine/control/first-person/TODO.md +173 -127
  75. package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -1
  76. package/src/engine/control/first-person/abilities/Slide.js +9 -1
  77. package/src/engine/control/first-person/prototype_first_person_controller.js +88 -2
  78. package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -1
  79. package/src/engine/control/first-person/test/buildTestPlayer.js +9 -1
  80. package/src/engine/graphics/geometry/CapsuleGeometry.d.ts +42 -0
  81. package/src/engine/graphics/geometry/CapsuleGeometry.d.ts.map +1 -0
  82. package/src/engine/graphics/geometry/CapsuleGeometry.js +171 -0
  83. package/src/engine/physics/BULLET_REVIEW.md +945 -0
  84. package/src/engine/physics/CANNON_REVIEW.md +1300 -0
  85. package/src/engine/physics/JOLT_REVIEW.md +913 -0
  86. package/src/engine/physics/PLAN.md +578 -236
  87. package/src/engine/physics/RAPIER_REVIEW.md +934 -0
  88. package/src/engine/physics/REVIEW_001_ACTION_PLAN.md +642 -0
  89. package/src/engine/physics/REVIEW_002.md +151 -0
  90. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +2 -2
  91. package/src/engine/physics/constraint/DofMode.d.ts +28 -0
  92. package/src/engine/physics/constraint/DofMode.d.ts.map +1 -0
  93. package/src/engine/physics/constraint/DofMode.js +35 -0
  94. package/src/engine/physics/constraint/solve_constraints.d.ts +16 -0
  95. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -0
  96. package/src/engine/physics/constraint/solve_constraints.js +436 -0
  97. package/src/engine/physics/contact/ManifoldStore.d.ts +83 -10
  98. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
  99. package/src/engine/physics/contact/ManifoldStore.js +608 -499
  100. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +2 -2
  101. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -1
  102. package/src/engine/physics/ecs/Joint.d.ts +179 -0
  103. package/src/engine/physics/ecs/Joint.d.ts.map +1 -0
  104. package/src/engine/physics/ecs/Joint.js +234 -0
  105. package/src/engine/physics/ecs/PhysicsSystem.d.ts +180 -20
  106. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  107. package/src/engine/physics/ecs/PhysicsSystem.js +1423 -1159
  108. package/src/engine/physics/fluid/FluidField.d.ts +14 -10
  109. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  110. package/src/engine/physics/fluid/FluidField.js +14 -10
  111. package/src/engine/physics/fluid/FluidSimulator.js +1 -1
  112. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +17 -10
  113. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -1
  114. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +18 -11
  115. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +13 -10
  116. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -1
  117. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +18 -13
  118. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +4 -3
  119. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -1
  120. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +15 -11
  121. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +30 -6
  122. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -1
  123. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +44 -18
  124. package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts +6 -6
  125. package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
  126. package/src/engine/physics/gjk/expanding_polytope_algorithm.js +68 -22
  127. package/src/engine/physics/gjk/gjk.d.ts +28 -2
  128. package/src/engine/physics/gjk/gjk.d.ts.map +1 -1
  129. package/src/engine/physics/gjk/gjk.js +421 -378
  130. package/src/engine/physics/gjk/minkowski_support.d.ts +37 -0
  131. package/src/engine/physics/gjk/minkowski_support.d.ts.map +1 -0
  132. package/src/engine/physics/gjk/minkowski_support.js +75 -0
  133. package/src/engine/physics/gjk/mpr.d.ts +56 -0
  134. package/src/engine/physics/gjk/mpr.d.ts.map +1 -0
  135. package/src/engine/physics/gjk/mpr.js +344 -0
  136. package/src/engine/physics/inertia/world_inverse_inertia.d.ts +20 -5
  137. package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -1
  138. package/src/engine/physics/inertia/world_inverse_inertia.js +36 -38
  139. package/src/engine/physics/integration/integrate_position.d.ts +25 -7
  140. package/src/engine/physics/integration/integrate_position.d.ts.map +1 -1
  141. package/src/engine/physics/integration/integrate_position.js +43 -12
  142. package/src/engine/physics/integration/integrate_velocity.d.ts +30 -0
  143. package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -1
  144. package/src/engine/physics/integration/integrate_velocity.js +82 -1
  145. package/src/engine/physics/island/IslandBuilder.d.ts +4 -1
  146. package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -1
  147. package/src/engine/physics/island/IslandBuilder.js +33 -16
  148. package/src/engine/physics/narrowphase/PosedShape.d.ts +0 -8
  149. package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -1
  150. package/src/engine/physics/narrowphase/PosedShape.js +28 -30
  151. package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -1
  152. package/src/engine/physics/narrowphase/box_box_manifold.js +140 -18
  153. package/src/engine/physics/narrowphase/box_triangle_contact.d.ts +30 -0
  154. package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -0
  155. package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -0
  156. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
  157. package/src/engine/physics/narrowphase/capsule_contacts.js +10 -56
  158. package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts +71 -0
  159. package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -0
  160. package/src/engine/physics/narrowphase/capsule_triangle_contact.js +375 -0
  161. package/src/engine/physics/narrowphase/compute_penetration.d.ts +91 -0
  162. package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -0
  163. package/src/engine/physics/narrowphase/compute_penetration.js +396 -0
  164. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts +35 -0
  165. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +1 -0
  166. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.js +80 -0
  167. package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts +31 -0
  168. package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts.map +1 -0
  169. package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.js +55 -0
  170. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +42 -0
  171. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -0
  172. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +204 -0
  173. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +42 -0
  174. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -0
  175. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +94 -0
  176. package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts +37 -0
  177. package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts.map +1 -0
  178. package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.js +37 -0
  179. package/src/engine/physics/narrowphase/narrowphase_step.d.ts +41 -2
  180. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  181. package/src/engine/physics/narrowphase/narrowphase_step.js +1497 -382
  182. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
  183. package/src/engine/physics/narrowphase/sphere_box_contact.js +16 -23
  184. package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts +48 -0
  185. package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts.map +1 -0
  186. package/src/engine/physics/narrowphase/sphere_triangle_contact.js +143 -0
  187. package/src/engine/physics/queries/overlap_shape.d.ts +51 -0
  188. package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -0
  189. package/src/engine/physics/queries/overlap_shape.js +183 -0
  190. package/src/engine/physics/queries/shape_cast.d.ts +56 -0
  191. package/src/engine/physics/queries/shape_cast.d.ts.map +1 -0
  192. package/src/engine/physics/queries/shape_cast.js +387 -0
  193. package/src/engine/physics/solver/solve_contacts.d.ts +146 -32
  194. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
  195. package/src/engine/physics/solver/solve_contacts.js +809 -223
  196. package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts.map +0 -1
  197. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts +0 -20
  198. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts.map +0 -1
  199. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.js +0 -83
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Compute the Minkowski-difference support point for two convex shapes.
3
+ *
4
+ * `support_{A−B}(d) = support_A(+d) − support_B(−d)`
5
+ *
6
+ * This is the bread-and-butter operation of both GJK and MPR — every
7
+ * iteration of either algorithm calls it once with a search direction
8
+ * to extend the simplex or portal. Factoring it lets the two
9
+ * algorithms share the per-call scratch buffers (the support results
10
+ * for A and B before the subtraction) so a build that imports both
11
+ * doesn't carry duplicate state.
12
+ *
13
+ * The supplied direction need not be unit — we normalise here, since
14
+ * the {@link AbstractShape3D#support} contract assumes a unit vector
15
+ * and shape support implementations (sphere especially) don't bother
16
+ * to renormalise internally.
17
+ *
18
+ * NOTE: EPA (`expanding_polytope_algorithm.js`) computes the Minkowski
19
+ * support inline rather than calling this. Its convention is the
20
+ * opposite sign (B−A rather than A−B), and it skips the normalisation
21
+ * because the search directions it constructs from face normals are
22
+ * already unit-length. The narrowphase consumer of EPA's output then
23
+ * negates the result to get the contact normal in the "B → A" stored
24
+ * convention. Folding EPA onto this helper would require both flipping
25
+ * its sign convention and changing the narrowphase call site — not
26
+ * worth the churn for one call site.
27
+ *
28
+ * @param {Float64Array|number[]} result 3-vector destination
29
+ * @param {number} result_offset
30
+ * @param {AbstractShape3D} shape_a
31
+ * @param {AbstractShape3D} shape_b
32
+ * @param {number} dir_x search direction (any non-zero magnitude)
33
+ * @param {number} dir_y
34
+ * @param {number} dir_z
35
+ */
36
+ export function minkowski_support(result: Float64Array | number[], result_offset: number, shape_a: AbstractShape3D, shape_b: AbstractShape3D, dir_x: number, dir_y: number, dir_z: number): void;
37
+ //# sourceMappingURL=minkowski_support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minkowski_support.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/gjk/minkowski_support.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,0CARW,YAAY,GAAC,MAAM,EAAE,iBACrB,MAAM,6DAGN,MAAM,SACN,MAAM,SACN,MAAM,QA2BhB"}
@@ -0,0 +1,75 @@
1
+ import { v3_length } from "../../../core/geom/vec3/v3_length.js";
2
+
3
+ /**
4
+ * Compute the Minkowski-difference support point for two convex shapes.
5
+ *
6
+ * `support_{A−B}(d) = support_A(+d) − support_B(−d)`
7
+ *
8
+ * This is the bread-and-butter operation of both GJK and MPR — every
9
+ * iteration of either algorithm calls it once with a search direction
10
+ * to extend the simplex or portal. Factoring it lets the two
11
+ * algorithms share the per-call scratch buffers (the support results
12
+ * for A and B before the subtraction) so a build that imports both
13
+ * doesn't carry duplicate state.
14
+ *
15
+ * The supplied direction need not be unit — we normalise here, since
16
+ * the {@link AbstractShape3D#support} contract assumes a unit vector
17
+ * and shape support implementations (sphere especially) don't bother
18
+ * to renormalise internally.
19
+ *
20
+ * NOTE: EPA (`expanding_polytope_algorithm.js`) computes the Minkowski
21
+ * support inline rather than calling this. Its convention is the
22
+ * opposite sign (B−A rather than A−B), and it skips the normalisation
23
+ * because the search directions it constructs from face normals are
24
+ * already unit-length. The narrowphase consumer of EPA's output then
25
+ * negates the result to get the contact normal in the "B → A" stored
26
+ * convention. Folding EPA onto this helper would require both flipping
27
+ * its sign convention and changing the narrowphase call site — not
28
+ * worth the churn for one call site.
29
+ *
30
+ * @param {Float64Array|number[]} result 3-vector destination
31
+ * @param {number} result_offset
32
+ * @param {AbstractShape3D} shape_a
33
+ * @param {AbstractShape3D} shape_b
34
+ * @param {number} dir_x search direction (any non-zero magnitude)
35
+ * @param {number} dir_y
36
+ * @param {number} dir_z
37
+ */
38
+ export function minkowski_support(
39
+ result, result_offset,
40
+ shape_a,
41
+ shape_b,
42
+ dir_x, dir_y, dir_z
43
+ ) {
44
+ const len = v3_length(dir_x, dir_y, dir_z);
45
+
46
+ if (len > 0) {
47
+ // normalise
48
+
49
+ const inv = 1 / len;
50
+
51
+ dir_x *= inv;
52
+ dir_y *= inv;
53
+ dir_z *= inv;
54
+
55
+ }
56
+
57
+ shape_a.support(scratch_support_a, 0, dir_x, dir_y, dir_z);
58
+ shape_b.support(scratch_support_b, 0, -dir_x, -dir_y, -dir_z);
59
+
60
+ result[result_offset] = scratch_support_a[0] - scratch_support_b[0];
61
+ result[result_offset + 1] = scratch_support_a[1] - scratch_support_b[1];
62
+ result[result_offset + 2] = scratch_support_a[2] - scratch_support_b[2];
63
+ }
64
+
65
+ /**
66
+ * Per-shape scratch buffers for the support-function results before
67
+ * they're subtracted into the Minkowski-difference point. Module-scoped
68
+ * because the physics step is single-threaded; both GJK and MPR run
69
+ * sequentially within one narrowphase iteration.
70
+ *
71
+ * Float64 — matches the precision-sweep treatment of the rest of the
72
+ * solver path.
73
+ */
74
+ const scratch_support_a = new Float64Array(3);
75
+ const scratch_support_b = new Float64Array(3);
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Minkowski Portal Refinement (XenoCollide, Gary Snethen, GDC 2009).
3
+ *
4
+ * Determines whether two convex shapes overlap and, if so, returns the
5
+ * Minimum Translation Vector (MTV) that would separate them. The
6
+ * algorithm runs in two phases:
7
+ *
8
+ * 1. **Portal discovery.** Starting from an interior point V0 of the
9
+ * Minkowski difference (the difference of the two body centres),
10
+ * find three vertices V1, V2, V3 on the Mink-diff boundary that
11
+ * form a triangle the ray V0→origin pierces. If at any point a
12
+ * support hyperplane separates V0 from the origin, the shapes
13
+ * can't overlap and we return false.
14
+ *
15
+ * 2. **Portal refinement.** Iteratively replace one of V1, V2, V3
16
+ * with a new support V4 found in the direction of the portal
17
+ * face's outward normal. When V4 doesn't bring the portal any
18
+ * closer to the origin (within `MPR_TOLERANCE`), the portal face
19
+ * *is* the closest face on the Mink-diff to the origin; its
20
+ * outward normal is the MTV direction and the perpendicular
21
+ * distance from the origin to the face is the penetration depth.
22
+ *
23
+ * Compared to GJK+EPA on the same overlap:
24
+ * - One algorithm produces both the overlap test and the MTV (EPA is
25
+ * a separate pass after GJK).
26
+ * - Better behaviour on smooth or high-vertex-count shapes — EPA's
27
+ * polytope-expansion can stall on curved surfaces because each new
28
+ * support produces a face with no flat region to converge on; MPR's
29
+ * portal stays a single triangle and just slides toward the origin.
30
+ * - Tends to converge in 5–15 iterations on typical inputs vs. EPA's
31
+ * 32+ on smooth pairs.
32
+ *
33
+ * **Output convention matches EPA** ({@link expanding_polytope_algorithm}):
34
+ * `result[result_offset .. result_offset+2]` is the MTV vector —
35
+ * direction is "from A's surface into B" (i.e. the direction you'd
36
+ * translate B by to separate the shapes), magnitude is the depth.
37
+ * The caller reads depth as `√(x² + y² + z²)` and normalises to get
38
+ * the unit normal. This makes MPR a drop-in replacement for EPA at
39
+ * any narrowphase call site.
40
+ *
41
+ * On failure modes:
42
+ * - Returns `false` if the shapes don't overlap.
43
+ * - On a degenerate Mink-diff (shapes touching at a point, perfectly
44
+ * coincident centres with collinear support points), returns
45
+ * `true` with a small fallback MTV — same approach as EPA's
46
+ * non-convergent fallback. The narrowphase consumer already
47
+ * filters non-positive / non-finite depths.
48
+ *
49
+ * @param {Float64Array} result destination buffer for the MTV vector
50
+ * @param {number} result_offset
51
+ * @param {PosedShape} shape_a
52
+ * @param {PosedShape} shape_b
53
+ * @returns {boolean} true on overlap
54
+ */
55
+ export function mpr(result: Float64Array, result_offset: number, shape_a: PosedShape, shape_b: PosedShape): boolean;
56
+ //# sourceMappingURL=mpr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mpr.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/gjk/mpr.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,4BANW,YAAY,iBACZ,MAAM,6CAGJ,OAAO,CAuPnB"}
@@ -0,0 +1,344 @@
1
+ import { v3_length } from "../../../core/geom/vec3/v3_length.js";
2
+ import { minkowski_support } from "./minkowski_support.js";
3
+
4
+ /**
5
+ * Maximum portal-refinement iterations. The portal must converge to
6
+ * within {@link MPR_TOLERANCE} of the closest face before this many
7
+ * iterations or we accept whatever it has and return it as an
8
+ * approximation — same graceful-degradation strategy as EPA, but
9
+ * generally MPR converges in 5–15 iterations on the shapes it does
10
+ * well on (smooth curves, mixed convex bodies).
11
+ * @type {number}
12
+ */
13
+ const MPR_MAX_ITERATIONS = 64;
14
+
15
+ /**
16
+ * Convergence threshold on the portal-normal direction. When the new
17
+ * support point is within this distance of the current portal plane
18
+ * (measured along the portal normal), we declare convergence and use
19
+ * the portal as the closest-face approximation of the MTV.
20
+ * @type {number}
21
+ */
22
+ const MPR_TOLERANCE = 1e-4;
23
+
24
+ /**
25
+ * Tolerance for collinearity / coincidence degeneracies during portal
26
+ * discovery. Picked to be safely below practical world-distance noise
27
+ * but large enough that real coincidences (shapes sharing a centre)
28
+ * trip it.
29
+ * @type {number}
30
+ */
31
+ const MPR_EPSILON = 1e-10;
32
+
33
+ /**
34
+ * Portal vertices in the Minkowski-difference space.
35
+ * V0 is an interior point of the Mink-diff (the difference of the two
36
+ * bodies' centres); V1, V2, V3 are the portal triangle's vertices; V4
37
+ * is the candidate new vertex during refinement.
38
+ */
39
+ const V0 = new Float64Array(3);
40
+ const V1 = new Float64Array(3);
41
+ const V2 = new Float64Array(3);
42
+ const V3 = new Float64Array(3);
43
+ const V4 = new Float64Array(3);
44
+
45
+ /**
46
+ * Minkowski Portal Refinement (XenoCollide, Gary Snethen, GDC 2009).
47
+ *
48
+ * Determines whether two convex shapes overlap and, if so, returns the
49
+ * Minimum Translation Vector (MTV) that would separate them. The
50
+ * algorithm runs in two phases:
51
+ *
52
+ * 1. **Portal discovery.** Starting from an interior point V0 of the
53
+ * Minkowski difference (the difference of the two body centres),
54
+ * find three vertices V1, V2, V3 on the Mink-diff boundary that
55
+ * form a triangle the ray V0→origin pierces. If at any point a
56
+ * support hyperplane separates V0 from the origin, the shapes
57
+ * can't overlap and we return false.
58
+ *
59
+ * 2. **Portal refinement.** Iteratively replace one of V1, V2, V3
60
+ * with a new support V4 found in the direction of the portal
61
+ * face's outward normal. When V4 doesn't bring the portal any
62
+ * closer to the origin (within `MPR_TOLERANCE`), the portal face
63
+ * *is* the closest face on the Mink-diff to the origin; its
64
+ * outward normal is the MTV direction and the perpendicular
65
+ * distance from the origin to the face is the penetration depth.
66
+ *
67
+ * Compared to GJK+EPA on the same overlap:
68
+ * - One algorithm produces both the overlap test and the MTV (EPA is
69
+ * a separate pass after GJK).
70
+ * - Better behaviour on smooth or high-vertex-count shapes — EPA's
71
+ * polytope-expansion can stall on curved surfaces because each new
72
+ * support produces a face with no flat region to converge on; MPR's
73
+ * portal stays a single triangle and just slides toward the origin.
74
+ * - Tends to converge in 5–15 iterations on typical inputs vs. EPA's
75
+ * 32+ on smooth pairs.
76
+ *
77
+ * **Output convention matches EPA** ({@link expanding_polytope_algorithm}):
78
+ * `result[result_offset .. result_offset+2]` is the MTV vector —
79
+ * direction is "from A's surface into B" (i.e. the direction you'd
80
+ * translate B by to separate the shapes), magnitude is the depth.
81
+ * The caller reads depth as `√(x² + y² + z²)` and normalises to get
82
+ * the unit normal. This makes MPR a drop-in replacement for EPA at
83
+ * any narrowphase call site.
84
+ *
85
+ * On failure modes:
86
+ * - Returns `false` if the shapes don't overlap.
87
+ * - On a degenerate Mink-diff (shapes touching at a point, perfectly
88
+ * coincident centres with collinear support points), returns
89
+ * `true` with a small fallback MTV — same approach as EPA's
90
+ * non-convergent fallback. The narrowphase consumer already
91
+ * filters non-positive / non-finite depths.
92
+ *
93
+ * @param {Float64Array} result destination buffer for the MTV vector
94
+ * @param {number} result_offset
95
+ * @param {PosedShape} shape_a
96
+ * @param {PosedShape} shape_b
97
+ * @returns {boolean} true on overlap
98
+ */
99
+ export function mpr(result, result_offset, shape_a, shape_b) {
100
+ // ── Step 1: interior point V0 = centerA − centerB ───────────────────
101
+ //
102
+ // PosedShape carries the body's world-space position; the centre of
103
+ // its underlying shape (in body-local space) is the origin, so the
104
+ // world centre is just (px, py, pz). The difference of two body
105
+ // centres lies inside the Mink-diff for any convex pair whose shape
106
+ // origins are interior to their geometry — true for spheres,
107
+ // boxes, capsules, and any closed mesh whose bounding box contains
108
+ // its centroid.
109
+ V0[0] = shape_a.px - shape_b.px;
110
+ V0[1] = shape_a.py - shape_b.py;
111
+ V0[2] = shape_a.pz - shape_b.pz;
112
+
113
+ // If the two centres coincide exactly, V0 is at the origin and we
114
+ // can't direction-find from it. Perturb to break the symmetry —
115
+ // any direction works; the algorithm will converge to the same
116
+ // answer regardless of which we pick.
117
+ if (V0[0] === 0 && V0[1] === 0 && V0[2] === 0) {
118
+ V0[0] = MPR_EPSILON;
119
+ }
120
+
121
+ // ── Step 2: first support V1 in direction −V0 (toward the origin) ──
122
+ minkowski_support(V1, 0, shape_a, shape_b, -V0[0], -V0[1], -V0[2]);
123
+
124
+ // If V1 isn't past the origin along −V0, the origin lies outside
125
+ // the Mink-diff and the shapes are separated.
126
+ if (V1[0] * -V0[0] + V1[1] * -V0[1] + V1[2] * -V0[2] < 0) {
127
+ return false;
128
+ }
129
+
130
+ // ── Step 3: portal discovery ────────────────────────────────────────
131
+ //
132
+ // Find V2 in a direction perpendicular to the V0–V1 axis. n = V1 × V0
133
+ // is perpendicular to both; if it degenerates to zero, V0 and V1
134
+ // are collinear with the origin, which means the origin lies on
135
+ // the segment from V0 to V1 (since V0 is interior and V1 is past
136
+ // the origin) — definite overlap, emit a fallback MTV along V1.
137
+ let nx = V1[1] * V0[2] - V1[2] * V0[1];
138
+ let ny = V1[2] * V0[0] - V1[0] * V0[2];
139
+ let nz = V1[0] * V0[1] - V1[1] * V0[0];
140
+
141
+ if (nx * nx + ny * ny + nz * nz < MPR_EPSILON) {
142
+ // Collinear degeneracy: project the answer along V1.
143
+ const v1_len = v3_length(V1[0], V1[1], V1[2]);
144
+ if (v1_len > MPR_EPSILON) {
145
+ result[result_offset] = V1[0];
146
+ result[result_offset + 1] = V1[1];
147
+ result[result_offset + 2] = V1[2];
148
+ } else {
149
+ // V1 at origin — shapes touching exactly. Emit a tiny MTV.
150
+ result[result_offset] = MPR_EPSILON;
151
+ result[result_offset + 1] = 0;
152
+ result[result_offset + 2] = 0;
153
+ }
154
+ return true;
155
+ }
156
+
157
+ minkowski_support(V2, 0, shape_a, shape_b, nx, ny, nz);
158
+
159
+ if (V2[0] * nx + V2[1] * ny + V2[2] * nz < 0) {
160
+ return false;
161
+ }
162
+
163
+ // Compute the portal-triangle normal (V1 − V0) × (V2 − V0) and
164
+ // orient it away from V0 (so it points roughly toward the origin).
165
+ let v1mv0_x = V1[0] - V0[0], v1mv0_y = V1[1] - V0[1], v1mv0_z = V1[2] - V0[2];
166
+ let v2mv0_x = V2[0] - V0[0], v2mv0_y = V2[1] - V0[1], v2mv0_z = V2[2] - V0[2];
167
+ nx = v1mv0_y * v2mv0_z - v1mv0_z * v2mv0_y;
168
+ ny = v1mv0_z * v2mv0_x - v1mv0_x * v2mv0_z;
169
+ nz = v1mv0_x * v2mv0_y - v1mv0_y * v2mv0_x;
170
+
171
+ // If the normal points along +V0 (back toward V0's side), swap V1/V2
172
+ // and flip — we want the portal facing away from V0 toward the
173
+ // origin.
174
+ if (nx * V0[0] + ny * V0[1] + nz * V0[2] > 0) {
175
+ const tx = V1[0], ty = V1[1], tz = V1[2];
176
+ V1[0] = V2[0]; V1[1] = V2[1]; V1[2] = V2[2];
177
+ V2[0] = tx; V2[1] = ty; V2[2] = tz;
178
+ nx = -nx; ny = -ny; nz = -nz;
179
+ }
180
+
181
+ // Portal-discovery iteration. We keep refining V3 until the
182
+ // tetrahedron V0–V1–V2–V3 actually contains the origin.
183
+ let discovered = false;
184
+ for (let i = 0; i < MPR_MAX_ITERATIONS; i++) {
185
+ minkowski_support(V3, 0, shape_a, shape_b, nx, ny, nz);
186
+
187
+ if (V3[0] * nx + V3[1] * ny + V3[2] * nz < 0) {
188
+ return false;
189
+ }
190
+
191
+ // Test if origin lies outside plane V0–V1–V3 (V2's side).
192
+ // n_013 = (V1 − V0) × (V3 − V0) — points away from V2 if portal
193
+ // is consistently oriented.
194
+ const v3mv0_x = V3[0] - V0[0], v3mv0_y = V3[1] - V0[1], v3mv0_z = V3[2] - V0[2];
195
+ const n013_x = v1mv0_y * v3mv0_z - v1mv0_z * v3mv0_y;
196
+ const n013_y = v1mv0_z * v3mv0_x - v1mv0_x * v3mv0_z;
197
+ const n013_z = v1mv0_x * v3mv0_y - v1mv0_y * v3mv0_x;
198
+
199
+ // origin's signed distance from plane V0-V1-V3 along n013 is
200
+ // dot(−V0, n013), since the plane passes through V0.
201
+ if (-V0[0] * n013_x - V0[1] * n013_y - V0[2] * n013_z > 0) {
202
+ // origin outside V0-V1-V3 plane on the V2 side — replace V2
203
+ V2[0] = V3[0]; V2[1] = V3[1]; V2[2] = V3[2];
204
+ v2mv0_x = v3mv0_x; v2mv0_y = v3mv0_y; v2mv0_z = v3mv0_z;
205
+ nx = n013_x; ny = n013_y; nz = n013_z;
206
+ continue;
207
+ }
208
+
209
+ // Test if origin lies outside plane V0-V2-V3 (V1's side).
210
+ const n023_x = v2mv0_y * v3mv0_z - v2mv0_z * v3mv0_y;
211
+ const n023_y = v2mv0_z * v3mv0_x - v2mv0_x * v3mv0_z;
212
+ const n023_z = v2mv0_x * v3mv0_y - v2mv0_y * v3mv0_x;
213
+
214
+ if (-V0[0] * n023_x - V0[1] * n023_y - V0[2] * n023_z < 0) {
215
+ // origin outside V0-V2-V3 plane on V1's side — replace V1
216
+ V1[0] = V3[0]; V1[1] = V3[1]; V1[2] = V3[2];
217
+ v1mv0_x = v3mv0_x; v1mv0_y = v3mv0_y; v1mv0_z = v3mv0_z;
218
+ // New portal normal: (V1' - V0) × (V2 - V0) where V1' is the new V1 (= old V3)
219
+ nx = v3mv0_y * v2mv0_z - v3mv0_z * v2mv0_y;
220
+ ny = v3mv0_z * v2mv0_x - v3mv0_x * v2mv0_z;
221
+ nz = v3mv0_x * v2mv0_y - v3mv0_y * v2mv0_x;
222
+ continue;
223
+ }
224
+
225
+ // Origin is inside the tetrahedron V0-V1-V2-V3 — portal found.
226
+ discovered = true;
227
+ break;
228
+ }
229
+
230
+ if (!discovered) {
231
+ // Ran out of portal-discovery iterations — treat as a near-miss.
232
+ return false;
233
+ }
234
+
235
+ // ── Step 4: portal refinement ───────────────────────────────────────
236
+ //
237
+ // Now we know V0–V1–V2–V3 is a valid tetrahedron containing the
238
+ // origin. Iteratively replace one of V1/V2/V3 with a new support
239
+ // V4 (found in the direction of the portal triangle's outward
240
+ // normal). When V4 doesn't extend the portal further, the portal
241
+ // face is the closest Mink-diff face to the origin and its normal
242
+ // is the MTV.
243
+ for (let i = 0; i < MPR_MAX_ITERATIONS; i++) {
244
+ // Portal face normal = (V2 - V1) × (V3 - V1)
245
+ const e1_x = V2[0] - V1[0], e1_y = V2[1] - V1[1], e1_z = V2[2] - V1[2];
246
+ const e2_x = V3[0] - V1[0], e2_y = V3[1] - V1[1], e2_z = V3[2] - V1[2];
247
+ let pn_x = e1_y * e2_z - e1_z * e2_y;
248
+ let pn_y = e1_z * e2_x - e1_x * e2_z;
249
+ let pn_z = e1_x * e2_y - e1_y * e2_x;
250
+ const pn_len = v3_length(pn_x, pn_y, pn_z);
251
+ if (pn_len < MPR_EPSILON) {
252
+ // Degenerate portal (collinear vertices) — return the
253
+ // current state as a fallback approximation.
254
+ result[result_offset] = pn_x;
255
+ result[result_offset + 1] = pn_y;
256
+ result[result_offset + 2] = pn_z;
257
+ return true;
258
+ }
259
+ const inv_pn = 1 / pn_len;
260
+ pn_x *= inv_pn; pn_y *= inv_pn; pn_z *= inv_pn;
261
+
262
+ // Perpendicular distance from the origin to the portal plane,
263
+ // = dot(V1, portal_normal). This is the candidate depth on
264
+ // every iteration; we accept it once V4 fails to push the
265
+ // portal further.
266
+ const portal_dist = V1[0] * pn_x + V1[1] * pn_y + V1[2] * pn_z;
267
+
268
+ // New support V4 in the portal normal direction.
269
+ minkowski_support(V4, 0, shape_a, shape_b, pn_x, pn_y, pn_z);
270
+
271
+ const v4_dist = V4[0] * pn_x + V4[1] * pn_y + V4[2] * pn_z;
272
+
273
+ // Convergence: V4 doesn't extend the portal beyond the current
274
+ // face (within tolerance). Emit MTV = normal × depth.
275
+ if (v4_dist - portal_dist < MPR_TOLERANCE) {
276
+ result[result_offset] = pn_x * portal_dist;
277
+ result[result_offset + 1] = pn_y * portal_dist;
278
+ result[result_offset + 2] = pn_z * portal_dist;
279
+ return true;
280
+ }
281
+
282
+ // V4 didn't pass the origin along the portal normal — the
283
+ // shapes aren't actually overlapping (shouldn't happen after
284
+ // successful portal discovery, but defensive).
285
+ if (v4_dist < 0) {
286
+ return false;
287
+ }
288
+
289
+ // Replace one of V1, V2, V3 with V4 such that the new portal
290
+ // still contains the V0→origin ray. The split is determined by
291
+ // three cross-product / dot tests against V4 × V0: signs of
292
+ // (Vi · (V4 × V0)) place V0 in one of the three sub-portals.
293
+ //
294
+ // The branch structure here mirrors libccd / bullet's MPR
295
+ // (`btMprExpandPortal`).
296
+ const c_x = V4[1] * V0[2] - V4[2] * V0[1];
297
+ const c_y = V4[2] * V0[0] - V4[0] * V0[2];
298
+ const c_z = V4[0] * V0[1] - V4[1] * V0[0];
299
+
300
+ const d1 = V1[0] * c_x + V1[1] * c_y + V1[2] * c_z;
301
+
302
+ if (d1 >= 0) {
303
+ const d2 = V2[0] * c_x + V2[1] * c_y + V2[2] * c_z;
304
+ if (d2 >= 0) {
305
+ // origin sits in sub-portal between V4 and V1 — drop V1
306
+ V1[0] = V4[0]; V1[1] = V4[1]; V1[2] = V4[2];
307
+ } else {
308
+ // sub-portal between V4 and V3 — drop V3
309
+ V3[0] = V4[0]; V3[1] = V4[1]; V3[2] = V4[2];
310
+ }
311
+ } else {
312
+ const d3 = V3[0] * c_x + V3[1] * c_y + V3[2] * c_z;
313
+ if (d3 >= 0) {
314
+ // sub-portal between V4 and V2 — drop V2
315
+ V2[0] = V4[0]; V2[1] = V4[1]; V2[2] = V4[2];
316
+ } else {
317
+ // sub-portal between V4 and V1 (other side) — drop V1
318
+ V1[0] = V4[0]; V1[1] = V4[1]; V1[2] = V4[2];
319
+ }
320
+ }
321
+ }
322
+
323
+ // Refinement ran out of iterations — emit the current portal face
324
+ // as the best-known MTV, same graceful-degradation as EPA.
325
+ const e1_x = V2[0] - V1[0], e1_y = V2[1] - V1[1], e1_z = V2[2] - V1[2];
326
+ const e2_x = V3[0] - V1[0], e2_y = V3[1] - V1[1], e2_z = V3[2] - V1[2];
327
+ let pn_x = e1_y * e2_z - e1_z * e2_y;
328
+ let pn_y = e1_z * e2_x - e1_x * e2_z;
329
+ let pn_z = e1_x * e2_y - e1_y * e2_x;
330
+ const pn_len = v3_length(pn_x, pn_y, pn_z);
331
+ if (pn_len < MPR_EPSILON) {
332
+ result[result_offset] = 0;
333
+ result[result_offset + 1] = 0;
334
+ result[result_offset + 2] = 0;
335
+ return true;
336
+ }
337
+ const inv_pn = 1 / pn_len;
338
+ pn_x *= inv_pn; pn_y *= inv_pn; pn_z *= inv_pn;
339
+ const portal_dist = V1[0] * pn_x + V1[1] * pn_y + V1[2] * pn_z;
340
+ result[result_offset] = pn_x * portal_dist;
341
+ result[result_offset + 1] = pn_y * portal_dist;
342
+ result[result_offset + 2] = pn_z * portal_dist;
343
+ return true;
344
+ }
@@ -2,8 +2,8 @@
2
2
  * Apply the world-frame inverse inertia tensor of a rigid body to a world-space
3
3
  * vector and write the result.
4
4
  *
5
- * Body-frame inverse inertia is stored as a diagonal in principal axes
6
- * (`rb.inverseInertiaLocal`). World inverse inertia is
5
+ * Body-frame inverse inertia is supplied as a diagonal in principal axes
6
+ * (a Vector3-like with `.x .y .z`). World inverse inertia is
7
7
  * `I_w⁻¹ = R · diag · R^T` where `R` is the body's orientation. We compute
8
8
  * `result = R · diag · R^T · v` without materialising the full 3x3 matrix:
9
9
  *
@@ -17,13 +17,28 @@
17
17
  * Sphere short-circuit: if the inverse inertia is isotropic (ix === iy === iz),
18
18
  * the rotation cancels and `result = ix * v`. Skip the trig and save the work.
19
19
  *
20
+ * Decoupled from RigidBody / Transform on purpose — callers pass only what
21
+ * is actually read. Lets `compute_penetration` and other standalone
22
+ * geometry helpers reuse this without manufacturing a body.
23
+ *
20
24
  * @param {number[]|Float64Array} result length >= 3
21
25
  * @param {number} result_offset
22
- * @param {RigidBody} rb
23
- * @param {Transform} transform
26
+ * @param {{x: number, y: number, z: number}} inv_inertia_local
27
+ * Body-frame inverse inertia diagonal (typically `rb.inverseInertiaLocal`).
28
+ * @param {{x: number, y: number, z: number, w: number}} rotation
29
+ * Body orientation as a unit quaternion (typically `transform.rotation`).
24
30
  * @param {number} vx
25
31
  * @param {number} vy
26
32
  * @param {number} vz
27
33
  */
28
- export function world_inverse_inertia_apply(result: number[] | Float64Array, result_offset: number, rb: RigidBody, transform: Transform, vx: number, vy: number, vz: number): void;
34
+ export function world_inverse_inertia_apply(result: number[] | Float64Array, result_offset: number, inv_inertia_local: {
35
+ x: number;
36
+ y: number;
37
+ z: number;
38
+ }, rotation: {
39
+ x: number;
40
+ y: number;
41
+ z: number;
42
+ w: number;
43
+ }, vx: number, vy: number, vz: number): void;
29
44
  //# sourceMappingURL=world_inverse_inertia.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"world_inverse_inertia.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/inertia/world_inverse_inertia.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,oDARW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,2CAGN,MAAM,MACN,MAAM,MACN,MAAM,QAqDhB"}
1
+ {"version":3,"file":"world_inverse_inertia.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/inertia/world_inverse_inertia.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,oDAVW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,qBACN;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,YAEjC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,MAE5C,MAAM,MACN,MAAM,MACN,MAAM,QA6ChB"}