@woosh/meep-engine 2.138.20 → 2.140.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 (584) 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/core/collection/PairUint32Map.d.ts +100 -0
  6. package/src/core/collection/PairUint32Map.d.ts.map +1 -0
  7. package/src/core/collection/PairUint32Map.js +321 -0
  8. package/src/core/collection/Uint32Map.d.ts +119 -0
  9. package/src/core/collection/Uint32Map.d.ts.map +1 -0
  10. package/src/core/collection/Uint32Map.js +345 -0
  11. package/src/core/collection/array/array_shuffle.d.ts +10 -3
  12. package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
  13. package/src/core/collection/array/array_shuffle.js +27 -22
  14. package/src/core/collection/heap/FibonacciHeap.d.ts +195 -0
  15. package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -0
  16. package/src/core/collection/heap/FibonacciHeap.js +586 -0
  17. package/src/core/collection/heap/Uint32Heap.js +1 -1
  18. package/src/core/collection/heap/Uint32Heap4.d.ts +169 -0
  19. package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -0
  20. package/src/core/collection/heap/Uint32Heap4.js +490 -0
  21. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +30 -0
  22. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -0
  23. package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +93 -0
  24. package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +27 -0
  25. package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -0
  26. package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +88 -0
  27. package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts +54 -0
  28. package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts.map +1 -0
  29. package/src/core/geom/3d/quaternion/quat3_to_matrix3.js +69 -0
  30. package/src/core/geom/3d/shape/AbstractShape3D.d.ts +24 -2
  31. package/src/core/geom/3d/shape/AbstractShape3D.d.ts.map +1 -1
  32. package/src/core/geom/3d/shape/AbstractShape3D.js +24 -1
  33. package/src/core/geom/3d/shape/BoxShape3D.d.ts +61 -0
  34. package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -0
  35. package/src/core/geom/3d/shape/BoxShape3D.js +158 -0
  36. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +11 -0
  37. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
  38. package/src/core/geom/3d/shape/CapsuleShape3D.js +12 -0
  39. package/src/core/geom/3d/shape/HeightMapShape3D.d.ts +148 -0
  40. package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -0
  41. package/src/core/geom/3d/shape/HeightMapShape3D.js +451 -0
  42. package/src/core/geom/3d/shape/MeshShape3D.d.ts +210 -0
  43. package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -0
  44. package/src/core/geom/3d/shape/MeshShape3D.js +593 -0
  45. package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
  46. package/src/core/geom/3d/shape/TransformedShape3D.js +46 -2
  47. package/src/core/geom/3d/shape/Triangle3D.d.ts +95 -0
  48. package/src/core/geom/3d/shape/Triangle3D.d.ts.map +1 -0
  49. package/src/core/geom/3d/shape/Triangle3D.js +318 -0
  50. package/src/core/geom/3d/shape/UnionShape3D.js +13 -0
  51. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +37 -9
  52. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
  53. package/src/core/geom/3d/shape/UnitCubeShape3D.js +45 -98
  54. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +10 -0
  55. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
  56. package/src/core/geom/3d/shape/UnitSphereShape3D.js +11 -0
  57. package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts +30 -0
  58. package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts.map +1 -0
  59. package/src/core/geom/3d/shape/shape_mesh_from_geometry.js +64 -0
  60. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +61 -0
  61. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -0
  62. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +148 -0
  63. package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts +39 -0
  64. package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -0
  65. package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +147 -0
  66. package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +15 -0
  67. package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -0
  68. package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +22 -0
  69. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts +2 -0
  70. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts.map +1 -0
  71. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +671 -0
  72. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts +28 -0
  73. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts.map +1 -0
  74. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.js +48 -0
  75. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts +26 -0
  76. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts.map +1 -0
  77. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +222 -0
  78. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts +34 -0
  79. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts.map +1 -0
  80. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.js +146 -0
  81. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts +36 -0
  82. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -0
  83. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +232 -0
  84. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts +33 -0
  85. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -0
  86. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +255 -0
  87. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts +68 -0
  88. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -0
  89. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +387 -0
  90. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +35 -0
  91. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -0
  92. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +140 -0
  93. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +31 -0
  94. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -0
  95. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +97 -0
  96. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts +32 -0
  97. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts.map +1 -0
  98. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +66 -0
  99. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +41 -0
  100. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
  101. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +124 -13
  102. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +134 -0
  103. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
  104. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +276 -3
  105. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +17 -0
  106. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -0
  107. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +135 -0
  108. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts +14 -0
  109. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts.map +1 -0
  110. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.js +177 -0
  111. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -1
  112. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +20 -4
  113. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
  114. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +5 -3
  115. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -1
  116. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.js +9 -0
  117. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -1
  118. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.js +21 -45
  119. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -1
  120. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.js +7 -1
  121. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts +8 -6
  122. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
  123. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +8 -6
  124. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts +22 -0
  125. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts.map +1 -0
  126. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.js +73 -0
  127. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
  128. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +51 -1
  129. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts +10 -0
  130. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -0
  131. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +42 -0
  132. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts +28 -0
  133. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts.map +1 -0
  134. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +227 -0
  135. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts +13 -0
  136. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts.map +1 -0
  137. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +108 -0
  138. package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +11 -0
  139. package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -0
  140. package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +20 -0
  141. package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +20 -0
  142. package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -0
  143. package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +38 -0
  144. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts +2 -2
  145. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -1
  146. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.js +1 -1
  147. package/src/core/geom/vec3/v3_dot_array_array.d.ts +3 -3
  148. package/src/core/geom/vec3/v3_dot_array_array.d.ts.map +1 -1
  149. package/src/core/geom/vec3/v3_dot_array_array.js +2 -2
  150. package/src/core/geom/vec3/v3_negate_array.d.ts +3 -3
  151. package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -1
  152. package/src/core/geom/vec3/v3_negate_array.js +2 -2
  153. package/src/core/geom/vec3/v3_quat3_apply.d.ts +29 -0
  154. package/src/core/geom/vec3/v3_quat3_apply.d.ts.map +1 -0
  155. package/src/core/geom/vec3/v3_quat3_apply.js +39 -0
  156. package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +30 -0
  157. package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts.map +1 -0
  158. package/src/core/geom/vec3/v3_quat3_apply_inverse.js +41 -0
  159. package/src/core/geom/vec3/v3_triple_cross_product.d.ts +32 -0
  160. package/src/core/geom/vec3/v3_triple_cross_product.d.ts.map +1 -0
  161. package/src/core/geom/vec3/v3_triple_cross_product.js +45 -0
  162. package/src/core/graph/csr/CSRGraph.d.ts +168 -0
  163. package/src/core/graph/csr/CSRGraph.d.ts.map +1 -0
  164. package/src/core/graph/csr/CSRGraph.js +319 -0
  165. package/src/core/graph/metis/cluster_mesh_metis.d.ts +12 -0
  166. package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
  167. package/src/core/graph/metis/cluster_mesh_metis.js +12 -0
  168. package/src/core/graph/metis/metis.d.ts +19 -0
  169. package/src/core/graph/metis/metis.d.ts.map +1 -1
  170. package/src/core/graph/metis/metis.js +20 -0
  171. package/src/core/graph/metis/metis_cluster_bs.d.ts +11 -0
  172. package/src/core/graph/metis/metis_cluster_bs.d.ts.map +1 -1
  173. package/src/core/graph/metis/metis_cluster_bs.js +11 -0
  174. package/src/core/graph/metis/metis_options.d.ts +17 -2
  175. package/src/core/graph/metis/metis_options.d.ts.map +1 -1
  176. package/src/core/graph/metis/metis_options.js +17 -2
  177. package/src/core/graph/metis/native/MetisGraph.d.ts +144 -0
  178. package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -0
  179. package/src/core/graph/metis/native/MetisGraph.js +212 -0
  180. package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +72 -0
  181. package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -0
  182. package/src/core/graph/metis/native/bisection/BisectionScratch.js +101 -0
  183. package/src/core/graph/metis/native/bisection/bisect_graph.d.ts +37 -0
  184. package/src/core/graph/metis/native/bisection/bisect_graph.d.ts.map +1 -0
  185. package/src/core/graph/metis/native/bisection/bisect_graph.js +100 -0
  186. package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts +15 -0
  187. package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -0
  188. package/src/core/graph/metis/native/bisection/compute_2way_params.js +84 -0
  189. package/src/core/graph/metis/native/bisection/fm_2way.d.ts +30 -0
  190. package/src/core/graph/metis/native/bisection/fm_2way.d.ts.map +1 -0
  191. package/src/core/graph/metis/native/bisection/fm_2way.js +290 -0
  192. package/src/core/graph/metis/native/bisection/grow_bisection.d.ts +23 -0
  193. package/src/core/graph/metis/native/bisection/grow_bisection.d.ts.map +1 -0
  194. package/src/core/graph/metis/native/bisection/grow_bisection.js +137 -0
  195. package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts +28 -0
  196. package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts.map +1 -0
  197. package/src/core/graph/metis/native/bisection/split_graph_two_way.js +119 -0
  198. package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts +20 -0
  199. package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts.map +1 -0
  200. package/src/core/graph/metis/native/coarsen/coarsen_graph.js +94 -0
  201. package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts +24 -0
  202. package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts.map +1 -0
  203. package/src/core/graph/metis/native/coarsen/create_coarse_graph.js +158 -0
  204. package/src/core/graph/metis/native/coarsen/match_shem.d.ts +41 -0
  205. package/src/core/graph/metis/native/coarsen/match_shem.d.ts.map +1 -0
  206. package/src/core/graph/metis/native/coarsen/match_shem.js +175 -0
  207. package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts +24 -0
  208. package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts.map +1 -0
  209. package/src/core/graph/metis/native/initial/initial_kway_bfs.js +122 -0
  210. package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts +29 -0
  211. package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts.map +1 -0
  212. package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.js +170 -0
  213. package/src/core/graph/metis/native/metis_partition_kway.d.ts +41 -0
  214. package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -0
  215. package/src/core/graph/metis/native/metis_partition_kway.js +126 -0
  216. package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts +62 -0
  217. package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts.map +1 -0
  218. package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.js +261 -0
  219. package/src/core/graph/metis/native/refine/RefinementScratch.d.ts +45 -0
  220. package/src/core/graph/metis/native/refine/RefinementScratch.d.ts.map +1 -0
  221. package/src/core/graph/metis/native/refine/RefinementScratch.js +53 -0
  222. package/src/core/graph/metis/native/refine/compute_kway_params.d.ts +18 -0
  223. package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -0
  224. package/src/core/graph/metis/native/refine/compute_kway_params.js +138 -0
  225. package/src/core/graph/metis/native/refine/fm_kway.d.ts +63 -0
  226. package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -0
  227. package/src/core/graph/metis/native/refine/fm_kway.js +462 -0
  228. package/src/core/graph/metis/native/refine/project_kway.d.ts +22 -0
  229. package/src/core/graph/metis/native/refine/project_kway.d.ts.map +1 -0
  230. package/src/core/graph/metis/native/refine/project_kway.js +43 -0
  231. package/src/core/graph/metis/native/refine/refine_kway.d.ts +34 -0
  232. package/src/core/graph/metis/native/refine/refine_kway.d.ts.map +1 -0
  233. package/src/core/graph/metis/native/refine/refine_kway.js +43 -0
  234. package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +2 -2
  235. package/src/core/math/linalg/eigen/matrix_householder_in_place.js +2 -2
  236. package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +6 -4
  237. package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
  238. package/src/core/math/linalg/eigen/matrix_qr_in_place.js +69 -23
  239. package/src/engine/EngineHarness.d.ts +3 -1
  240. package/src/engine/EngineHarness.d.ts.map +1 -1
  241. package/src/engine/EngineHarness.js +3 -0
  242. package/src/engine/control/first-person/DESIGN.md +30 -6
  243. package/src/engine/control/first-person/DESIGN_EXTENSIONS.md +563 -0
  244. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +115 -9
  245. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  246. package/src/engine/control/first-person/FirstPersonPlayerController.js +211 -176
  247. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +601 -8
  248. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  249. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +349 -8
  250. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +319 -23
  251. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  252. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +1789 -799
  253. package/src/engine/control/first-person/TODO.md +173 -0
  254. package/src/engine/control/first-person/abilities/Ability.d.ts +101 -0
  255. package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -0
  256. package/src/engine/control/first-person/abilities/Ability.js +119 -0
  257. package/src/engine/control/first-person/abilities/AbilitySet.d.ts +86 -0
  258. package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -0
  259. package/src/engine/control/first-person/abilities/AbilitySet.js +185 -0
  260. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +62 -0
  261. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -0
  262. package/src/engine/control/first-person/abilities/LedgeGrab.js +199 -0
  263. package/src/engine/control/first-person/abilities/Mantle.d.ts +45 -0
  264. package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -0
  265. package/src/engine/control/first-person/abilities/Mantle.js +188 -0
  266. package/src/engine/control/first-person/abilities/Slide.d.ts +33 -0
  267. package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -0
  268. package/src/engine/control/first-person/abilities/Slide.js +166 -0
  269. package/src/engine/control/first-person/abilities/WallJump.d.ts +45 -0
  270. package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -0
  271. package/src/engine/control/first-person/abilities/WallJump.js +131 -0
  272. package/src/engine/control/first-person/abilities/WallRun.d.ts +44 -0
  273. package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -0
  274. package/src/engine/control/first-person/abilities/WallRun.js +180 -0
  275. package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts +49 -0
  276. package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -0
  277. package/src/engine/control/first-person/composer/EyeOffsetStack.js +60 -0
  278. package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +100 -0
  279. package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -0
  280. package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -0
  281. package/src/engine/control/first-person/mastery/DecisionPoint.d.ts +10 -0
  282. package/src/engine/control/first-person/mastery/DecisionPoint.d.ts.map +1 -0
  283. package/src/engine/control/first-person/mastery/DecisionPoint.js +30 -0
  284. package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts +61 -0
  285. package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -0
  286. package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +109 -0
  287. package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts +40 -0
  288. package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -0
  289. package/src/engine/control/first-person/mastery/MasteryEvaluator.js +45 -0
  290. package/src/engine/control/first-person/mastery/MasteryScore.d.ts +68 -0
  291. package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -0
  292. package/src/engine/control/first-person/mastery/MasteryScore.js +100 -0
  293. package/src/engine/control/first-person/mastery/MasterySet.d.ts +60 -0
  294. package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -0
  295. package/src/engine/control/first-person/mastery/MasterySet.js +86 -0
  296. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +58 -0
  297. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -0
  298. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +83 -0
  299. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +69 -0
  300. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -0
  301. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +109 -0
  302. package/src/engine/control/first-person/math/Spring.d.ts +56 -0
  303. package/src/engine/control/first-person/math/Spring.d.ts.map +1 -0
  304. package/src/engine/control/first-person/math/Spring.js +71 -0
  305. package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts +26 -0
  306. package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts.map +1 -0
  307. package/src/engine/control/first-person/math/computeLRCBreathRate.js +41 -0
  308. package/src/engine/control/first-person/math/computeMassRatios.d.ts +35 -0
  309. package/src/engine/control/first-person/math/computeMassRatios.d.ts.map +1 -0
  310. package/src/engine/control/first-person/math/computeMassRatios.js +44 -0
  311. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +31 -1
  312. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -1
  313. package/src/engine/control/first-person/pose/FirstPersonPose.js +49 -3
  314. package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts +7 -0
  315. package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts.map +1 -0
  316. package/src/engine/control/first-person/pose/FirstPersonPosture.js +27 -0
  317. package/src/engine/control/first-person/prototype_first_person_controller.js +637 -120
  318. package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +58 -0
  319. package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -0
  320. package/src/engine/control/first-person/sensors/FirstPersonSensors.js +77 -0
  321. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +80 -0
  322. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -0
  323. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +196 -0
  324. package/src/engine/control/first-person/test/buildTestPlayer.d.ts +20 -0
  325. package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -0
  326. package/src/engine/control/first-person/test/buildTestPlayer.js +36 -0
  327. package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -2
  328. package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
  329. package/src/engine/graphics/ecs/light/Light.js +27 -0
  330. package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
  331. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
  332. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
  333. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +0 -2
  334. package/src/engine/graphics/geometry/CapsuleGeometry.d.ts +42 -0
  335. package/src/engine/graphics/geometry/CapsuleGeometry.d.ts.map +1 -0
  336. package/src/engine/graphics/geometry/CapsuleGeometry.js +171 -0
  337. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
  338. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
  339. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
  340. package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
  341. package/src/engine/navigation/grid/find_path_on_grid_astar.js +11 -2
  342. package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
  343. package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +11 -1
  344. package/src/engine/physics/BULLET_REVIEW.md +945 -0
  345. package/src/engine/physics/CANNON_REVIEW.md +1300 -0
  346. package/src/engine/physics/JOLT_REVIEW.md +913 -0
  347. package/src/engine/physics/PLAN.md +461 -0
  348. package/src/engine/physics/RAPIER_REVIEW.md +934 -0
  349. package/src/engine/physics/REVIEW_001_ACTION_PLAN.md +642 -0
  350. package/src/engine/physics/body/BodyStorage.d.ts +187 -0
  351. package/src/engine/physics/body/BodyStorage.d.ts.map +1 -0
  352. package/src/engine/physics/body/BodyStorage.js +427 -0
  353. package/src/engine/physics/broadphase/PairList.d.ts +62 -0
  354. package/src/engine/physics/broadphase/PairList.d.ts.map +1 -0
  355. package/src/engine/physics/broadphase/PairList.js +97 -0
  356. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +16 -0
  357. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -0
  358. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +61 -0
  359. package/src/engine/physics/broadphase/generate_pairs.d.ts +38 -0
  360. package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -0
  361. package/src/engine/physics/broadphase/generate_pairs.js +101 -0
  362. package/src/engine/physics/contact/ManifoldStore.d.ts +299 -0
  363. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
  364. package/src/engine/physics/contact/ManifoldStore.js +608 -0
  365. package/src/engine/physics/ecs/BodyKind.d.ts +23 -0
  366. package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -0
  367. package/src/engine/physics/ecs/BodyKind.js +24 -0
  368. package/src/engine/physics/ecs/Collider.d.ts +98 -0
  369. package/src/engine/physics/ecs/Collider.d.ts.map +1 -0
  370. package/src/engine/physics/ecs/Collider.js +136 -0
  371. package/src/engine/physics/ecs/ColliderFlags.d.ts +14 -0
  372. package/src/engine/physics/ecs/ColliderFlags.d.ts.map +1 -0
  373. package/src/engine/physics/ecs/ColliderFlags.js +15 -0
  374. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +58 -0
  375. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -0
  376. package/src/engine/physics/ecs/ColliderObserverSystem.js +103 -0
  377. package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +25 -0
  378. package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -0
  379. package/src/engine/physics/ecs/ColliderSerializationAdapter.js +37 -0
  380. package/src/engine/physics/ecs/PhysicsEvents.d.ts +15 -0
  381. package/src/engine/physics/ecs/PhysicsEvents.d.ts.map +1 -0
  382. package/src/engine/physics/ecs/PhysicsEvents.js +16 -0
  383. package/src/engine/physics/ecs/PhysicsSystem.d.ts +628 -0
  384. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
  385. package/src/engine/physics/ecs/PhysicsSystem.js +1301 -0
  386. package/src/engine/physics/ecs/RigidBody.d.ts +197 -0
  387. package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -0
  388. package/src/engine/physics/ecs/RigidBody.js +240 -0
  389. package/src/engine/physics/ecs/RigidBodyFlags.d.ts +21 -0
  390. package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -0
  391. package/src/engine/physics/ecs/RigidBodyFlags.js +22 -0
  392. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +28 -0
  393. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -0
  394. package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +81 -0
  395. package/src/engine/physics/ecs/SleepState.d.ts +11 -0
  396. package/src/engine/physics/ecs/SleepState.d.ts.map +1 -0
  397. package/src/engine/physics/ecs/SleepState.js +12 -0
  398. package/src/engine/physics/events/ContactEventBuffer.d.ts +46 -0
  399. package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -0
  400. package/src/engine/physics/events/ContactEventBuffer.js +83 -0
  401. package/src/engine/physics/events/diff_manifolds.d.ts +25 -0
  402. package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -0
  403. package/src/engine/physics/events/diff_manifolds.js +50 -0
  404. package/src/engine/physics/fluid/FluidField.d.ts +294 -16
  405. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  406. package/src/engine/physics/fluid/FluidField.js +510 -66
  407. package/src/engine/physics/fluid/FluidSimulator.d.ts +188 -5
  408. package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
  409. package/src/engine/physics/fluid/FluidSimulator.js +456 -95
  410. package/src/engine/physics/fluid/SliceVisualiser.d.ts +29 -6
  411. package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
  412. package/src/engine/physics/fluid/SliceVisualiser.js +190 -165
  413. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +154 -0
  414. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -0
  415. package/src/engine/physics/fluid/ecs/FluidComponent.js +238 -0
  416. package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts +45 -0
  417. package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts.map +1 -0
  418. package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.js +89 -0
  419. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +107 -0
  420. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -0
  421. package/src/engine/physics/fluid/ecs/FluidSystem.js +278 -0
  422. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +62 -1
  423. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
  424. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +81 -6
  425. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +17 -4
  426. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  427. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +105 -12
  428. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts +43 -0
  429. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -0
  430. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +210 -0
  431. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +62 -1
  432. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
  433. package/src/engine/physics/fluid/effector/WakeFluidEffector.js +302 -8
  434. package/src/engine/physics/fluid/prototype.js +102 -91
  435. package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts +33 -0
  436. package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +1 -0
  437. package/src/engine/physics/fluid/solver/optimal_sor_omega.js +41 -0
  438. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +20 -5
  439. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
  440. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +60 -38
  441. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +25 -4
  442. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
  443. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +93 -73
  444. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts +23 -0
  445. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts.map +1 -0
  446. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +60 -0
  447. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts +23 -0
  448. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -0
  449. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +68 -0
  450. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +30 -0
  451. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -0
  452. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +66 -0
  453. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts +26 -0
  454. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts.map +1 -0
  455. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.js +113 -0
  456. package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts +30 -0
  457. package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts.map +1 -0
  458. package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.js +107 -0
  459. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +49 -0
  460. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -0
  461. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +126 -0
  462. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +93 -0
  463. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -0
  464. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +424 -0
  465. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +48 -0
  466. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -0
  467. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +92 -0
  468. package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts +6 -6
  469. package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
  470. package/src/engine/physics/gjk/expanding_polytope_algorithm.js +76 -32
  471. package/src/engine/physics/gjk/gjk.d.ts +28 -2
  472. package/src/engine/physics/gjk/gjk.d.ts.map +1 -1
  473. package/src/engine/physics/gjk/gjk.js +421 -378
  474. package/src/engine/physics/gjk/minkowski_support.d.ts +37 -0
  475. package/src/engine/physics/gjk/minkowski_support.d.ts.map +1 -0
  476. package/src/engine/physics/gjk/minkowski_support.js +75 -0
  477. package/src/engine/physics/gjk/mpr.d.ts +56 -0
  478. package/src/engine/physics/gjk/mpr.d.ts.map +1 -0
  479. package/src/engine/physics/gjk/mpr.js +344 -0
  480. package/src/engine/physics/inertia/world_inverse_inertia.d.ts +44 -0
  481. package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
  482. package/src/engine/physics/inertia/world_inverse_inertia.js +77 -0
  483. package/src/engine/physics/integration/integrate_position.d.ts +34 -0
  484. package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
  485. package/src/engine/physics/integration/integrate_position.js +79 -0
  486. package/src/engine/physics/integration/integrate_velocity.d.ts +55 -0
  487. package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
  488. package/src/engine/physics/integration/integrate_velocity.js +160 -0
  489. package/src/engine/physics/integration/quat_integrate.d.ts +27 -0
  490. package/src/engine/physics/integration/quat_integrate.d.ts.map +1 -0
  491. package/src/engine/physics/integration/quat_integrate.js +62 -0
  492. package/src/engine/physics/island/IslandBuilder.d.ts +167 -0
  493. package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -0
  494. package/src/engine/physics/island/IslandBuilder.js +411 -0
  495. package/src/engine/physics/island/union_find.d.ts +51 -0
  496. package/src/engine/physics/island/union_find.d.ts.map +1 -0
  497. package/src/engine/physics/island/union_find.js +76 -0
  498. package/src/engine/physics/narrowphase/PosedShape.d.ts +51 -0
  499. package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
  500. package/src/engine/physics/narrowphase/PosedShape.js +108 -0
  501. package/src/engine/physics/narrowphase/box_box_manifold.d.ts +32 -0
  502. package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -0
  503. package/src/engine/physics/narrowphase/box_box_manifold.js +639 -0
  504. package/src/engine/physics/narrowphase/box_triangle_contact.d.ts +30 -0
  505. package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -0
  506. package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -0
  507. package/src/engine/physics/narrowphase/capsule_contacts.d.ts +122 -0
  508. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -0
  509. package/src/engine/physics/narrowphase/capsule_contacts.js +462 -0
  510. package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts +71 -0
  511. package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -0
  512. package/src/engine/physics/narrowphase/capsule_triangle_contact.js +375 -0
  513. package/src/engine/physics/narrowphase/compute_penetration.d.ts +91 -0
  514. package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -0
  515. package/src/engine/physics/narrowphase/compute_penetration.js +396 -0
  516. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts +35 -0
  517. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +1 -0
  518. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.js +80 -0
  519. package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts +31 -0
  520. package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts.map +1 -0
  521. package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.js +55 -0
  522. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +42 -0
  523. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -0
  524. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +204 -0
  525. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +42 -0
  526. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -0
  527. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +94 -0
  528. package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts +37 -0
  529. package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts.map +1 -0
  530. package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.js +37 -0
  531. package/src/engine/physics/narrowphase/narrowphase_step.d.ts +17 -0
  532. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
  533. package/src/engine/physics/narrowphase/narrowphase_step.js +1422 -0
  534. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts +38 -0
  535. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -0
  536. package/src/engine/physics/narrowphase/sphere_box_contact.js +123 -0
  537. package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts +26 -0
  538. package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts.map +1 -0
  539. package/src/engine/physics/narrowphase/sphere_sphere_contact.js +51 -0
  540. package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts +48 -0
  541. package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts.map +1 -0
  542. package/src/engine/physics/narrowphase/sphere_triangle_contact.js +143 -0
  543. package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts +83 -0
  544. package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -0
  545. package/src/engine/physics/queries/PhysicsSurfacePoint.js +100 -0
  546. package/src/engine/physics/queries/overlap_shape.d.ts +51 -0
  547. package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -0
  548. package/src/engine/physics/queries/overlap_shape.js +183 -0
  549. package/src/engine/physics/queries/raycast.d.ts +20 -0
  550. package/src/engine/physics/queries/raycast.d.ts.map +1 -0
  551. package/src/engine/physics/queries/raycast.js +249 -0
  552. package/src/engine/physics/queries/shape_cast.d.ts +56 -0
  553. package/src/engine/physics/queries/shape_cast.d.ts.map +1 -0
  554. package/src/engine/physics/queries/shape_cast.js +387 -0
  555. package/src/engine/physics/solver/friction_cone.d.ts +16 -0
  556. package/src/engine/physics/solver/friction_cone.d.ts.map +1 -0
  557. package/src/engine/physics/solver/friction_cone.js +37 -0
  558. package/src/engine/physics/solver/solve_contacts.d.ts +122 -0
  559. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
  560. package/src/engine/physics/solver/solve_contacts.js +1016 -0
  561. package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts +0 -34
  562. package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +0 -1
  563. package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.js +0 -66
  564. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts +0 -2
  565. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +0 -1
  566. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.js +0 -54
  567. package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts +0 -2
  568. package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +0 -1
  569. package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.js +0 -26
  570. package/src/engine/ecs/components/Motion.d.ts +0 -21
  571. package/src/engine/ecs/components/Motion.d.ts.map +0 -1
  572. package/src/engine/ecs/components/Motion.js +0 -27
  573. package/src/engine/ecs/components/MotionSerializationAdapter.d.ts +0 -20
  574. package/src/engine/ecs/components/MotionSerializationAdapter.d.ts.map +0 -1
  575. package/src/engine/ecs/components/MotionSerializationAdapter.js +0 -26
  576. package/src/engine/ecs/systems/MotionSystem.d.ts +0 -9
  577. package/src/engine/ecs/systems/MotionSystem.d.ts.map +0 -1
  578. package/src/engine/ecs/systems/MotionSystem.js +0 -29
  579. package/src/engine/physics/fluid/Fluid.d.ts +0 -26
  580. package/src/engine/physics/fluid/Fluid.d.ts.map +0 -1
  581. package/src/engine/physics/fluid/Fluid.js +0 -221
  582. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts +0 -7
  583. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts.map +0 -1
  584. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.js +0 -8
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Integrate `transform.position` and `transform.rotation` from the body's
3
+ * current linear and angular velocity over a step `dt`. Static bodies are
4
+ * not touched.
5
+ *
6
+ * The trailing six arguments are the body's *pseudo-velocity*: the
7
+ * position-pass output from the constraint solver (Catto split-impulse).
8
+ * Pseudo-velocity exists only inside the step — it's folded into the
9
+ * integration so the position update reflects depth correction, then
10
+ * implicitly discarded. The body's persistent `linearVelocity` /
11
+ * `angularVelocity` (which carry restitution + warm-start across steps)
12
+ * are never contaminated by it.
13
+ *
14
+ * Callers with no position-pass output should pass zeros for the six
15
+ * pseudo arguments — folding zero is free (one add per axis).
16
+ *
17
+ * KinematicPosition bodies are treated like Dynamic for the position
18
+ * update — if the gameplay code is driving them, their velocity is
19
+ * whatever the user wrote (typically zero); the step is effectively a
20
+ * no-op in that case. KinematicVelocity bodies advance under their
21
+ * user-set velocity.
22
+ *
23
+ * @param {RigidBody} rb
24
+ * @param {Transform} transform
25
+ * @param {number} dt
26
+ * @param {number} ps_lin_x pseudo-linear-velocity x (0 when no contacts)
27
+ * @param {number} ps_lin_y
28
+ * @param {number} ps_lin_z
29
+ * @param {number} ps_ang_x pseudo-angular-velocity x (0 when no contacts)
30
+ * @param {number} ps_ang_y
31
+ * @param {number} ps_ang_z
32
+ */
33
+ export function integrate_position(rb: RigidBody, transform: Transform, dt: number, ps_lin_x: number, ps_lin_y: number, ps_lin_z: number, ps_ang_x: number, ps_ang_y: number, ps_ang_z: number): void;
34
+ //# sourceMappingURL=integrate_position.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrate_position.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/integration/integrate_position.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,4EARW,MAAM,YACN,MAAM,YACN,MAAM,YACN,MAAM,YACN,MAAM,YACN,MAAM,YACN,MAAM,QA2ChB"}
@@ -0,0 +1,79 @@
1
+ import { BodyKind } from "../ecs/BodyKind.js";
2
+ import { quat_integrate } from "./quat_integrate.js";
3
+
4
+ const scratch_q = new Float64Array(4);
5
+
6
+ /**
7
+ * Integrate `transform.position` and `transform.rotation` from the body's
8
+ * current linear and angular velocity over a step `dt`. Static bodies are
9
+ * not touched.
10
+ *
11
+ * The trailing six arguments are the body's *pseudo-velocity*: the
12
+ * position-pass output from the constraint solver (Catto split-impulse).
13
+ * Pseudo-velocity exists only inside the step — it's folded into the
14
+ * integration so the position update reflects depth correction, then
15
+ * implicitly discarded. The body's persistent `linearVelocity` /
16
+ * `angularVelocity` (which carry restitution + warm-start across steps)
17
+ * are never contaminated by it.
18
+ *
19
+ * Callers with no position-pass output should pass zeros for the six
20
+ * pseudo arguments — folding zero is free (one add per axis).
21
+ *
22
+ * KinematicPosition bodies are treated like Dynamic for the position
23
+ * update — if the gameplay code is driving them, their velocity is
24
+ * whatever the user wrote (typically zero); the step is effectively a
25
+ * no-op in that case. KinematicVelocity bodies advance under their
26
+ * user-set velocity.
27
+ *
28
+ * @param {RigidBody} rb
29
+ * @param {Transform} transform
30
+ * @param {number} dt
31
+ * @param {number} ps_lin_x pseudo-linear-velocity x (0 when no contacts)
32
+ * @param {number} ps_lin_y
33
+ * @param {number} ps_lin_z
34
+ * @param {number} ps_ang_x pseudo-angular-velocity x (0 when no contacts)
35
+ * @param {number} ps_ang_y
36
+ * @param {number} ps_ang_z
37
+ */
38
+ export function integrate_position(
39
+ rb, transform, dt,
40
+ ps_lin_x, ps_lin_y, ps_lin_z,
41
+ ps_ang_x, ps_ang_y, ps_ang_z,
42
+ ) {
43
+ if (rb.kind === BodyKind.Static) {
44
+ return;
45
+ }
46
+
47
+ const lv = rb.linearVelocity;
48
+ const p = transform.position;
49
+
50
+ // Combined integration velocity: persistent + pseudo. The pseudo
51
+ // contribution exists only for this step and never lands in `lv`.
52
+ const vx = lv[0] + ps_lin_x;
53
+ const vy = lv[1] + ps_lin_y;
54
+ const vz = lv[2] + ps_lin_z;
55
+
56
+ // Direct reads via typed-array index; the write goes through .set() so
57
+ // Transform's onChanged subscribers (matrix recompose, parent/child sync,
58
+ // viewport position, fog-of-war reveal) fire once per body per step.
59
+ p.set(
60
+ p[0] + vx * dt,
61
+ p[1] + vy * dt,
62
+ p[2] + vz * dt
63
+ );
64
+
65
+ const av = rb.angularVelocity;
66
+ const wx = av[0] + ps_ang_x;
67
+ const wy = av[1] + ps_ang_y;
68
+ const wz = av[2] + ps_ang_z;
69
+ if (wx !== 0 || wy !== 0 || wz !== 0) {
70
+ const q = transform.rotation;
71
+ quat_integrate(
72
+ scratch_q,
73
+ q[0], q[1], q[2], q[3],
74
+ wx, wy, wz,
75
+ dt
76
+ );
77
+ q.set(scratch_q[0], scratch_q[1], scratch_q[2], scratch_q[3]);
78
+ }
79
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Semi-implicit Euler velocity integration for a single rigid body.
3
+ *
4
+ * For Dynamic bodies:
5
+ * - gravity (scaled by `gravityScale`) and the accumulated force are converted
6
+ * to a velocity delta via `1/mass`,
7
+ * - accumulated torque is converted to angular acceleration via the
8
+ * world-frame inverse inertia (R · diag(I_local) · R^T applied to τ),
9
+ * - linear and angular damping are applied as a stable implicit decay
10
+ * `v *= 1 / (1 + d·dt)` (Box2D / Bullet recipe — never goes negative, no
11
+ * `exp()` call on the hot path),
12
+ * - the force / torque accumulators are zeroed afterwards.
13
+ *
14
+ * Kinematic and Static bodies are skipped — their velocity is the
15
+ * user / animation system's responsibility.
16
+ *
17
+ * @param {RigidBody} rb
18
+ * @param {Transform} transform used to rotate body-frame inertia into world
19
+ * @param {number} gx world gravity x
20
+ * @param {number} gy world gravity y
21
+ * @param {number} gz world gravity z
22
+ * @param {number} dt step size in seconds
23
+ */
24
+ export function integrate_velocity(rb: RigidBody, transform: Transform, gx: number, gy: number, gz: number, dt: number): void;
25
+ /**
26
+ * Apply the accumulated force / torque to velocity over a step `dt`, then
27
+ * zero the accumulators. Gravity and damping are NOT applied here.
28
+ *
29
+ * The "once per outer step" half of the TGS integrator: a user force is a
30
+ * per-frame budget that must land in full exactly once, independent of
31
+ * substep count. Gravity is the continuous field re-applied every substep
32
+ * by {@link integrate_velocity_gravity}.
33
+ *
34
+ * @param {RigidBody} rb
35
+ * @param {Transform} transform used to rotate body-frame inertia into world
36
+ * @param {number} dt full outer-step size in seconds
37
+ */
38
+ export function integrate_velocity_forces(rb: RigidBody, transform: Transform, dt: number): void;
39
+ /**
40
+ * Apply gravity and velocity damping over a (sub)step `dt`. Does NOT touch
41
+ * the force / torque accumulators (consumed once by
42
+ * {@link integrate_velocity_forces}).
43
+ *
44
+ * The "every substep" half of the TGS integrator. Per substep the body sees
45
+ * only `g·h` of gravity, which the per-substep contact warm-start + solve
46
+ * cancels exactly — keeping a resting stack at zero velocity. Damping is the
47
+ * stable implicit decay `v *= 1/(1 + d·dt)` applied at the substep `dt`.
48
+ *
49
+ * @param {RigidBody} rb
50
+ * @param {Transform} transform (unused; signature symmetry with the family)
51
+ * @param {number} gx @param {number} gy @param {number} gz world gravity
52
+ * @param {number} dt sub-step size in seconds
53
+ */
54
+ export function integrate_velocity_gravity(rb: RigidBody, transform: Transform, gx: number, gy: number, gz: number, dt: number): void;
55
+ //# sourceMappingURL=integrate_velocity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrate_velocity.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/integration/integrate_velocity.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,4EALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAoDhB;AAED;;;;;;;;;;;;GAYG;AACH,mFAFW,MAAM,QA6BhB;AAED;;;;;;;;;;;;;;GAcG;AACH,oFAHW,MAAM,MAAa,MAAM,MAAa,MAAM,MAC5C,MAAM,QAwBhB"}
@@ -0,0 +1,160 @@
1
+ import { BodyKind } from "../ecs/BodyKind.js";
2
+ import { world_inverse_inertia_apply } from "../inertia/world_inverse_inertia.js";
3
+
4
+ const scratch_angular = new Float64Array(3);
5
+
6
+ /**
7
+ * Semi-implicit Euler velocity integration for a single rigid body.
8
+ *
9
+ * For Dynamic bodies:
10
+ * - gravity (scaled by `gravityScale`) and the accumulated force are converted
11
+ * to a velocity delta via `1/mass`,
12
+ * - accumulated torque is converted to angular acceleration via the
13
+ * world-frame inverse inertia (R · diag(I_local) · R^T applied to τ),
14
+ * - linear and angular damping are applied as a stable implicit decay
15
+ * `v *= 1 / (1 + d·dt)` (Box2D / Bullet recipe — never goes negative, no
16
+ * `exp()` call on the hot path),
17
+ * - the force / torque accumulators are zeroed afterwards.
18
+ *
19
+ * Kinematic and Static bodies are skipped — their velocity is the
20
+ * user / animation system's responsibility.
21
+ *
22
+ * @param {RigidBody} rb
23
+ * @param {Transform} transform used to rotate body-frame inertia into world
24
+ * @param {number} gx world gravity x
25
+ * @param {number} gy world gravity y
26
+ * @param {number} gz world gravity z
27
+ * @param {number} dt step size in seconds
28
+ */
29
+ export function integrate_velocity(rb, transform, gx, gy, gz, dt) {
30
+ const af = rb.accumulatedForce;
31
+ const at = rb.accumulatedTorque;
32
+
33
+ if (rb.kind !== BodyKind.Dynamic) {
34
+ // Direct indexing — no observer listens to body-internal accumulators.
35
+ af[0] = 0; af[1] = 0; af[2] = 0;
36
+ at[0] = 0; at[1] = 0; at[2] = 0;
37
+ return;
38
+ }
39
+
40
+ const inv_m = rb.mass > 0 ? 1 / rb.mass : 0;
41
+ const gs = rb.gravityScale;
42
+
43
+ // Linear velocity update: v += (F * invM + g * gravityScale) * dt
44
+ const lv = rb.linearVelocity;
45
+ let lvx = lv[0] + (af[0] * inv_m + gx * gs) * dt;
46
+ let lvy = lv[1] + (af[1] * inv_m + gy * gs) * dt;
47
+ let lvz = lv[2] + (af[2] * inv_m + gz * gs) * dt;
48
+
49
+ if (rb.linearDamping > 0) {
50
+ const k = 1 / (1 + rb.linearDamping * dt);
51
+ lvx *= k;
52
+ lvy *= k;
53
+ lvz *= k;
54
+ }
55
+ lv[0] = lvx; lv[1] = lvy; lv[2] = lvz;
56
+
57
+ // Angular velocity update: ω += I_world⁻¹ · τ · dt
58
+ const av = rb.angularVelocity;
59
+ let avx = av[0];
60
+ let avy = av[1];
61
+ let avz = av[2];
62
+ if (at[0] !== 0 || at[1] !== 0 || at[2] !== 0) {
63
+ world_inverse_inertia_apply(scratch_angular, 0, rb.inverseInertiaLocal, transform.rotation, at[0], at[1], at[2]);
64
+ avx += scratch_angular[0] * dt;
65
+ avy += scratch_angular[1] * dt;
66
+ avz += scratch_angular[2] * dt;
67
+ }
68
+
69
+ if (rb.angularDamping > 0) {
70
+ const k = 1 / (1 + rb.angularDamping * dt);
71
+ avx *= k;
72
+ avy *= k;
73
+ avz *= k;
74
+ }
75
+ av[0] = avx; av[1] = avy; av[2] = avz;
76
+
77
+ af[0] = 0; af[1] = 0; af[2] = 0;
78
+ at[0] = 0; at[1] = 0; at[2] = 0;
79
+ }
80
+
81
+ /**
82
+ * Apply the accumulated force / torque to velocity over a step `dt`, then
83
+ * zero the accumulators. Gravity and damping are NOT applied here.
84
+ *
85
+ * The "once per outer step" half of the TGS integrator: a user force is a
86
+ * per-frame budget that must land in full exactly once, independent of
87
+ * substep count. Gravity is the continuous field re-applied every substep
88
+ * by {@link integrate_velocity_gravity}.
89
+ *
90
+ * @param {RigidBody} rb
91
+ * @param {Transform} transform used to rotate body-frame inertia into world
92
+ * @param {number} dt full outer-step size in seconds
93
+ */
94
+ export function integrate_velocity_forces(rb, transform, dt) {
95
+ const af = rb.accumulatedForce;
96
+ const at = rb.accumulatedTorque;
97
+
98
+ if (rb.kind !== BodyKind.Dynamic) {
99
+ af[0] = 0; af[1] = 0; af[2] = 0;
100
+ at[0] = 0; at[1] = 0; at[2] = 0;
101
+ return;
102
+ }
103
+
104
+ const inv_m = rb.mass > 0 ? 1 / rb.mass : 0;
105
+
106
+ const lv = rb.linearVelocity;
107
+ lv[0] += af[0] * inv_m * dt;
108
+ lv[1] += af[1] * inv_m * dt;
109
+ lv[2] += af[2] * inv_m * dt;
110
+
111
+ if (at[0] !== 0 || at[1] !== 0 || at[2] !== 0) {
112
+ world_inverse_inertia_apply(scratch_angular, 0, rb.inverseInertiaLocal, transform.rotation, at[0], at[1], at[2]);
113
+ const av = rb.angularVelocity;
114
+ av[0] += scratch_angular[0] * dt;
115
+ av[1] += scratch_angular[1] * dt;
116
+ av[2] += scratch_angular[2] * dt;
117
+ }
118
+
119
+ af[0] = 0; af[1] = 0; af[2] = 0;
120
+ at[0] = 0; at[1] = 0; at[2] = 0;
121
+ }
122
+
123
+ /**
124
+ * Apply gravity and velocity damping over a (sub)step `dt`. Does NOT touch
125
+ * the force / torque accumulators (consumed once by
126
+ * {@link integrate_velocity_forces}).
127
+ *
128
+ * The "every substep" half of the TGS integrator. Per substep the body sees
129
+ * only `g·h` of gravity, which the per-substep contact warm-start + solve
130
+ * cancels exactly — keeping a resting stack at zero velocity. Damping is the
131
+ * stable implicit decay `v *= 1/(1 + d·dt)` applied at the substep `dt`.
132
+ *
133
+ * @param {RigidBody} rb
134
+ * @param {Transform} transform (unused; signature symmetry with the family)
135
+ * @param {number} gx @param {number} gy @param {number} gz world gravity
136
+ * @param {number} dt sub-step size in seconds
137
+ */
138
+ export function integrate_velocity_gravity(rb, transform, gx, gy, gz, dt) {
139
+ if (rb.kind !== BodyKind.Dynamic) {
140
+ return;
141
+ }
142
+
143
+ const gs = rb.gravityScale;
144
+ const lv = rb.linearVelocity;
145
+ let lvx = lv[0] + gx * gs * dt;
146
+ let lvy = lv[1] + gy * gs * dt;
147
+ let lvz = lv[2] + gz * gs * dt;
148
+
149
+ if (rb.linearDamping > 0) {
150
+ const k = 1 / (1 + rb.linearDamping * dt);
151
+ lvx *= k; lvy *= k; lvz *= k;
152
+ }
153
+ lv[0] = lvx; lv[1] = lvy; lv[2] = lvz;
154
+
155
+ if (rb.angularDamping > 0) {
156
+ const av = rb.angularVelocity;
157
+ const k = 1 / (1 + rb.angularDamping * dt);
158
+ av[0] *= k; av[1] *= k; av[2] *= k;
159
+ }
160
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Advance a unit quaternion `q` by an angular velocity `omega` over a step `dt`,
3
+ * using the first-order formula
4
+ *
5
+ * dq/dt = 0.5 * Omega(omega) * q
6
+ *
7
+ * where `Omega(omega)` is the pure-quaternion `(omega_x, omega_y, omega_z, 0)`.
8
+ * Result is renormalised so the output stays unit.
9
+ *
10
+ * This is the standard semi-implicit angular integrator (Catto GDC 2009 et al.).
11
+ * For typical game-physics step sizes (1/60 s) and angular speeds, the
12
+ * first-order error is dominated by the renormalisation projection back to the
13
+ * unit sphere — closed-form exp via axis-angle would only matter for very large
14
+ * `|omega|·dt`.
15
+ *
16
+ * @param {number[]|Float64Array|Quaternion} result_q destination (may alias `qx..qw`)
17
+ * @param {number} qx
18
+ * @param {number} qy
19
+ * @param {number} qz
20
+ * @param {number} qw
21
+ * @param {number} omega_x
22
+ * @param {number} omega_y
23
+ * @param {number} omega_z
24
+ * @param {number} dt
25
+ */
26
+ export function quat_integrate(result_q: number[] | Float64Array | Quaternion, qx: number, qy: number, qz: number, qw: number, omega_x: number, omega_y: number, omega_z: number, dt: number): void;
27
+ //# sourceMappingURL=quat_integrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quat_integrate.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/integration/quat_integrate.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,yCAVW,MAAM,EAAE,GAAC,YAAY,aAAW,MAChC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,MACN,MAAM,QAsChB"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Advance a unit quaternion `q` by an angular velocity `omega` over a step `dt`,
3
+ * using the first-order formula
4
+ *
5
+ * dq/dt = 0.5 * Omega(omega) * q
6
+ *
7
+ * where `Omega(omega)` is the pure-quaternion `(omega_x, omega_y, omega_z, 0)`.
8
+ * Result is renormalised so the output stays unit.
9
+ *
10
+ * This is the standard semi-implicit angular integrator (Catto GDC 2009 et al.).
11
+ * For typical game-physics step sizes (1/60 s) and angular speeds, the
12
+ * first-order error is dominated by the renormalisation projection back to the
13
+ * unit sphere — closed-form exp via axis-angle would only matter for very large
14
+ * `|omega|·dt`.
15
+ *
16
+ * @param {number[]|Float64Array|Quaternion} result_q destination (may alias `qx..qw`)
17
+ * @param {number} qx
18
+ * @param {number} qy
19
+ * @param {number} qz
20
+ * @param {number} qw
21
+ * @param {number} omega_x
22
+ * @param {number} omega_y
23
+ * @param {number} omega_z
24
+ * @param {number} dt
25
+ */
26
+ export function quat_integrate(
27
+ result_q,
28
+ qx, qy, qz, qw,
29
+ omega_x, omega_y, omega_z,
30
+ dt
31
+ ) {
32
+ const h = 0.5 * dt;
33
+
34
+ const dqx = h * (omega_x * qw + omega_y * qz - omega_z * qy);
35
+ const dqy = h * (omega_y * qw + omega_z * qx - omega_x * qz);
36
+ const dqz = h * (omega_z * qw + omega_x * qy - omega_y * qx);
37
+ const dqw = -h * (omega_x * qx + omega_y * qy + omega_z * qz);
38
+
39
+ let nx = qx + dqx;
40
+ let ny = qy + dqy;
41
+ let nz = qz + dqz;
42
+ let nw = qw + dqw;
43
+
44
+ // Renormalise. Using sqrt (which is bit-exact across IEEE-754 platforms)
45
+ // rather than the (3 - |q|²)/2 cheap-Newton trick — the latter biases
46
+ // length for non-unit inputs.
47
+ const norm_sqr = nx * nx + ny * ny + nz * nz + nw * nw;
48
+ if (norm_sqr > 0) {
49
+ const inv_len = 1 / Math.sqrt(norm_sqr);
50
+ nx *= inv_len;
51
+ ny *= inv_len;
52
+ nz *= inv_len;
53
+ nw *= inv_len;
54
+ } else {
55
+ nx = 0; ny = 0; nz = 0; nw = 1;
56
+ }
57
+
58
+ result_q[0] = nx;
59
+ result_q[1] = ny;
60
+ result_q[2] = nz;
61
+ result_q[3] = nw;
62
+ }
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Partitions this frame's awake dynamic bodies + touched non-sensor contacts
3
+ * into connected components ("islands") via union-find. The solver iterates
4
+ * each island independently (so impulses converge inside an island without
5
+ * waiting for global passes) and the sleep test will eventually use island
6
+ * granularity for atomic whole-island sleep.
7
+ *
8
+ * Static and Kinematic bodies are not merged into islands — they act as
9
+ * constraint anchors. A 1000-block stack on a static floor is therefore one
10
+ * island of 1000 dynamic bodies, not 1001 — the floor anchors the island but
11
+ * does not enlarge it. Multiple separate piles all resting on the same static
12
+ * floor remain *separate* islands so each can sleep/wake independently.
13
+ *
14
+ * Sensor contacts are skipped entirely: they don't transmit constraint
15
+ * forces, so two bodies linked only by a sensor pair are not in the same
16
+ * structural island.
17
+ *
18
+ * Determinism contract:
19
+ * - Union-find uses union-by-min-index + path halving, so the canonical
20
+ * root of any component is the smallest body index of any of its members.
21
+ * - Islands are emitted sorted ascending by root index.
22
+ * - Bodies within an island are emitted sorted ascending by body index.
23
+ * - Contacts within an island are emitted sorted ascending by manifold slot id.
24
+ *
25
+ * Output layout is CSR-like — `body_offsets[i]..body_offsets[i+1]` indexes
26
+ * into `body_data` for island `i`, similarly for contacts.
27
+ *
28
+ * @author Alex Goldring
29
+ * @copyright Company Named Limited (c) 2026
30
+ */
31
+ export class IslandBuilder {
32
+ /**
33
+ * @param {RigidBody} rb
34
+ * @param {Array} collider_list collider list for the body (or undefined)
35
+ * @returns {boolean}
36
+ * @private
37
+ */
38
+ private static __body_is_sensor;
39
+ /**
40
+ * Union-find parent table, indexed by body index (NOT packed id).
41
+ * Sized to `storage.high_water_mark` at `build` time; reallocated by
42
+ * doubling when the body pool grows past current capacity.
43
+ * @type {Uint32Array}
44
+ */
45
+ parent: Uint32Array;
46
+ /**
47
+ * Per-body island id. `island_of_body[idx] === -1` means the body
48
+ * is not in any island this frame (static, kinematic, or unallocated).
49
+ * @type {Int32Array}
50
+ */
51
+ island_of_body: Int32Array;
52
+ /**
53
+ * Number of islands this frame.
54
+ * @type {number}
55
+ */
56
+ island_count: number;
57
+ /**
58
+ * CSR offsets into `body_data`. Length is `island_count + 1`. Bodies
59
+ * for island `i` live in `body_data[body_offsets[i]..body_offsets[i+1])`.
60
+ * @type {Uint32Array}
61
+ */
62
+ body_offsets: Uint32Array;
63
+ /**
64
+ * Flattened body indices, grouped by island, sorted ascending within
65
+ * each island.
66
+ * @type {Uint32Array}
67
+ */
68
+ body_data: Uint32Array;
69
+ /**
70
+ * Total number of body entries across all islands (= sum of island sizes).
71
+ * @type {number}
72
+ */
73
+ body_total: number;
74
+ /**
75
+ * CSR offsets into `contact_data`. Length is `island_count + 1`.
76
+ * Manifold slot ids for island `i` live in
77
+ * `contact_data[contact_offsets[i]..contact_offsets[i+1])`.
78
+ * @type {Uint32Array}
79
+ */
80
+ contact_offsets: Uint32Array;
81
+ /**
82
+ * Flattened manifold slot ids, grouped by island, sorted ascending
83
+ * within each island.
84
+ * @type {Uint32Array}
85
+ */
86
+ contact_data: Uint32Array;
87
+ /**
88
+ * Total number of contact entries across all islands.
89
+ * @type {number}
90
+ */
91
+ contact_total: number;
92
+ /**
93
+ * Scratch: root body index → island id, or -1 if unassigned.
94
+ * Sized in lockstep with `parent`.
95
+ * @private
96
+ * @type {Int32Array}
97
+ */
98
+ private __root_to_island;
99
+ /**
100
+ * Scratch: list of distinct root indices observed this frame, used
101
+ * to sort them ascending before assigning island ids.
102
+ * @private
103
+ * @type {Uint32Array}
104
+ */
105
+ private __scratch_roots;
106
+ /**
107
+ * Scratch write-cursors, one per island.
108
+ * @private
109
+ * @type {Uint32Array}
110
+ */
111
+ private __cursors;
112
+ /**
113
+ * (Re)build islands from `manifolds`' currently-touched non-sensor slots
114
+ * and the bodies in `storage`'s awake list.
115
+ *
116
+ * @param {BodyStorage} storage
117
+ * @param {ManifoldStore} manifolds
118
+ * @param {RigidBody[]} bodies sparse, indexed by body index
119
+ * @param {Array[]} body_collider_lists sparse, indexed by body index
120
+ */
121
+ build(storage: BodyStorage, manifolds: ManifoldStore, bodies: RigidBody[], body_collider_lists: any[][]): void;
122
+ /**
123
+ * Fill `body_offsets` + `body_data` with awake dynamic bodies grouped
124
+ * by island, sorted ascending within each island.
125
+ * @private
126
+ */
127
+ private __build_body_csr;
128
+ /**
129
+ * Fill `contact_offsets` + `contact_data` with touched non-sensor manifold
130
+ * slot ids grouped by island. A contact belongs to its dynamic
131
+ * participant's island (if both sides are dynamic they share an island
132
+ * by construction). Static-vs-static contacts are skipped.
133
+ * @private
134
+ */
135
+ private __build_contact_csr;
136
+ /**
137
+ * Resolve which island a manifold slot belongs to.
138
+ *
139
+ * Returns `-1` if the manifold is not touched this frame, is a sensor
140
+ * pair, or both bodies are non-dynamic (static-static, which the solver
141
+ * wouldn't act on anyway).
142
+ *
143
+ * @private
144
+ */
145
+ private __island_of_slot;
146
+ /**
147
+ * @private
148
+ * @param {number} n
149
+ */
150
+ private __ensure_body_capacity;
151
+ /**
152
+ * @private
153
+ * @param {number} n
154
+ */
155
+ private __ensure_island_count_capacity;
156
+ /**
157
+ * @private
158
+ * @param {number} n
159
+ */
160
+ private __ensure_body_data_capacity;
161
+ /**
162
+ * @private
163
+ * @param {number} n
164
+ */
165
+ private __ensure_contact_data_capacity;
166
+ }
167
+ //# sourceMappingURL=IslandBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IslandBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/island/IslandBuilder.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;IAyFI;;;;;OAKG;IACH,gCAUC;IAtGG;;;;;OAKG;IACH,QAFU,WAAW,CAEY;IAEjC;;;;OAIG;IACH,gBAFU,UAAU,CAEoB;IAExC;;;OAGG;IACH,cAFU,MAAM,CAEK;IAErB;;;;OAIG;IACH,cAFU,WAAW,CAEiB;IAEtC;;;;OAIG;IACH,WAFU,WAAW,CAEe;IAEpC;;;OAGG;IACH,YAFU,MAAM,CAEG;IAEnB;;;;;OAKG;IACH,iBAFU,WAAW,CAEoB;IAEzC;;;;OAIG;IACH,cAFU,WAAW,CAEkB;IAEvC;;;OAGG;IACH,eAFU,MAAM,CAEM;IAEtB;;;;;OAKG;IACH,yBAA0C;IAE1C;;;;;OAKG;IACH,wBAA0C;IAE1C;;;;OAIG;IACH,kBAAmC;IAqBvC;;;;;;;;OAQG;IACH,8DAHW,WAAW,uBACX,OAAO,QAuEjB;IAED;;;;OAIG;IACH,yBA+CC;IAED;;;;;;OAMG;IACH,4BAwCC;IAED;;;;;;;;OAQG;IACH,yBAcC;IAID;;;OAGG;IACH,+BAQC;IAED;;;OAGG;IACH,uCAOC;IAED;;;OAGG;IACH,oCAIC;IAED;;;OAGG;IACH,uCAIC;CACJ"}