@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
@@ -1 +1 @@
1
- {"version":3,"file":"metis.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/metis.js"],"names":[],"mappings":"AAIA;IAQQ,+BAAsB;IAG1B;;;;;;;;;OASG;IACH,sBARW,MAAM,WACN,MAAM,kBACN,WAAW,aACX,WAAW,gBACX,WAAW,2BAET,UAAU,CAkBtB;CACJ;;kBAKS,KAAK;;sCA/CuB,+CAA+C"}
1
+ {"version":3,"file":"metis.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/metis.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH;IAQQ,+BAAsB;IAG1B;;;;;;;;;;;OAWG;IACH,sBARW,MAAM,WACN,MAAM,kBACN,WAAW,aACX,WAAW,gBACX,WAAW,2BAET,UAAU,CAkBtB;CACJ;;kBAMS,KAAK;;sCAnEuB,+CAA+C"}
@@ -2,6 +2,23 @@ import { OnDemandWorkerManager } from "../../process/worker/OnDemandWorkerManage
2
2
  import WorkerBuilder from "../../process/worker/WorkerBuilder.js";
3
3
 
4
4
 
5
+ /**
6
+ * @deprecated Use the native JS implementation at
7
+ * `./native/metis_partition_kway.js` instead.
8
+ *
9
+ * This class wraps the WASM-compiled METIS via a worker. It depends on
10
+ * `libs/metis/metis.js` being served by the host app and on a `micron_partition`
11
+ * global being defined inside that script. The native equivalent has no such
12
+ * dependencies, is synchronous (no worker round-trip), and tracks the latest
13
+ * `KarypisLab/METIS` master rather than the 2013-era 5.1.0 release.
14
+ *
15
+ * Migration:
16
+ * - Was: `await Metis.INSTANCE.partition(nv, k, xadj, adj, ewgt, options)`
17
+ * - Now: `metis_partition_kway(nv, k, xadj, adj, ewgt, { seed, niter, ufactor })`
18
+ *
19
+ * The native function returns the partition array directly (synchronously);
20
+ * wrap in `Promise.resolve(...)` if you need a promise-returning surface.
21
+ */
5
22
  export class Metis {
6
23
  constructor() {
7
24
  const wb = new WorkerBuilder();
@@ -14,6 +31,8 @@ export class Metis {
14
31
  }
15
32
 
16
33
  /**
34
+ * @deprecated Use `metis_partition_kway` from
35
+ * `./native/metis_partition_kway.js` instead.
17
36
  *
18
37
  * @param {number} n_vertices
19
38
  * @param {number} n_parts
@@ -44,6 +63,7 @@ export class Metis {
44
63
 
45
64
  /**
46
65
  * Singleton instance
66
+ * @deprecated Use the native implementation at `./native/metis_partition_kway.js`.
47
67
  * @readonly
48
68
  * @type {Metis}
49
69
  */
@@ -1,4 +1,15 @@
1
1
  /**
2
+ * @deprecated Calls the WASM-backed `Metis.INSTANCE`, which is deprecated. Build
3
+ * the equivalent on top of `metis_partition_kway` from
4
+ * `./native/metis_partition_kway.js` — the binary-search-on-k pattern here is
5
+ * independent of the partitioner, so the same loop body works against either
6
+ * backend.
7
+ *
8
+ * The native partitioner does roughly the same balance enforcement internally
9
+ * via FM with `ub_factor = 1.03`, so the binary search typically converges in
10
+ * 1-2 passes; for many use cases a single `metis_partition_kway` call with
11
+ * `k = Math.ceil(node_count / patch_size)` is sufficient and the BS wrapper is
12
+ * unnecessary.
2
13
  *
3
14
  * @param {Uint32Array} result
4
15
  * @param {number} node_count
@@ -1 +1 @@
1
- {"version":3,"file":"metis_cluster_bs.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/metis_cluster_bs.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,yCARW,WAAW,cACX,MAAM,kBACN,WAAW,oBACX,WAAW,uBACX,WAAW,cACX,MAAM,GACJ,QAAQ,MAAM,CAAC,CA6G3B"}
1
+ {"version":3,"file":"metis_cluster_bs.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/metis_cluster_bs.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yCARW,WAAW,cACX,MAAM,kBACN,WAAW,oBACX,WAAW,uBACX,WAAW,cACX,MAAM,GACJ,QAAQ,MAAM,CAAC,CA6G3B"}
@@ -8,6 +8,17 @@ import { metis_options } from "./metis_options.js";
8
8
  const MAX_STEPS = 50;
9
9
 
10
10
  /**
11
+ * @deprecated Calls the WASM-backed `Metis.INSTANCE`, which is deprecated. Build
12
+ * the equivalent on top of `metis_partition_kway` from
13
+ * `./native/metis_partition_kway.js` — the binary-search-on-k pattern here is
14
+ * independent of the partitioner, so the same loop body works against either
15
+ * backend.
16
+ *
17
+ * The native partitioner does roughly the same balance enforcement internally
18
+ * via FM with `ub_factor = 1.03`, so the binary search typically converges in
19
+ * 1-2 passes; for many use cases a single `metis_partition_kway` call with
20
+ * `k = Math.ceil(node_count / patch_size)` is sufficient and the BS wrapper is
21
+ * unnecessary.
11
22
  *
12
23
  * @param {Uint32Array} result
13
24
  * @param {number} node_count
@@ -1,6 +1,21 @@
1
1
  /**
2
- * See metis.h for more details
3
- * -1 is the used to signal absence of value, in which case a default will be used
2
+ * @deprecated Used only by the deprecated WASM-backed `Metis` class. The
3
+ * native partitioner at `./native/metis_partition_kway.js` accepts a plain
4
+ * object literal instead:
5
+ *
6
+ * metis_partition_kway(nv, k, xadj, adj, ewgt, {
7
+ * seed: 0xCAFE, // integer; default 0
8
+ * niter: 10, // FM passes per level
9
+ * ufactor: 30, // imbalance per-mille
10
+ * initial_partition_strategy: 'recursive_bisection' // or 'bfs'
11
+ * });
12
+ *
13
+ * Most `metis.h` options (ctype, iptype, rtype, no2hop, minconn, contig,
14
+ * compress, ncuts, pfactor, etc.) are not exposed by the native impl because
15
+ * those code paths aren't implemented. If you need one, file a request.
16
+ *
17
+ * See metis.h for more details on the original fields.
18
+ * -1 is used to signal absence of value, in which case a default will be used.
4
19
  */
5
20
  export class metis_options {
6
21
  ptype: number;
@@ -1 +1 @@
1
- {"version":3,"file":"metis_options.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/metis_options.js"],"names":[],"mappings":"AACA;;;GAGG;AACH;IACI,cAAW;IACX,gBAAa;IACb;;;;;OAKG;IACH,OAFU,MAAM,CAEL;IACX,eAAY;IACZ,cAAW;IACX,eAAY;IACZ,cAAW;IACX,cAAW;IACX;;;;OAIG;IACH,MAFU,MAAM,CAEN;IACV,eAAY;IACZ,gBAAa;IACb,eAAY;IACZ,gBAAa;IACb,gBAAa;IACb,cAAW;IACX,gBAAa;IACb,kBAAe;IACf,iBAAe;CAClB"}
1
+ {"version":3,"file":"metis_options.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/metis_options.js"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACI,cAAW;IACX,gBAAa;IACb;;;;;OAKG;IACH,OAFU,MAAM,CAEL;IACX,eAAY;IACZ,cAAW;IACX,eAAY;IACZ,cAAW;IACX,cAAW;IACX;;;;OAIG;IACH,MAFU,MAAM,CAEN;IACV,eAAY;IACZ,gBAAa;IACb,eAAY;IACZ,gBAAa;IACb,gBAAa;IACb,cAAW;IACX,gBAAa;IACb,kBAAe;IACf,iBAAe;CAClB"}
@@ -1,7 +1,22 @@
1
1
 
2
2
  /**
3
- * See metis.h for more details
4
- * -1 is the used to signal absence of value, in which case a default will be used
3
+ * @deprecated Used only by the deprecated WASM-backed `Metis` class. The
4
+ * native partitioner at `./native/metis_partition_kway.js` accepts a plain
5
+ * object literal instead:
6
+ *
7
+ * metis_partition_kway(nv, k, xadj, adj, ewgt, {
8
+ * seed: 0xCAFE, // integer; default 0
9
+ * niter: 10, // FM passes per level
10
+ * ufactor: 30, // imbalance per-mille
11
+ * initial_partition_strategy: 'recursive_bisection' // or 'bfs'
12
+ * });
13
+ *
14
+ * Most `metis.h` options (ctype, iptype, rtype, no2hop, minconn, contig,
15
+ * compress, ncuts, pfactor, etc.) are not exposed by the native impl because
16
+ * those code paths aren't implemented. If you need one, file a request.
17
+ *
18
+ * See metis.h for more details on the original fields.
19
+ * -1 is used to signal absence of value, in which case a default will be used.
5
20
  */
6
21
  export class metis_options {
7
22
  ptype = -1;
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Holds one graph level of the METIS multilevel pipeline.
3
+ *
4
+ * Extends `CSRGraph` — the CSR adjacency (`edge_addresses`, `adjacency`,
5
+ * `edge_weights`, `vertex_weights`) lives in a single shared `ArrayBuffer`.
6
+ *
7
+ * Adds three groups of fields on top of CSR:
8
+ *
9
+ * - **Multilevel link**: `coarse_vertex_map`, `coarser_graph`, `finer_graph`.
10
+ * `coarse_vertex_map[v]` is the id of v's super-vertex one level coarser.
11
+ *
12
+ * - **Partition state**: `vertex_partition`, `partition_weights`, `current_cut`,
13
+ * plus the boundary list (`boundary_count` / `boundary_vertices` /
14
+ * `boundary_position_of_vertex`).
15
+ *
16
+ * - **K-way refinement bookkeeping**: parallel `internal_degree`,
17
+ * `external_degree`, `neighbor_partition_count`, `neighbor_partition_offset`
18
+ * arrays plus the shared `neighbor_partition_pool` of `(partition_id, edge_weight)`
19
+ * records.
20
+ *
21
+ * Partition / refinement arrays are allocated lazily by
22
+ * `allocate_partition_state(partition_count)` because their sizes depend on `k`,
23
+ * which isn't known at CSR construction time and isn't needed during the
24
+ * coarsening or initial-partitioning phases.
25
+ *
26
+ * Volume objective, multi-constraint balance, separator data, and the various
27
+ * minconn/contig auxiliary fields from libmetis `graph_t` are intentionally
28
+ * omitted — they're not on the path we currently use.
29
+ */
30
+ export class MetisGraph extends CSRGraph {
31
+ /**
32
+ * Coarsening map: `coarse_vertex_map[v]` is the id of v's super-vertex
33
+ * in `coarser_graph`. Null until coarsening runs at this level.
34
+ * @type {Uint32Array|null}
35
+ */
36
+ coarse_vertex_map: Uint32Array | null;
37
+ /** @type {MetisGraph|null} */
38
+ coarser_graph: MetisGraph | null;
39
+ /** @type {MetisGraph|null} */
40
+ finer_graph: MetisGraph | null;
41
+ /**
42
+ * Partition id per vertex, in [0, nparts).
43
+ * @type {Uint32Array|null}
44
+ */
45
+ vertex_partition: Uint32Array | null;
46
+ /**
47
+ * Per-partition total weight (sum of `vertex_weights` for vertices
48
+ * currently assigned to that partition).
49
+ * @type {Uint32Array|null}
50
+ */
51
+ partition_weights: Uint32Array | null;
52
+ /**
53
+ * Current edge cut: sum of weights of edges whose endpoints lie in
54
+ * different partitions. Tracked incrementally during refinement.
55
+ * @type {number}
56
+ */
57
+ current_cut: number;
58
+ /**
59
+ * Number of vertices currently on a partition boundary.
60
+ * @type {number}
61
+ */
62
+ boundary_count: number;
63
+ /**
64
+ * Boundary list: the first `boundary_count` entries are vertex ids on
65
+ * a partition boundary. Order is not meaningful (entries get swapped
66
+ * with the tail on removal).
67
+ * @type {Uint32Array|null}
68
+ */
69
+ boundary_vertices: Uint32Array | null;
70
+ /**
71
+ * Inverse of `boundary_vertices`: `boundary_position_of_vertex[v]` is
72
+ * the index of v inside `boundary_vertices`, or -1 if v is interior.
73
+ * Int32Array because of the -1 sentinel.
74
+ * @type {Int32Array|null}
75
+ */
76
+ boundary_position_of_vertex: Int32Array | null;
77
+ /**
78
+ * Internal degree: sum of edge weights from v to vertices in v's own
79
+ * partition. ("id" in METIS / FM literature.)
80
+ * @type {Uint32Array|null}
81
+ */
82
+ internal_degree: Uint32Array | null;
83
+ /**
84
+ * External degree: sum of edge weights from v to vertices in other
85
+ * partitions. ("ed" in METIS / FM literature.)
86
+ * @type {Uint32Array|null}
87
+ */
88
+ external_degree: Uint32Array | null;
89
+ /**
90
+ * Number of distinct neighbouring partitions reachable from v through
91
+ * its edges. ("nnbrs" in METIS.)
92
+ * @type {Uint32Array|null}
93
+ */
94
+ neighbor_partition_count: Uint32Array | null;
95
+ /**
96
+ * Offset (in record units) into `neighbor_partition_pool` for v's list
97
+ * of (partition_id, edge_weight) entries. -1 if v is interior and no
98
+ * pool slot has been allocated yet. ("inbr" in METIS.)
99
+ * @type {Int32Array|null}
100
+ */
101
+ neighbor_partition_offset: Int32Array | null;
102
+ /**
103
+ * Pool of per-(vertex, neighbour-partition) records. Each record is
104
+ * 8 bytes: two uint32 words holding `(partition_id, edge_weight)`.
105
+ * Access record `r` via:
106
+ * const word_base = neighbor_partition_pool.element_word(r);
107
+ * const partition_id = data_uint32[word_base + 2*k ];
108
+ * const edge_weight = data_uint32[word_base + 2*k + 1];
109
+ * where `k` is in `[0, neighbor_partition_count[v])`.
110
+ *
111
+ * ("cnbrpool" in METIS.)
112
+ *
113
+ * @type {BinaryElementPool|null}
114
+ */
115
+ neighbor_partition_pool: BinaryElementPool | null;
116
+ /**
117
+ * Allocate the k-way refinement bookkeeping arrays. Must be called before
118
+ * any of the refinement routines runs on this graph.
119
+ *
120
+ * **`vertex_partition` is preserved** if it's already set with the correct
121
+ * length. This matters when the initial-partition phase has already
122
+ * computed an assignment (e.g. recursive bisection leaves the result in
123
+ * `vertex_partition` as a buffer that's now owned by this graph) — we
124
+ * don't want to allocate a fresh array just to copy the existing one in.
125
+ * If `vertex_partition` is `null` or the wrong size, it gets allocated
126
+ * fresh and zero-filled.
127
+ *
128
+ * Everything else (`partition_weights`, `internal_degree`, etc.) is always
129
+ * allocated fresh because callers expect a clean refinement-state baseline.
130
+ *
131
+ * @param {number} partition_count
132
+ */
133
+ allocate_partition_state(partition_count: number): void;
134
+ /**
135
+ * Reset the partition / refinement bookkeeping in place, leaving the CSR
136
+ * adjacency and `coarse_vertex_map` untouched. Used between FM passes when
137
+ * we want to recompute from a fresh `vertex_partition`.
138
+ */
139
+ reset_refinement_state(): void;
140
+ isMetisGraph: boolean;
141
+ }
142
+ import { CSRGraph } from "../../csr/CSRGraph.js";
143
+ import { BinaryElementPool } from "../../../geom/3d/topology/struct/binary/BinaryElementPool.js";
144
+ //# sourceMappingURL=MetisGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetisGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/core/graph/metis/native/MetisGraph.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IAWQ;;;;OAIG;IACH,mBAFU,WAAW,GAAC,IAAI,CAEG;IAE7B,8BAA8B;IAC9B,eADW,UAAU,GAAC,IAAI,CACD;IACzB,8BAA8B;IAC9B,aADW,UAAU,GAAC,IAAI,CACH;IAIvB;;;OAGG;IACH,kBAFU,WAAW,GAAC,IAAI,CAEE;IAE5B;;;;OAIG;IACH,mBAFU,WAAW,GAAC,IAAI,CAEG;IAE7B;;;;OAIG;IACH,aAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,gBAFU,MAAM,CAEO;IAEvB;;;;;OAKG;IACH,mBAFU,WAAW,GAAC,IAAI,CAEG;IAE7B;;;;;OAKG;IACH,6BAFU,UAAU,GAAC,IAAI,CAEc;IAIvC;;;;OAIG;IACH,iBAFU,WAAW,GAAC,IAAI,CAEC;IAE3B;;;;OAIG;IACH,iBAFU,WAAW,GAAC,IAAI,CAEC;IAE3B;;;;OAIG;IACH,0BAFU,WAAW,GAAC,IAAI,CAEU;IAEpC;;;;;OAKG;IACH,2BAFU,UAAU,GAAC,IAAI,CAEY;IAErC;;;;;;;;;;;;OAYG;IACH,yBAFU,iBAAiB,GAAC,IAAI,CAEG;IAGvC;;;;;;;;;;;;;;;;OAgBG;IACH,0CAFW,MAAM,QAyBhB;IAED;;;;OAIG;IACH,+BAcC;IAGL,sBAAiC;CAFhC;yBA/MwB,uBAAuB;kCADd,8DAA8D"}
@@ -0,0 +1,212 @@
1
+ import { assert } from "../../../assert.js";
2
+ import { BinaryElementPool } from "../../../geom/3d/topology/struct/binary/BinaryElementPool.js";
3
+ import { CSRGraph } from "../../csr/CSRGraph.js";
4
+
5
+ /**
6
+ * Holds one graph level of the METIS multilevel pipeline.
7
+ *
8
+ * Extends `CSRGraph` — the CSR adjacency (`edge_addresses`, `adjacency`,
9
+ * `edge_weights`, `vertex_weights`) lives in a single shared `ArrayBuffer`.
10
+ *
11
+ * Adds three groups of fields on top of CSR:
12
+ *
13
+ * - **Multilevel link**: `coarse_vertex_map`, `coarser_graph`, `finer_graph`.
14
+ * `coarse_vertex_map[v]` is the id of v's super-vertex one level coarser.
15
+ *
16
+ * - **Partition state**: `vertex_partition`, `partition_weights`, `current_cut`,
17
+ * plus the boundary list (`boundary_count` / `boundary_vertices` /
18
+ * `boundary_position_of_vertex`).
19
+ *
20
+ * - **K-way refinement bookkeeping**: parallel `internal_degree`,
21
+ * `external_degree`, `neighbor_partition_count`, `neighbor_partition_offset`
22
+ * arrays plus the shared `neighbor_partition_pool` of `(partition_id, edge_weight)`
23
+ * records.
24
+ *
25
+ * Partition / refinement arrays are allocated lazily by
26
+ * `allocate_partition_state(partition_count)` because their sizes depend on `k`,
27
+ * which isn't known at CSR construction time and isn't needed during the
28
+ * coarsening or initial-partitioning phases.
29
+ *
30
+ * Volume objective, multi-constraint balance, separator data, and the various
31
+ * minconn/contig auxiliary fields from libmetis `graph_t` are intentionally
32
+ * omitted — they're not on the path we currently use.
33
+ */
34
+ export class MetisGraph extends CSRGraph {
35
+ /**
36
+ * @param {number} vertex_count
37
+ * @param {number} adjacency_length total length of the adjacency list (each
38
+ * undirected edge appears twice)
39
+ */
40
+ constructor(vertex_count, adjacency_length) {
41
+ super(vertex_count, adjacency_length);
42
+
43
+ // --- Multilevel links --------------------------------------------------
44
+
45
+ /**
46
+ * Coarsening map: `coarse_vertex_map[v]` is the id of v's super-vertex
47
+ * in `coarser_graph`. Null until coarsening runs at this level.
48
+ * @type {Uint32Array|null}
49
+ */
50
+ this.coarse_vertex_map = null;
51
+
52
+ /** @type {MetisGraph|null} */
53
+ this.coarser_graph = null;
54
+ /** @type {MetisGraph|null} */
55
+ this.finer_graph = null;
56
+
57
+ // --- Partition state --------------------------------------------------
58
+
59
+ /**
60
+ * Partition id per vertex, in [0, nparts).
61
+ * @type {Uint32Array|null}
62
+ */
63
+ this.vertex_partition = null;
64
+
65
+ /**
66
+ * Per-partition total weight (sum of `vertex_weights` for vertices
67
+ * currently assigned to that partition).
68
+ * @type {Uint32Array|null}
69
+ */
70
+ this.partition_weights = null;
71
+
72
+ /**
73
+ * Current edge cut: sum of weights of edges whose endpoints lie in
74
+ * different partitions. Tracked incrementally during refinement.
75
+ * @type {number}
76
+ */
77
+ this.current_cut = 0;
78
+
79
+ /**
80
+ * Number of vertices currently on a partition boundary.
81
+ * @type {number}
82
+ */
83
+ this.boundary_count = 0;
84
+
85
+ /**
86
+ * Boundary list: the first `boundary_count` entries are vertex ids on
87
+ * a partition boundary. Order is not meaningful (entries get swapped
88
+ * with the tail on removal).
89
+ * @type {Uint32Array|null}
90
+ */
91
+ this.boundary_vertices = null;
92
+
93
+ /**
94
+ * Inverse of `boundary_vertices`: `boundary_position_of_vertex[v]` is
95
+ * the index of v inside `boundary_vertices`, or -1 if v is interior.
96
+ * Int32Array because of the -1 sentinel.
97
+ * @type {Int32Array|null}
98
+ */
99
+ this.boundary_position_of_vertex = null;
100
+
101
+ // --- K-way refinement bookkeeping (parallel arrays, indexed by vertex)
102
+
103
+ /**
104
+ * Internal degree: sum of edge weights from v to vertices in v's own
105
+ * partition. ("id" in METIS / FM literature.)
106
+ * @type {Uint32Array|null}
107
+ */
108
+ this.internal_degree = null;
109
+
110
+ /**
111
+ * External degree: sum of edge weights from v to vertices in other
112
+ * partitions. ("ed" in METIS / FM literature.)
113
+ * @type {Uint32Array|null}
114
+ */
115
+ this.external_degree = null;
116
+
117
+ /**
118
+ * Number of distinct neighbouring partitions reachable from v through
119
+ * its edges. ("nnbrs" in METIS.)
120
+ * @type {Uint32Array|null}
121
+ */
122
+ this.neighbor_partition_count = null;
123
+
124
+ /**
125
+ * Offset (in record units) into `neighbor_partition_pool` for v's list
126
+ * of (partition_id, edge_weight) entries. -1 if v is interior and no
127
+ * pool slot has been allocated yet. ("inbr" in METIS.)
128
+ * @type {Int32Array|null}
129
+ */
130
+ this.neighbor_partition_offset = null;
131
+
132
+ /**
133
+ * Pool of per-(vertex, neighbour-partition) records. Each record is
134
+ * 8 bytes: two uint32 words holding `(partition_id, edge_weight)`.
135
+ * Access record `r` via:
136
+ * const word_base = neighbor_partition_pool.element_word(r);
137
+ * const partition_id = data_uint32[word_base + 2*k ];
138
+ * const edge_weight = data_uint32[word_base + 2*k + 1];
139
+ * where `k` is in `[0, neighbor_partition_count[v])`.
140
+ *
141
+ * ("cnbrpool" in METIS.)
142
+ *
143
+ * @type {BinaryElementPool|null}
144
+ */
145
+ this.neighbor_partition_pool = null;
146
+ }
147
+
148
+ /**
149
+ * Allocate the k-way refinement bookkeeping arrays. Must be called before
150
+ * any of the refinement routines runs on this graph.
151
+ *
152
+ * **`vertex_partition` is preserved** if it's already set with the correct
153
+ * length. This matters when the initial-partition phase has already
154
+ * computed an assignment (e.g. recursive bisection leaves the result in
155
+ * `vertex_partition` as a buffer that's now owned by this graph) — we
156
+ * don't want to allocate a fresh array just to copy the existing one in.
157
+ * If `vertex_partition` is `null` or the wrong size, it gets allocated
158
+ * fresh and zero-filled.
159
+ *
160
+ * Everything else (`partition_weights`, `internal_degree`, etc.) is always
161
+ * allocated fresh because callers expect a clean refinement-state baseline.
162
+ *
163
+ * @param {number} partition_count
164
+ */
165
+ allocate_partition_state(partition_count) {
166
+ assert.isNonNegativeInteger(partition_count, 'partition_count');
167
+
168
+ const n = this.vertex_count;
169
+
170
+ if (this.vertex_partition === null || this.vertex_partition.length !== n) {
171
+ this.vertex_partition = new Uint32Array(n);
172
+ }
173
+ this.partition_weights = new Uint32Array(partition_count);
174
+ this.boundary_vertices = new Uint32Array(n);
175
+ this.boundary_position_of_vertex = new Int32Array(n);
176
+ this.boundary_position_of_vertex.fill(-1);
177
+
178
+ this.internal_degree = new Uint32Array(n);
179
+ this.external_degree = new Uint32Array(n);
180
+ this.neighbor_partition_count = new Uint32Array(n);
181
+ this.neighbor_partition_offset = new Int32Array(n);
182
+ this.neighbor_partition_offset.fill(-1);
183
+
184
+ // Each pool record is 8 bytes (uint32 partition_id, uint32 edge_weight).
185
+ // Initial capacity sized to the adjacency length as a rough upper bound;
186
+ // the pool grows on demand.
187
+ this.neighbor_partition_pool = new BinaryElementPool(8, Math.max(64, this.adjacency_length));
188
+ }
189
+
190
+ /**
191
+ * Reset the partition / refinement bookkeeping in place, leaving the CSR
192
+ * adjacency and `coarse_vertex_map` untouched. Used between FM passes when
193
+ * we want to recompute from a fresh `vertex_partition`.
194
+ */
195
+ reset_refinement_state() {
196
+ if (this.internal_degree !== null) {
197
+ this.internal_degree.fill(0);
198
+ this.external_degree.fill(0);
199
+ this.neighbor_partition_count.fill(0);
200
+ this.neighbor_partition_offset.fill(-1);
201
+ }
202
+ if (this.neighbor_partition_pool !== null) {
203
+ this.neighbor_partition_pool.clear();
204
+ }
205
+ if (this.boundary_position_of_vertex !== null) {
206
+ this.boundary_position_of_vertex.fill(-1);
207
+ }
208
+ this.boundary_count = 0;
209
+ }
210
+ }
211
+
212
+ MetisGraph.prototype.isMetisGraph = true;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Pre-allocated scratch reused by every recursive `bisect_graph` call during
3
+ * the initial-partition phase.
4
+ *
5
+ * Recursive bisection produces O(k) subgraphs that each need their own
6
+ * refinement state and FM scratch — but only at sizes <= the coarsest vertex
7
+ * count. Sharing one set of arrays scoped to that maximum eliminates O(k)
8
+ * typed-array allocations and the corresponding GC pressure.
9
+ *
10
+ * Contents:
11
+ *
12
+ * - **Compute-2way state**: `boundary_vertices`, `boundary_position_of_vertex`,
13
+ * `internal_degree`, `external_degree`, `partition_weights[2]`.
14
+ *
15
+ * - **FM-2way state**: `fm_heaps` (one per side of the bisection),
16
+ * `fm_moved_pass_index`, `fm_swap_history`, `fm_insertion_order`.
17
+ *
18
+ * - **Bisect snapshot**: `best_partition_snapshot` for grow+FM trial selection.
19
+ *
20
+ * - **`vertex_partition_pool`**: a stack of vertex_partition arrays. Each
21
+ * recursive call takes a slot (via `take_vertex_partition_slot`) and
22
+ * releases it on return. New slots are allocated lazily, capped at
23
+ * `log2(k)` total — the maximum recursion depth.
24
+ *
25
+ * The two FM heaps are sized to `max_vertex_count` at construction. Their
26
+ * internal `__slot_of_id` table can hold any id in `[0, max_vertex_count)`, so
27
+ * subgraphs of any size below that work without expanding. `clear()` resets
28
+ * heap state in O(size), not O(capacity).
29
+ *
30
+ * `fm_moved_pass_index` starts initialised to -1. fm_2way's per-pass cleanup
31
+ * resets touched entries back to -1, so the invariant is preserved across
32
+ * calls — no need to refill the whole array between bisect_graph invocations.
33
+ */
34
+ export class BisectionScratch {
35
+ /**
36
+ * @param {number} max_vertex_count typically the coarsest graph's vertex count
37
+ */
38
+ constructor(max_vertex_count: number);
39
+ max_vertex_count: number;
40
+ boundary_vertices: Uint32Array;
41
+ boundary_position_of_vertex: Int32Array;
42
+ internal_degree: Uint32Array;
43
+ external_degree: Uint32Array;
44
+ partition_weights: Uint32Array;
45
+ best_partition_snapshot: Uint32Array;
46
+ fm_heaps: IndexedFloatMaxHeap[];
47
+ fm_moved_pass_index: Int32Array;
48
+ fm_swap_history: Uint32Array;
49
+ fm_insertion_order: Uint32Array;
50
+ /** @type {Uint32Array[]} */
51
+ vertex_partition_pool: Uint32Array[];
52
+ vertex_partition_pool_top: number;
53
+ /**
54
+ * Borrow a vertex_partition slot from the pool. The first `vertex_count`
55
+ * entries are zero-filled; values past `vertex_count` may hold stale data
56
+ * from a sibling subgraph and must not be read.
57
+ *
58
+ * Returned slot remains owned by the scratch; release with
59
+ * `release_vertex_partition_slot` once you're done with it.
60
+ *
61
+ * @param {number} vertex_count subgraph's vertex_count
62
+ * @returns {Uint32Array}
63
+ */
64
+ take_vertex_partition_slot(vertex_count: number): Uint32Array;
65
+ /**
66
+ * Pop the top vertex_partition slot off the pool. Pairs with
67
+ * `take_vertex_partition_slot` — call exactly once per take.
68
+ */
69
+ release_vertex_partition_slot(): void;
70
+ }
71
+ import { IndexedFloatMaxHeap } from "../refine/IndexedFloatMaxHeap.js";
72
+ //# sourceMappingURL=BisectionScratch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BisectionScratch.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/graph/metis/native/bisection/BisectionScratch.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IACI;;OAEG;IACH,8BAFW,MAAM,EA8BhB;IA3BG,yBAAwC;IAIxC,+BAA0D;IAC1D,wCAAmE;IACnE,6BAAwD;IACxD,6BAAwD;IACxD,+BAA2C;IAC3C,qCAAgE;IAIhE,gCAGC;IACD,gCAA2D;IAE3D,6BAAwD;IACxD,gCAA2D;IAI3D,4BAA4B;IAC5B,uBADW,WAAW,EAAE,CACO;IAC/B,kCAAkC;IAGtC;;;;;;;;;;OAUG;IACH,yCAHW,MAAM,GACJ,WAAW,CAavB;IAED;;;OAGG;IACH,sCAEC;CACJ;oCApGmC,kCAAkC"}