@woosh/meep-engine 2.155.0 → 2.157.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 (1098) hide show
  1. package/README.md +2 -4
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/build/bundle-worker-terrain.js +1 -1
  4. package/editor/view/ecs/ComponentControlView.d.ts +0 -9
  5. package/editor/view/ecs/ComponentControlView.js +2 -98
  6. package/editor/view/ecs/components/common/AutoCanvasView.js +100 -53
  7. package/editor/view/ecs/components/common/TextController.js +59 -0
  8. package/editor/view/node-graph/NodeGraphCamera.js +90 -0
  9. package/editor/view/node-graph/NodeGraphEditorView.js +121 -22
  10. package/editor/view/node-graph/NodeGraphSelection.js +89 -0
  11. package/editor/view/node-graph/NodeGraphView.js +669 -453
  12. package/editor/view/node-graph/NodeView.js +211 -135
  13. package/editor/view/node-graph/actions/ConnectionCreateAction.js +53 -0
  14. package/editor/view/node-graph/actions/ConnectionDeleteAction.js +36 -0
  15. package/editor/view/node-graph/actions/NodeDeleteAction.js +88 -0
  16. package/editor/view/node-graph/actions/NodeParameterSetAction.js +52 -0
  17. package/editor/view/node-graph/actions/NodesMoveAction.js +41 -0
  18. package/editor/view/node-graph/actions/SelectionSetAction.js +60 -0
  19. package/editor/view/node-graph/connection_wire_geometry.js +107 -0
  20. package/package.json +1 -1
  21. package/samples/generation/SampleGenerator0.js +8 -1
  22. package/src/core/binary/32BitEncoder.js +1 -1
  23. package/src/core/binary/reinterpret_float32_as_uint32.d.ts +7 -0
  24. package/src/core/binary/reinterpret_float32_as_uint32.d.ts.map +1 -0
  25. package/src/core/binary/reinterpret_float32_as_uint32.js +13 -0
  26. package/src/core/binary/reinterpret_uint32_as_float32.d.ts +7 -0
  27. package/src/core/binary/reinterpret_uint32_as_float32.d.ts.map +1 -0
  28. package/src/core/binary/reinterpret_uint32_as_float32.js +14 -0
  29. package/src/core/binary/to_half_float_uint16.js +3 -3
  30. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.d.ts.map +1 -1
  31. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.js +1 -3
  32. package/src/core/bvh2/bvh3/ebvh_build_hierarchy_radix.d.ts.map +1 -1
  33. package/src/core/bvh2/bvh3/ebvh_build_hierarchy_radix.js +275 -253
  34. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.d.ts +12 -0
  35. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.d.ts.map +1 -0
  36. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.js +92 -0
  37. package/src/core/bvh8/BVH8.d.ts +127 -0
  38. package/src/core/bvh8/BVH8.d.ts.map +1 -0
  39. package/src/core/bvh8/BVH8.js +436 -0
  40. package/src/core/bvh8/NOTES.md +63 -0
  41. package/src/core/bvh8/build/BVH8Converter.d.ts +59 -0
  42. package/src/core/bvh8/build/BVH8Converter.d.ts.map +1 -0
  43. package/src/core/bvh8/build/BVH8Converter.js +588 -0
  44. package/src/core/bvh8/build/NodeProxy.d.ts +66 -0
  45. package/src/core/bvh8/build/NodeProxy.d.ts.map +1 -0
  46. package/src/core/bvh8/build/NodeProxy.js +308 -0
  47. package/src/core/bvh8/build/TriangleCluster.d.ts +29 -0
  48. package/src/core/bvh8/build/TriangleCluster.d.ts.map +1 -0
  49. package/src/core/bvh8/build/TriangleCluster.js +123 -0
  50. package/src/core/bvh8/build/aabb3_compute_merge_cost.d.ts +8 -0
  51. package/src/core/bvh8/build/aabb3_compute_merge_cost.d.ts.map +1 -0
  52. package/src/core/bvh8/build/aabb3_compute_merge_cost.js +29 -0
  53. package/src/core/bvh8/build/aabb3_from_triangle_by_index.d.ts +10 -0
  54. package/src/core/bvh8/build/aabb3_from_triangle_by_index.d.ts.map +1 -0
  55. package/src/core/bvh8/build/aabb3_from_triangle_by_index.js +18 -0
  56. package/src/core/bvh8/build/bvh8_build_for_geometry.d.ts +10 -0
  57. package/src/core/bvh8/build/bvh8_build_for_geometry.d.ts.map +1 -0
  58. package/src/core/bvh8/build/bvh8_build_for_geometry.js +303 -0
  59. package/src/core/bvh8/build/bvh8_from_proxy.d.ts +9 -0
  60. package/src/core/bvh8/build/bvh8_from_proxy.d.ts.map +1 -0
  61. package/src/core/bvh8/build/bvh8_from_proxy.js +256 -0
  62. package/src/core/bvh8/build/byte.d.ts +7 -0
  63. package/src/core/bvh8/build/byte.d.ts.map +1 -0
  64. package/src/core/bvh8/build/byte.js +10 -0
  65. package/src/core/bvh8/build/encode_bounds_e.d.ts +9 -0
  66. package/src/core/bvh8/build/encode_bounds_e.d.ts.map +1 -0
  67. package/src/core/bvh8/build/encode_bounds_e.js +12 -0
  68. package/src/core/bvh8/bvh8_convert_to_dot.d.ts +11 -0
  69. package/src/core/bvh8/bvh8_convert_to_dot.d.ts.map +1 -0
  70. package/src/core/bvh8/bvh8_convert_to_dot.js +133 -0
  71. package/src/core/bvh8/bvh8_count_primitives.d.ts +22 -0
  72. package/src/core/bvh8/bvh8_count_primitives.d.ts.map +1 -0
  73. package/src/core/bvh8/bvh8_count_primitives.js +98 -0
  74. package/src/core/bvh8/bvh8_geometry_validate.d.ts +16 -0
  75. package/src/core/bvh8/bvh8_geometry_validate.d.ts.map +1 -0
  76. package/src/core/bvh8/bvh8_geometry_validate.js +149 -0
  77. package/src/core/bvh8/bvh8_geometry_validate_indirect.d.ts +16 -0
  78. package/src/core/bvh8/bvh8_geometry_validate_indirect.d.ts.map +1 -0
  79. package/src/core/bvh8/bvh8_geometry_validate_indirect.js +177 -0
  80. package/src/core/bvh8/bvh8_get_node_bounds.d.ts +9 -0
  81. package/src/core/bvh8/bvh8_get_node_bounds.d.ts.map +1 -0
  82. package/src/core/bvh8/bvh8_get_node_bounds.js +35 -0
  83. package/src/core/bvh8/bvh8_get_node_child_bounds.d.ts +10 -0
  84. package/src/core/bvh8/bvh8_get_node_child_bounds.d.ts.map +1 -0
  85. package/src/core/bvh8/bvh8_get_node_child_bounds.js +53 -0
  86. package/src/core/bvh8/bvh8_node_child_surface_area.d.ts +9 -0
  87. package/src/core/bvh8/bvh8_node_child_surface_area.d.ts.map +1 -0
  88. package/src/core/bvh8/bvh8_node_child_surface_area.js +18 -0
  89. package/src/core/bvh8/bvh8_node_count_triangles.d.ts +8 -0
  90. package/src/core/bvh8/bvh8_node_count_triangles.d.ts.map +1 -0
  91. package/src/core/bvh8/bvh8_node_count_triangles.js +28 -0
  92. package/src/core/bvh8/bvh8_quality.d.ts +8 -0
  93. package/src/core/bvh8/bvh8_quality.d.ts.map +1 -0
  94. package/src/core/bvh8/bvh8_quality.js +73 -0
  95. package/src/core/bvh8/bvh8_validate_structure.d.ts +15 -0
  96. package/src/core/bvh8/bvh8_validate_structure.d.ts.map +1 -0
  97. package/src/core/bvh8/bvh8_validate_structure.js +87 -0
  98. package/src/core/cache/Cache.d.ts.map +1 -1
  99. package/src/core/cache/Cache.js +7 -0
  100. package/src/core/cache/FrequencySketch.d.ts.map +1 -1
  101. package/src/core/cache/FrequencySketch.js +8 -4
  102. package/src/core/clipboard/obtainClipBoard.d.ts +6 -0
  103. package/src/core/clipboard/obtainClipBoard.d.ts.map +1 -0
  104. package/src/core/clipboard/obtainClipBoard.js +29 -0
  105. package/src/core/clipboard/safeClipboardReadText.d.ts +6 -0
  106. package/src/core/clipboard/safeClipboardReadText.d.ts.map +1 -0
  107. package/src/core/clipboard/safeClipboardReadText.js +55 -0
  108. package/src/core/clipboard/safeClipboardWriteText.d.ts +8 -0
  109. package/src/core/clipboard/safeClipboardWriteText.d.ts.map +1 -0
  110. package/src/core/clipboard/safeClipboardWriteText.js +23 -0
  111. package/src/core/collection/Uint32MinHeap.d.ts +56 -0
  112. package/src/core/collection/Uint32MinHeap.d.ts.map +1 -0
  113. package/src/core/collection/Uint32MinHeap.js +109 -0
  114. package/src/core/collection/array/array_quick_sort_by_lookup_map.js +1 -1
  115. package/src/core/collection/array/array_set_diff_sorting.d.ts.map +1 -1
  116. package/src/core/collection/array/array_set_diff_sorting.js +4 -1
  117. package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
  118. package/src/core/collection/array/array_shuffle.js +30 -27
  119. package/src/core/collection/array/binarySearchLowIndex.d.ts.map +1 -1
  120. package/src/core/collection/array/binarySearchLowIndex.js +4 -3
  121. package/src/core/collection/array/typed/array_buffer_hash.js +1 -1
  122. package/src/core/collection/array/typed/is_typed_array_equals.d.ts.map +1 -1
  123. package/src/core/collection/array/typed/is_typed_array_equals.js +12 -2
  124. package/src/core/collection/heap/BinaryHeap.d.ts.map +1 -1
  125. package/src/core/collection/heap/BinaryHeap.js +12 -2
  126. package/src/core/collection/list/FilteredListProjection.js +1 -1
  127. package/src/core/collection/queue/Deque.d.ts.map +1 -1
  128. package/src/core/collection/queue/Deque.js +10 -8
  129. package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
  130. package/src/core/collection/table/RowFirstTable.js +4 -2
  131. package/src/core/collection/table/RowFirstTableSpec.js +2 -2
  132. package/src/{engine/physics/island → core/collection/union-find}/union_find.d.ts +8 -5
  133. package/src/core/collection/union-find/union_find.d.ts.map +1 -0
  134. package/src/{engine/physics/island → core/collection/union-find}/union_find.js +8 -5
  135. package/src/core/color/operations/color_lerp.d.ts.map +1 -1
  136. package/src/core/color/operations/color_lerp.js +10 -3
  137. package/src/core/color/rgb2uint32.js +1 -1
  138. package/src/core/color/rgbe9995_to_rgb.js +1 -1
  139. package/src/core/dom/isImageBitmap.d.ts +7 -0
  140. package/src/core/dom/isImageBitmap.d.ts.map +1 -0
  141. package/src/core/dom/isImageBitmap.js +12 -0
  142. package/src/core/function/frameThrottle.d.ts +8 -0
  143. package/src/core/function/frameThrottle.d.ts.map +1 -0
  144. package/src/core/function/frameThrottle.js +23 -0
  145. package/src/core/function/objectsEqual.d.ts.map +1 -1
  146. package/src/core/function/objectsEqual.js +2 -1
  147. package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
  148. package/src/core/geom/2d/aabb/AABB2.js +12 -11
  149. package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.d.ts.map +1 -1
  150. package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.js +30 -4
  151. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts.map +1 -1
  152. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +6 -2
  153. package/src/core/geom/2d/hash-grid/SpatialHashGrid.d.ts.map +1 -1
  154. package/src/core/geom/2d/hash-grid/SpatialHashGrid.js +388 -386
  155. package/src/core/geom/2d/hash-grid/shg_query_elements_line.d.ts.map +1 -1
  156. package/src/core/geom/2d/hash-grid/shg_query_elements_line.js +8 -3
  157. package/src/{engine/physics/narrowphase/clip_against_axis_uv.d.ts → core/geom/2d/polygon/polygon2_clip_axis_halfplane.d.ts} +3 -3
  158. package/src/core/geom/2d/polygon/polygon2_clip_axis_halfplane.d.ts.map +1 -0
  159. package/src/{engine/physics/narrowphase/clip_against_axis_uv.js → core/geom/2d/polygon/polygon2_clip_axis_halfplane.js} +51 -51
  160. package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
  161. package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +9 -1
  162. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts +3 -1
  163. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts.map +1 -1
  164. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +3 -1
  165. package/src/core/geom/2d/quad-tree-binary/QuadTree.js +714 -714
  166. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
  167. package/src/core/geom/2d/r-tree/StaticR2Tree.js +5 -4
  168. package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.d.ts.map +1 -1
  169. package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +33 -29
  170. package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.d.ts.map +1 -1
  171. package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.js +3 -1
  172. package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.d.ts.map +1 -1
  173. package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.js +10 -7
  174. package/src/{engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts → core/geom/3d/aabb/aabb3_transform_oriented_inverse.d.ts} +9 -7
  175. package/src/core/geom/3d/aabb/aabb3_transform_oriented_inverse.d.ts.map +1 -0
  176. package/src/{engine/physics/narrowphase/decomposition/aabb_world_to_local.js → core/geom/3d/aabb/aabb3_transform_oriented_inverse.js} +9 -7
  177. package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.d.ts.map +1 -1
  178. package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.js +30 -9
  179. package/src/core/geom/3d/aabb/compute_aabb_from_points.js +3 -3
  180. package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.d.ts +12 -0
  181. package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.d.ts.map +1 -0
  182. package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.js +46 -0
  183. package/src/core/geom/3d/box/box3_projected_half_extent.d.ts +28 -0
  184. package/src/core/geom/3d/box/box3_projected_half_extent.d.ts.map +1 -0
  185. package/src/core/geom/3d/box/box3_projected_half_extent.js +35 -0
  186. package/src/core/geom/3d/box/box3_raycast.d.ts +37 -0
  187. package/src/core/geom/3d/box/box3_raycast.d.ts.map +1 -0
  188. package/src/core/geom/3d/box/box3_raycast.js +81 -0
  189. package/src/core/geom/3d/capsule/capsule_raycast.d.ts +35 -0
  190. package/src/core/geom/3d/capsule/capsule_raycast.d.ts.map +1 -0
  191. package/src/core/geom/3d/capsule/capsule_raycast.js +93 -0
  192. package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.d.ts.map +1 -1
  193. package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.js +4 -0
  194. package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
  195. package/src/core/geom/3d/frustum/read_cluster_frustum_corners.js +1 -1
  196. package/src/core/geom/3d/frustum/read_frustum_corner.d.ts +9 -0
  197. package/src/core/geom/3d/frustum/read_frustum_corner.d.ts.map +1 -0
  198. package/src/core/geom/3d/frustum/read_frustum_corner.js +14 -0
  199. package/src/core/geom/3d/gjk/gjk.d.ts.map +1 -0
  200. package/src/{engine/physics → core/geom/3d}/gjk/gjk.js +430 -372
  201. package/src/{engine/physics → core/geom/3d}/gjk/gjk_epa_penetration.d.ts +8 -5
  202. package/src/core/geom/3d/gjk/gjk_epa_penetration.d.ts.map +1 -0
  203. package/src/{engine/physics → core/geom/3d}/gjk/gjk_epa_penetration.js +520 -548
  204. package/src/{engine/physics → core/geom/3d}/gjk/minkowski_support.d.ts +5 -4
  205. package/src/core/geom/3d/gjk/minkowski_support.d.ts.map +1 -0
  206. package/src/{engine/physics → core/geom/3d}/gjk/minkowski_support.js +71 -70
  207. package/src/{engine/physics → core/geom/3d}/gjk/mpr.d.ts +3 -3
  208. package/src/core/geom/3d/gjk/mpr.d.ts.map +1 -0
  209. package/src/{engine/physics → core/geom/3d}/gjk/mpr.js +368 -362
  210. package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts.map +1 -1
  211. package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.js +3 -2
  212. package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts.map +1 -1
  213. package/src/core/geom/3d/mat4/decompose_matrix_4_array.js +12 -2
  214. package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.js +2 -2
  215. package/src/core/geom/3d/mat4/m4_multiply_alphatensor.d.ts +1 -1
  216. package/src/core/geom/3d/mat4/m4_multiply_alphatensor.d.ts.map +1 -1
  217. package/src/core/geom/3d/mat4/m4_multiply_alphatensor.js +19 -13
  218. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.d.ts.map +1 -1
  219. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.js +3 -2
  220. package/src/core/geom/3d/plane/plane3_compute_plane_intersection.js +3 -2
  221. package/src/{engine/physics/integration/quat_integrate.d.ts → core/geom/3d/quaternion/quat3_integrate.d.ts} +2 -2
  222. package/src/core/geom/3d/quaternion/quat3_integrate.d.ts.map +1 -0
  223. package/src/{engine/physics/integration/quat_integrate.js → core/geom/3d/quaternion/quat3_integrate.js} +1 -1
  224. package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -1
  225. package/src/core/geom/3d/shape/MeshShape3D.js +7 -0
  226. package/src/{engine/physics/narrowphase/PosedShape.d.ts → core/geom/3d/shape/PosedShape3D.d.ts} +9 -8
  227. package/src/{engine/physics/narrowphase/PosedShape.d.ts.map → core/geom/3d/shape/PosedShape3D.d.ts.map} +1 -1
  228. package/src/{engine/physics/narrowphase/PosedShape.js → core/geom/3d/shape/PosedShape3D.js} +10 -9
  229. package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
  230. package/src/core/geom/3d/shape/TransformedShape3D.js +15 -11
  231. package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
  232. package/src/core/geom/3d/shape/UnionShape3D.js +3 -2
  233. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -1
  234. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +153 -148
  235. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
  236. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +7 -0
  237. package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.d.ts.map +1 -1
  238. package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.js +13 -10
  239. package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts +1 -1
  240. package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.js +2 -2
  241. package/src/core/geom/3d/sphere/sphere_raycast.d.ts +33 -0
  242. package/src/core/geom/3d/sphere/sphere_raycast.d.ts.map +1 -0
  243. package/src/core/geom/3d/sphere/sphere_raycast.js +47 -0
  244. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts +24 -0
  245. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts.map +1 -0
  246. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.js +39 -0
  247. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.d.ts.map +1 -1
  248. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js +4 -2
  249. package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.js +3 -3
  250. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +1 -1
  251. package/src/core/geom/3d/topology/tm_vertex_compute_normal.d.ts.map +1 -1
  252. package/src/core/geom/3d/topology/tm_vertex_compute_normal.js +4 -2
  253. package/src/core/geom/3d/util/make_justified_point_grid.d.ts.map +1 -1
  254. package/src/core/geom/3d/util/make_justified_point_grid.js +18 -10
  255. package/src/core/geom/ConicRay.d.ts.map +1 -1
  256. package/src/core/geom/ConicRay.js +11 -13
  257. package/src/core/geom/packing/max-rect/removeRedundantBoxes.d.ts.map +1 -1
  258. package/src/core/geom/packing/max-rect/removeRedundantBoxes.js +19 -4
  259. package/src/core/geom/vec3/v3_orthonormal_matrix_from_normal.d.ts.map +1 -0
  260. package/src/{engine/graphics/sh3/path_tracer/sampling → core/geom/vec3}/v3_orthonormal_matrix_from_normal.js +1 -1
  261. package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +1 -1
  262. package/src/core/geom/vec3/v3_quat3_apply_inverse.js +1 -1
  263. package/src/core/graph/coloring/colorizeGraph.js +2 -2
  264. package/src/core/graph/csr/CSRGraph.d.ts.map +1 -1
  265. package/src/core/graph/csr/CSRGraph.js +325 -319
  266. package/src/core/graph/layout/CircleLayout.d.ts.map +1 -1
  267. package/src/core/graph/layout/CircleLayout.js +8 -6
  268. package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -1
  269. package/src/core/graph/metis/native/refine/compute_kway_params.js +139 -138
  270. package/src/core/graph/mn_graph_coarsen.d.ts.map +1 -1
  271. package/src/core/graph/mn_graph_coarsen.js +4 -2
  272. package/src/core/graph/v2/NodeContainer.js +7 -7
  273. package/src/core/localization/LocalizationEngine.js +1 -1
  274. package/src/core/math/bell_membership_function.d.ts.map +1 -1
  275. package/src/core/math/bell_membership_function.js +3 -1
  276. package/src/core/math/complex/complex_add.d.ts +4 -4
  277. package/src/core/math/complex/complex_add.d.ts.map +1 -1
  278. package/src/core/math/complex/complex_add.js +14 -5
  279. package/src/core/math/complex/complex_div.d.ts +4 -4
  280. package/src/core/math/complex/complex_div.d.ts.map +1 -1
  281. package/src/core/math/complex/complex_div.js +13 -6
  282. package/src/core/math/complex/complex_mul.d.ts +4 -4
  283. package/src/core/math/complex/complex_mul.d.ts.map +1 -1
  284. package/src/core/math/complex/complex_mul.js +12 -5
  285. package/src/core/math/complex/complex_sub.d.ts +4 -4
  286. package/src/core/math/complex/complex_sub.d.ts.map +1 -1
  287. package/src/core/math/complex/complex_sub.js +14 -5
  288. package/src/core/math/idct_1d.d.ts +4 -4
  289. package/src/core/math/idct_1d.d.ts.map +1 -1
  290. package/src/core/math/idct_1d.js +3 -3
  291. package/src/{engine/physics/fluid/solver/optimal_sor_omega.d.ts → core/math/linalg/sor_optimal_omega.d.ts} +4 -3
  292. package/src/core/math/linalg/sor_optimal_omega.d.ts.map +1 -0
  293. package/src/{engine/physics/fluid/solver/optimal_sor_omega.js → core/math/linalg/sor_optimal_omega.js} +4 -3
  294. package/src/core/math/lookup/ParameterLookupTable.d.ts +123 -0
  295. package/src/core/math/lookup/ParameterLookupTable.d.ts.map +1 -0
  296. package/src/core/math/lookup/ParameterLookupTable.js +495 -0
  297. package/src/core/math/lookup/ParameterLookupTableFlags.d.ts +5 -0
  298. package/src/core/math/lookup/ParameterLookupTableFlags.d.ts.map +1 -0
  299. package/src/core/math/lookup/ParameterLookupTableFlags.js +6 -0
  300. package/src/core/math/noise/create_simplex_noise_2d.d.ts.map +1 -1
  301. package/src/core/math/noise/create_simplex_noise_2d.js +4 -2
  302. package/src/core/math/noise/sdnoise.d.ts.map +1 -1
  303. package/src/core/math/noise/sdnoise.js +12 -9
  304. package/src/core/math/physics/kinematics/computeInterceptPoint.d.ts.map +1 -0
  305. package/src/{engine/physics → core/math/physics/kinematics}/computeInterceptPoint.js +79 -79
  306. package/src/core/math/physics/mie/compute_bhmie_optical_properties.d.ts.map +1 -1
  307. package/src/core/math/physics/mie/compute_bhmie_optical_properties.js +94 -50
  308. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +3 -6
  309. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
  310. package/src/core/math/physics/mie/lorenz_mie_coefs.js +180 -157
  311. package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts +3 -4
  312. package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts.map +1 -1
  313. package/src/core/math/physics/mie/mie_ab_to_optical_properties.js +47 -21
  314. package/src/core/math/physics/mie/ri_air.d.ts.map +1 -1
  315. package/src/core/math/physics/mie/ri_air.js +1 -3
  316. package/src/core/math/physics/mie/ri_ammonium_sulfate.d.ts.map +1 -1
  317. package/src/core/math/physics/mie/ri_ammonium_sulfate.js +1 -3
  318. package/src/core/math/physics/mie/ri_brine.d.ts.map +1 -1
  319. package/src/core/math/physics/mie/ri_brine.js +1 -3
  320. package/src/core/math/physics/mie/ri_dust.d.ts.map +1 -1
  321. package/src/core/math/physics/mie/ri_dust.js +1 -3
  322. package/src/core/math/physics/mie/ri_pollen.d.ts.map +1 -1
  323. package/src/core/math/physics/mie/ri_pollen.js +1 -3
  324. package/src/core/math/physics/mie/ri_smoke.d.ts.map +1 -1
  325. package/src/core/math/physics/mie/ri_smoke.js +1 -3
  326. package/src/core/math/physics/mie/ri_soot.d.ts.map +1 -1
  327. package/src/core/math/physics/mie/ri_soot.js +1 -3
  328. package/src/core/math/physics/mie/ri_water.d.ts.map +1 -1
  329. package/src/core/math/physics/mie/ri_water.js +1 -3
  330. package/src/core/math/random/randomIntegerBetween.d.ts.map +1 -1
  331. package/src/core/math/random/randomIntegerBetween.js +4 -1
  332. package/src/core/math/random/random_pick_weighted_index.d.ts +10 -0
  333. package/src/core/math/random/random_pick_weighted_index.d.ts.map +1 -0
  334. package/src/core/math/random/random_pick_weighted_index.js +26 -0
  335. package/src/core/math/solveCubic.d.ts.map +1 -1
  336. package/src/core/math/solveCubic.js +95 -82
  337. package/src/core/math/spline/computeCatmullRomSplineUniformDistance.d.ts.map +1 -1
  338. package/src/core/math/spline/computeCatmullRomSplineUniformDistance.js +13 -0
  339. package/src/core/math/statistics/softmax.js +1 -1
  340. package/src/core/model/node-graph/NodeGraph.d.ts +9 -0
  341. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  342. package/src/core/model/node-graph/NodeGraph.js +38 -0
  343. package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts +24 -0
  344. package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts.map +1 -1
  345. package/src/core/model/node-graph/visual/NodeGraphVisualData.js +56 -1
  346. package/src/core/model/node-graph/visual/NodeVisualData.js +1 -1
  347. package/src/core/model/object/ImmutableObjectPool.d.ts +7 -0
  348. package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
  349. package/src/core/model/object/ImmutableObjectPool.js +20 -10
  350. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts.map +1 -1
  351. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +39 -2
  352. package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
  353. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -0
  354. package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
  355. package/src/core/parser/simple/readHexToken.js +6 -0
  356. package/src/core/path/convertPathToURL.d.ts +9 -0
  357. package/src/core/path/convertPathToURL.d.ts.map +1 -0
  358. package/src/core/path/convertPathToURL.js +107 -0
  359. package/src/core/primitives/numbers/number_pretty_print.d.ts.map +1 -1
  360. package/src/core/primitives/numbers/number_pretty_print.js +4 -1
  361. package/src/core/primitives/strings/string_jaro_winkler.js +1 -1
  362. package/src/core/process/CompositeProcess.js +1 -1
  363. package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
  364. package/src/core/process/executor/ConcurrentExecutor.js +3 -2
  365. package/src/core/process/task/util/randomCountTask.d.ts.map +1 -1
  366. package/src/core/process/task/util/randomCountTask.js +3 -1
  367. package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
  368. package/src/core/process/undo/ActionProcessor.js +5 -3
  369. package/src/core/process/worker/WorkerBuilder.js +4 -4
  370. package/src/core/process/worker/extractTransferables.js +1 -1
  371. package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
  372. package/src/engine/animation/curve/AnimationCurve.js +4 -2
  373. package/src/engine/animation/curve/draw/build_tangent_editor.d.ts.map +1 -1
  374. package/src/engine/animation/curve/draw/build_tangent_editor.js +8 -1
  375. package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.d.ts.map +1 -1
  376. package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.js +11 -5
  377. package/src/engine/asset/Asset.d.ts.map +1 -1
  378. package/src/engine/asset/Asset.js +16 -6
  379. package/src/engine/asset/AssetManager.d.ts +61 -52
  380. package/src/engine/asset/AssetManager.d.ts.map +1 -1
  381. package/src/engine/asset/AssetManager.js +1411 -1045
  382. package/src/engine/asset/AssetRequest.d.ts +1 -1
  383. package/src/engine/asset/AssetRequest.d.ts.map +1 -1
  384. package/src/engine/asset/AssetRequest.js +1 -1
  385. package/src/engine/asset/AssetRequestScope.d.ts.map +1 -1
  386. package/src/engine/asset/AssetRequestScope.js +7 -0
  387. package/src/engine/asset/PendingAsset.d.ts +32 -1
  388. package/src/engine/asset/PendingAsset.d.ts.map +1 -1
  389. package/src/engine/asset/PendingAsset.js +108 -61
  390. package/src/engine/asset/loaders/ArrayBufferLoader.js +2 -2
  391. package/src/engine/asset/loaders/AssetLoader.d.ts.map +1 -1
  392. package/src/engine/asset/loaders/AssetLoader.js +19 -2
  393. package/src/engine/asset/loaders/GLTFAssetLoader.d.ts.map +1 -1
  394. package/src/engine/asset/loaders/GLTFAssetLoader.js +123 -114
  395. package/src/engine/asset/loaders/JavascriptAssetLoader.d.ts +1 -1
  396. package/src/engine/asset/loaders/JavascriptAssetLoader.d.ts.map +1 -1
  397. package/src/engine/asset/loaders/JavascriptAssetLoader.js +31 -47
  398. package/src/engine/asset/loaders/JsonAssetLoader.js +1 -1
  399. package/src/engine/asset/loaders/SVGAssetLoader.js +2 -2
  400. package/src/engine/asset/loaders/SoundAssetLoader.js +1 -1
  401. package/src/engine/asset/loaders/TextAssetLoader.js +2 -2
  402. package/src/{core → engine/asset/loaders}/font/FontAsset.d.ts +1 -1
  403. package/src/engine/asset/loaders/font/FontAsset.d.ts.map +1 -0
  404. package/src/{core → engine/asset/loaders}/font/FontAsset.js +21 -21
  405. package/src/{core → engine/asset/loaders}/font/FontAssetLoader.d.ts +1 -1
  406. package/src/engine/asset/loaders/font/FontAssetLoader.d.ts.map +1 -0
  407. package/src/{core → engine/asset/loaders}/font/FontAssetLoader.js +20 -20
  408. package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +1 -1
  409. package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
  410. package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +11 -20
  411. package/src/engine/asset/loaders/texture/TextureAssetLoader.d.ts.map +1 -1
  412. package/src/engine/asset/loaders/texture/TextureAssetLoader.js +8 -2
  413. package/src/engine/asset/preloader/AssetPreloader.js +1 -1
  414. package/src/engine/control/first-person/DESIGN.md +1 -1
  415. package/src/engine/control/first-person/FirstPersonMotionPhase.d.ts +55 -0
  416. package/src/engine/control/first-person/FirstPersonMotionPhase.d.ts.map +1 -0
  417. package/src/engine/control/first-person/FirstPersonMotionPhase.js +134 -0
  418. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +23 -2
  419. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  420. package/src/engine/control/first-person/FirstPersonPlayerController.js +1 -1
  421. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +168 -0
  422. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  423. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +115 -0
  424. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +71 -0
  425. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  426. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +255 -55
  427. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +82 -43
  428. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
  429. package/src/engine/control/first-person/abilities/LedgeGrab.js +405 -213
  430. package/src/engine/control/first-person/abilities/Mantle.d.ts +6 -0
  431. package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -1
  432. package/src/engine/control/first-person/abilities/Mantle.js +104 -45
  433. package/src/engine/control/first-person/abilities/ScrambleUp.d.ts +61 -0
  434. package/src/engine/control/first-person/abilities/ScrambleUp.d.ts.map +1 -0
  435. package/src/engine/control/first-person/abilities/ScrambleUp.js +182 -0
  436. package/src/engine/control/first-person/math/jumpDynamics.d.ts +84 -0
  437. package/src/engine/control/first-person/math/jumpDynamics.d.ts.map +1 -0
  438. package/src/engine/control/first-person/math/jumpDynamics.js +108 -0
  439. package/src/engine/control/first-person/prototype_first_person_controller.js +45 -1
  440. package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.d.ts +1 -1
  441. package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.d.ts.map +1 -1
  442. package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.js +19 -22
  443. package/src/engine/graphics/FrameThrottle.d.ts +1 -7
  444. package/src/engine/graphics/FrameThrottle.d.ts.map +1 -1
  445. package/src/engine/graphics/FrameThrottle.js +2 -24
  446. package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  447. package/src/{core/geom/3d/shape/util → engine/graphics/debug}/shape_to_visual_entity.d.ts +1 -1
  448. package/src/engine/graphics/debug/shape_to_visual_entity.d.ts.map +1 -0
  449. package/src/{core/geom/3d/shape/util → engine/graphics/debug}/shape_to_visual_entity.js +159 -159
  450. package/src/{core/geom/3d/tetrahedra → engine/graphics/debug}/visualize_tetrahedral_mesh.d.ts +1 -1
  451. package/src/engine/graphics/debug/visualize_tetrahedral_mesh.d.ts.map +1 -0
  452. package/src/{core/geom/3d/tetrahedra → engine/graphics/debug}/visualize_tetrahedral_mesh.js +46 -46
  453. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.d.ts +1 -1
  454. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.d.ts.map +1 -1
  455. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.js +22 -32
  456. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  457. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts.map +1 -1
  458. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +2 -76
  459. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts.map +1 -1
  460. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +2 -427
  461. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.d.ts +1 -4
  462. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.d.ts.map +1 -1
  463. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.js +2 -6
  464. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
  465. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
  466. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
  467. package/src/engine/graphics/render/forward_plus/read_frustum_corner.d.ts +1 -8
  468. package/src/engine/graphics/render/forward_plus/read_frustum_corner.d.ts.map +1 -1
  469. package/src/engine/graphics/render/forward_plus/read_frustum_corner.js +2 -14
  470. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
  471. package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts +1 -11
  472. package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts.map +1 -1
  473. package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.js +2 -46
  474. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +1 -1
  475. package/src/engine/graphics/sh3/prototypeSH3Probe.js +1 -1
  476. package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
  477. package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts +27 -0
  478. package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts.map +1 -0
  479. package/src/engine/graphics/texture/3d/scs3d_sample_linear3.js +81 -0
  480. package/src/engine/graphics/texture/isImageBitmap.d.ts +1 -6
  481. package/src/engine/graphics/texture/isImageBitmap.d.ts.map +1 -1
  482. package/src/engine/graphics/texture/isImageBitmap.js +2 -12
  483. package/src/{core/process/action → engine/intelligence/behavior/util}/AsynchronousDelayAction.d.ts +2 -2
  484. package/src/engine/intelligence/behavior/util/AsynchronousDelayAction.d.ts.map +1 -0
  485. package/src/{core/process/action → engine/intelligence/behavior/util}/AsynchronousDelayAction.js +55 -52
  486. package/src/engine/network/NetworkSession.d.ts +12 -1
  487. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  488. package/src/engine/network/NetworkSession.js +52 -1
  489. package/src/engine/network/README.md +45 -0
  490. package/src/engine/network/convertPathToURL.d.ts +1 -8
  491. package/src/engine/network/convertPathToURL.d.ts.map +1 -1
  492. package/src/engine/network/convertPathToURL.js +2 -107
  493. package/src/engine/network/core/quantize/quantize_float.d.ts.map +1 -1
  494. package/src/engine/network/core/quantize/quantize_float.js +7 -0
  495. package/src/engine/network/core/quantize/quantize_position.d.ts.map +1 -1
  496. package/src/engine/network/core/quantize/quantize_position.js +12 -1
  497. package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
  498. package/src/engine/network/orchestrator/NetworkPeer.js +15 -1
  499. package/src/engine/network/replication/Replicator.d.ts +8 -0
  500. package/src/engine/network/replication/Replicator.d.ts.map +1 -1
  501. package/src/engine/network/replication/Replicator.js +48 -0
  502. package/src/engine/network/transport/Channel.d.ts.map +1 -1
  503. package/src/engine/network/transport/Channel.js +46 -12
  504. package/src/engine/network/transport/ReliableCommandPipeline.d.ts +16 -0
  505. package/src/engine/network/transport/ReliableCommandPipeline.d.ts.map +1 -1
  506. package/src/engine/network/transport/ReliableCommandPipeline.js +29 -0
  507. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
  508. package/src/engine/network/transport/adapters/NodeUDPTransport.js +7 -1
  509. package/src/engine/network/transport/fragments/packet_size.d.ts +5 -5
  510. package/src/engine/network/transport/fragments/packet_size.d.ts.map +1 -1
  511. package/src/engine/network/transport/fragments/packet_size.js +5 -5
  512. package/src/engine/physics/BULLET_REVIEW.md +1 -1
  513. package/src/engine/physics/CONSTRAINT_SOLVER_BENCH_LOG.md +208 -0
  514. package/src/engine/physics/CONSTRAINT_SOLVER_IMPROVEMENTS_PLAN.md +364 -0
  515. package/src/engine/physics/JOLT_REVIEW.md +2 -2
  516. package/src/engine/physics/PLAN.md +1094 -944
  517. package/src/engine/physics/RAPIER_REVIEW.md +2 -2
  518. package/src/engine/physics/body/BodyStorage.d.ts +2 -12
  519. package/src/engine/physics/body/BodyStorage.d.ts.map +1 -1
  520. package/src/engine/physics/body/BodyStorage.js +406 -452
  521. package/src/engine/physics/body/SolverBodyState.d.ts.map +1 -1
  522. package/src/engine/physics/body/SolverBodyState.js +12 -3
  523. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +28 -3
  524. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
  525. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +60 -24
  526. package/src/engine/physics/broadphase/generate_pairs.d.ts +9 -5
  527. package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
  528. package/src/engine/physics/broadphase/generate_pairs.js +52 -37
  529. package/src/engine/physics/ccd/linear_sweep.d.ts +15 -5
  530. package/src/engine/physics/ccd/linear_sweep.d.ts.map +1 -1
  531. package/src/engine/physics/ccd/linear_sweep.js +122 -40
  532. package/src/engine/physics/constraint/solve_constraints.d.ts +4 -1
  533. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  534. package/src/engine/physics/constraint/solve_constraints.js +830 -691
  535. package/src/engine/physics/contact/ManifoldStore.d.ts +91 -16
  536. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
  537. package/src/engine/physics/contact/ManifoldStore.js +204 -60
  538. package/src/engine/physics/ecs/BodyKind.d.ts +7 -3
  539. package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -1
  540. package/src/engine/physics/ecs/BodyKind.js +29 -25
  541. package/src/engine/physics/ecs/Collider.d.ts +7 -0
  542. package/src/engine/physics/ecs/Collider.d.ts.map +1 -1
  543. package/src/engine/physics/ecs/Collider.js +7 -0
  544. package/src/engine/physics/ecs/ColliderSerializationAdapter.js +1 -1
  545. package/src/engine/physics/ecs/PhysicsSystem.d.ts +110 -6
  546. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  547. package/src/engine/physics/ecs/PhysicsSystem.js +2172 -1747
  548. package/src/engine/physics/ecs/RigidBody.d.ts +20 -5
  549. package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -1
  550. package/src/engine/physics/ecs/RigidBody.js +307 -286
  551. package/src/engine/physics/ecs/RigidBodyFlags.d.ts +6 -3
  552. package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -1
  553. package/src/engine/physics/ecs/RigidBodyFlags.js +31 -28
  554. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +12 -4
  555. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -1
  556. package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +19 -5
  557. package/src/engine/physics/ecs/RigidBodySerializationUpgrader_0_1.d.ts +10 -0
  558. package/src/engine/physics/ecs/RigidBodySerializationUpgrader_0_1.d.ts.map +1 -0
  559. package/src/engine/physics/ecs/RigidBodySerializationUpgrader_0_1.js +37 -0
  560. package/src/engine/physics/ecs/find_non_finite_physics_state.d.ts +28 -0
  561. package/src/engine/physics/ecs/find_non_finite_physics_state.d.ts.map +1 -0
  562. package/src/engine/physics/ecs/find_non_finite_physics_state.js +76 -0
  563. package/src/engine/physics/events/ContactEventBuffer.d.ts +11 -0
  564. package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -1
  565. package/src/engine/physics/events/ContactEventBuffer.js +40 -0
  566. package/src/engine/physics/events/diff_manifolds.d.ts +30 -13
  567. package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -1
  568. package/src/engine/physics/events/diff_manifolds.js +87 -50
  569. package/src/engine/physics/fluid/FluidField.d.ts +45 -17
  570. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  571. package/src/engine/physics/fluid/FluidField.js +53 -23
  572. package/src/engine/physics/fluid/FluidSimulator.d.ts +141 -5
  573. package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
  574. package/src/engine/physics/fluid/FluidSimulator.js +336 -43
  575. package/src/engine/physics/fluid/REVIEW_02_PLAN.md +114 -0
  576. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +4 -3
  577. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
  578. package/src/engine/physics/fluid/ecs/FluidComponent.js +4 -3
  579. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  580. package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.d.ts +41 -0
  581. package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.d.ts.map +1 -0
  582. package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.js +124 -0
  583. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +27 -8
  584. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
  585. package/src/engine/physics/fluid/effector/WakeFluidEffector.js +67 -18
  586. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.d.ts +42 -0
  587. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.d.ts.map +1 -0
  588. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.js +136 -0
  589. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.d.ts +37 -0
  590. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.d.ts.map +1 -0
  591. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.js +169 -0
  592. package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.d.ts +36 -0
  593. package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.d.ts.map +1 -0
  594. package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.js +100 -0
  595. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +6 -0
  596. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
  597. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +6 -0
  598. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +7 -2
  599. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
  600. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +17 -12
  601. package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.d.ts +42 -0
  602. package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.d.ts.map +1 -0
  603. package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.js +131 -0
  604. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +32 -22
  605. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -1
  606. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +43 -26
  607. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_constant.d.ts +31 -0
  608. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_constant.d.ts.map +1 -0
  609. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_constant.js +77 -0
  610. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +26 -19
  611. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -1
  612. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +46 -42
  613. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +38 -10
  614. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -1
  615. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +158 -75
  616. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +22 -17
  617. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -1
  618. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +108 -96
  619. package/src/engine/physics/inertia/world_inverse_inertia.d.ts +30 -1
  620. package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -1
  621. package/src/engine/physics/inertia/world_inverse_inertia.js +160 -116
  622. package/src/engine/physics/integration/integrate_position.js +97 -97
  623. package/src/engine/physics/island/IslandBuilder.d.ts +49 -8
  624. package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -1
  625. package/src/engine/physics/island/IslandBuilder.js +93 -14
  626. package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -1
  627. package/src/engine/physics/narrowphase/box_box_manifold.js +683 -673
  628. package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -1
  629. package/src/engine/physics/narrowphase/box_triangle_contact.js +899 -749
  630. package/src/engine/physics/narrowphase/capsule_contacts.d.ts +27 -0
  631. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
  632. package/src/engine/physics/narrowphase/capsule_contacts.js +624 -459
  633. package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -1
  634. package/src/engine/physics/narrowphase/capsule_triangle_contact.js +58 -38
  635. package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -1
  636. package/src/engine/physics/narrowphase/compute_penetration.js +369 -325
  637. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts +3 -1
  638. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
  639. package/src/engine/physics/narrowphase/convex_convex_manifold.js +568 -425
  640. package/src/engine/physics/narrowphase/convex_decomposition.d.ts +32 -13
  641. package/src/engine/physics/narrowphase/convex_decomposition.d.ts.map +1 -1
  642. package/src/engine/physics/narrowphase/convex_decomposition.js +61 -65
  643. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +6 -3
  644. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -1
  645. package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +66 -10
  646. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +4 -1
  647. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
  648. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +97 -94
  649. package/src/engine/physics/narrowphase/mesh_convex_hull.d.ts.map +1 -1
  650. package/src/engine/physics/narrowphase/mesh_convex_hull.js +13 -8
  651. package/src/engine/physics/narrowphase/mesh_mesh_tet_manifold.js +117 -117
  652. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  653. package/src/engine/physics/narrowphase/narrowphase_step.js +1738 -1739
  654. package/src/engine/physics/narrowphase/reduce_manifold_contacts.d.ts +14 -7
  655. package/src/engine/physics/narrowphase/reduce_manifold_contacts.d.ts.map +1 -1
  656. package/src/engine/physics/narrowphase/reduce_manifold_contacts.js +74 -69
  657. package/src/engine/physics/narrowphase/refine_ray_concave.d.ts.map +1 -1
  658. package/src/engine/physics/narrowphase/refine_ray_concave.js +5 -3
  659. package/src/engine/physics/narrowphase/refine_ray_hit.d.ts.map +1 -1
  660. package/src/engine/physics/narrowphase/refine_ray_hit.js +81 -78
  661. package/src/engine/physics/persistence/solver_caches.d.ts +20 -0
  662. package/src/engine/physics/persistence/solver_caches.d.ts.map +1 -0
  663. package/src/engine/physics/persistence/solver_caches.js +309 -0
  664. package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -1
  665. package/src/engine/physics/queries/overlap_shape.js +187 -184
  666. package/src/engine/physics/queries/raycast.d.ts +3 -2
  667. package/src/engine/physics/queries/raycast.d.ts.map +1 -1
  668. package/src/engine/physics/queries/raycast.js +37 -11
  669. package/src/engine/physics/queries/shape_cast.d.ts +18 -5
  670. package/src/engine/physics/queries/shape_cast.d.ts.map +1 -1
  671. package/src/engine/physics/queries/shape_cast.js +417 -393
  672. package/src/engine/physics/solver/solve_contacts.d.ts +22 -6
  673. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
  674. package/src/engine/physics/solver/solve_contacts.js +1482 -1338
  675. package/src/engine/physics/vehicle/RaycastVehicle.d.ts.map +1 -1
  676. package/src/engine/physics/vehicle/RaycastVehicle.js +344 -339
  677. package/src/engine/sound/SoundEngine.d.ts.map +1 -1
  678. package/src/engine/sound/SoundEngine.js +28 -0
  679. package/src/engine/sound/dB2Volume.d.ts +1 -1
  680. package/src/engine/sound/dB2Volume.d.ts.map +1 -1
  681. package/src/engine/sound/dB2Volume.js +1 -1
  682. package/src/engine/sound/ecs/SoundController.d.ts +4 -0
  683. package/src/engine/sound/ecs/SoundController.d.ts.map +1 -1
  684. package/src/engine/sound/ecs/SoundController.js +4 -0
  685. package/src/engine/sound/ecs/SoundControllerSystem.d.ts +5 -0
  686. package/src/engine/sound/ecs/SoundControllerSystem.d.ts.map +1 -1
  687. package/src/engine/sound/ecs/SoundControllerSystem.js +5 -0
  688. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +69 -0
  689. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -0
  690. package/src/engine/sound/ecs/audio/AudioEmitter.js +83 -0
  691. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +97 -0
  692. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -0
  693. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +238 -0
  694. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +90 -0
  695. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -0
  696. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +324 -0
  697. package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts +59 -0
  698. package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts.map +1 -0
  699. package/src/engine/sound/ecs/audio/SpatialAudioIndex.js +140 -0
  700. package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts +16 -65
  701. package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts.map +1 -1
  702. package/src/engine/sound/ecs/emitter/SoundEmitter.js +19 -224
  703. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts +26 -29
  704. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts.map +1 -1
  705. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +168 -135
  706. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +36 -59
  707. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
  708. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +154 -390
  709. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +20 -23
  710. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
  711. package/src/engine/sound/ecs/emitter/SoundTrack.js +34 -152
  712. package/src/engine/sound/sopra/IMPLEMENTATION_PLAN.md +993 -0
  713. package/src/engine/sound/sopra/README.md +643 -7
  714. package/src/engine/sound/sopra/SopraEngine.d.ts +229 -0
  715. package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -0
  716. package/src/engine/sound/sopra/SopraEngine.js +423 -0
  717. package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.d.ts +26 -0
  718. package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.d.ts.map +1 -0
  719. package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.js +71 -0
  720. package/src/engine/sound/sopra/asset/BufferProvider.d.ts +24 -0
  721. package/src/engine/sound/sopra/asset/BufferProvider.d.ts.map +1 -0
  722. package/src/engine/sound/sopra/asset/BufferProvider.js +29 -0
  723. package/src/engine/sound/sopra/asset/StubBufferProvider.d.ts +31 -0
  724. package/src/engine/sound/sopra/asset/StubBufferProvider.d.ts.map +1 -0
  725. package/src/engine/sound/sopra/asset/StubBufferProvider.js +58 -0
  726. package/src/engine/sound/sopra/definition/BusDefinition.d.ts +83 -0
  727. package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -0
  728. package/src/engine/sound/sopra/definition/BusDefinition.js +142 -0
  729. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts +17 -0
  730. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts.map +1 -0
  731. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.js +54 -0
  732. package/src/engine/sound/sopra/definition/DuckingRule.d.ts +71 -0
  733. package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -0
  734. package/src/engine/sound/sopra/definition/DuckingRule.js +106 -0
  735. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts +18 -0
  736. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts.map +1 -0
  737. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.js +31 -0
  738. package/src/engine/sound/sopra/definition/EventDescription.d.ts +132 -0
  739. package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -0
  740. package/src/engine/sound/sopra/definition/EventDescription.js +259 -0
  741. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +17 -0
  742. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -0
  743. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +71 -0
  744. package/src/engine/sound/sopra/definition/MixerSnapshot.d.ts +51 -0
  745. package/src/engine/sound/sopra/definition/MixerSnapshot.d.ts.map +1 -0
  746. package/src/engine/sound/sopra/definition/MixerSnapshot.js +83 -0
  747. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts +18 -0
  748. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts.map +1 -0
  749. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.js +39 -0
  750. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts +72 -0
  751. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -0
  752. package/src/engine/sound/sopra/definition/ParameterDefinition.js +117 -0
  753. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts +18 -0
  754. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts.map +1 -0
  755. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.js +31 -0
  756. package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts +14 -0
  757. package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts.map +1 -0
  758. package/src/engine/sound/sopra/definition/SopraPanningModel.js +20 -0
  759. package/src/engine/sound/sopra/definition/VoiceStealMode.d.ts +10 -0
  760. package/src/engine/sound/sopra/definition/VoiceStealMode.d.ts.map +1 -0
  761. package/src/engine/sound/sopra/definition/VoiceStealMode.js +18 -0
  762. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.d.ts +93 -0
  763. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.d.ts.map +1 -0
  764. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +109 -0
  765. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts +80 -0
  766. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -0
  767. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +181 -0
  768. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts +17 -0
  769. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  770. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.js +74 -0
  771. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.d.ts +34 -0
  772. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.d.ts.map +1 -0
  773. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +100 -0
  774. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts +101 -0
  775. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts.map +1 -0
  776. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +230 -0
  777. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts +17 -0
  778. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  779. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.js +54 -0
  780. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts +103 -0
  781. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -0
  782. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +191 -0
  783. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts +18 -0
  784. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts.map +1 -0
  785. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.js +39 -0
  786. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.d.ts +40 -0
  787. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.d.ts.map +1 -0
  788. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.js +91 -0
  789. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts +17 -0
  790. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  791. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.js +42 -0
  792. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.d.ts +44 -0
  793. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.d.ts.map +1 -0
  794. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +77 -0
  795. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts +18 -0
  796. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts.map +1 -0
  797. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.js +27 -0
  798. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +65 -0
  799. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -0
  800. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +131 -0
  801. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts +17 -0
  802. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  803. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.js +41 -0
  804. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +24 -0
  805. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -0
  806. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +24 -0
  807. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +70 -0
  808. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -0
  809. package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +120 -0
  810. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts +18 -0
  811. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts.map +1 -0
  812. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.js +31 -0
  813. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +74 -0
  814. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -0
  815. package/src/engine/sound/sopra/definition/effect/EqEffect.js +128 -0
  816. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts +18 -0
  817. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts.map +1 -0
  818. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.js +29 -0
  819. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +49 -0
  820. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -0
  821. package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +101 -0
  822. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts +18 -0
  823. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts.map +1 -0
  824. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.js +25 -0
  825. package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts +31 -0
  826. package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts.map +1 -0
  827. package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.js +106 -0
  828. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +79 -0
  829. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -0
  830. package/src/engine/sound/sopra/runtime/BusGraph.js +227 -0
  831. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +144 -0
  832. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -0
  833. package/src/engine/sound/sopra/runtime/EventInstance.js +579 -0
  834. package/src/engine/sound/sopra/runtime/ParameterStore.d.ts +42 -0
  835. package/src/engine/sound/sopra/runtime/ParameterStore.d.ts.map +1 -0
  836. package/src/engine/sound/sopra/runtime/ParameterStore.js +98 -0
  837. package/src/engine/sound/sopra/runtime/SopraPlaybackContext.d.ts +42 -0
  838. package/src/engine/sound/sopra/runtime/SopraPlaybackContext.d.ts.map +1 -0
  839. package/src/engine/sound/sopra/runtime/SopraPlaybackContext.js +68 -0
  840. package/src/engine/sound/sopra/runtime/Voice.d.ts +67 -0
  841. package/src/engine/sound/sopra/runtime/Voice.d.ts.map +1 -0
  842. package/src/engine/sound/sopra/runtime/Voice.js +145 -0
  843. package/src/engine/sound/sopra/runtime/VoiceManager.d.ts +38 -0
  844. package/src/engine/sound/sopra/runtime/VoiceManager.d.ts.map +1 -0
  845. package/src/engine/sound/sopra/runtime/VoiceManager.js +136 -0
  846. package/src/engine/sound/sopra/runtime/VoicePool.d.ts +12 -0
  847. package/src/engine/sound/sopra/runtime/VoicePool.d.ts.map +1 -0
  848. package/src/engine/sound/sopra/runtime/VoicePool.js +17 -0
  849. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +11 -0
  850. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -0
  851. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +42 -0
  852. package/src/engine/sound/sopra/serialization/sopraJSON.d.ts +33 -0
  853. package/src/engine/sound/sopra/serialization/sopraJSON.d.ts.map +1 -0
  854. package/src/engine/sound/sopra/serialization/sopraJSON.js +99 -0
  855. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +27 -0
  856. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -0
  857. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +49 -0
  858. package/src/engine/sound/sopra/util/MockAudioContext.d.ts +74 -0
  859. package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -0
  860. package/src/engine/sound/sopra/util/MockAudioContext.js +215 -0
  861. package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts +15 -0
  862. package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts.map +1 -0
  863. package/src/engine/sound/sopra/util/buildAttenuationCurve.js +40 -0
  864. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +34 -0
  865. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -0
  866. package/src/engine/sound/sopra/util/fadeOutAndStop.js +60 -0
  867. package/src/engine/sound/volume2dB.d.ts +1 -1
  868. package/src/engine/sound/volume2dB.d.ts.map +1 -1
  869. package/src/engine/sound/volume2dB.js +1 -1
  870. package/src/engine/ui/DraggableAspect.d.ts +12 -3
  871. package/src/engine/ui/DraggableAspect.d.ts.map +1 -1
  872. package/src/engine/ui/DraggableAspect.js +115 -83
  873. package/src/generation/COORDINATES.md +54 -0
  874. package/src/generation/GridTaskGroup.js +2 -2
  875. package/src/generation/REVIEW_01_ACTION_PLAN.md +628 -0
  876. package/src/generation/automata/CaveGeneratorCellularAutomata.d.ts +9 -1
  877. package/src/generation/automata/CaveGeneratorCellularAutomata.d.ts.map +1 -1
  878. package/src/generation/automata/CaveGeneratorCellularAutomata.js +79 -59
  879. package/src/generation/automata/CellularAutomata.d.ts +6 -3
  880. package/src/generation/automata/CellularAutomata.d.ts.map +1 -1
  881. package/src/generation/automata/CellularAutomata.js +22 -19
  882. package/src/generation/filtering/CellFilter.d.ts +17 -0
  883. package/src/generation/filtering/CellFilter.d.ts.map +1 -1
  884. package/src/generation/filtering/CellFilter.js +117 -77
  885. package/src/generation/filtering/CellFilterCellMatcher.d.ts.map +1 -1
  886. package/src/generation/filtering/CellFilterCellMatcher.js +2 -0
  887. package/src/generation/filtering/boolean/CellFilterLiteralBoolean.d.ts +5 -0
  888. package/src/generation/filtering/boolean/CellFilterLiteralBoolean.d.ts.map +1 -1
  889. package/src/generation/filtering/boolean/CellFilterLiteralBoolean.js +15 -0
  890. package/src/generation/filtering/core/CellFilterBinaryOperation.d.ts +0 -1
  891. package/src/generation/filtering/core/CellFilterBinaryOperation.d.ts.map +1 -1
  892. package/src/generation/filtering/core/CellFilterBinaryOperation.js +37 -50
  893. package/src/generation/filtering/core/CellFilterOperationTertiary.d.ts +0 -1
  894. package/src/generation/filtering/core/CellFilterOperationTertiary.d.ts.map +1 -1
  895. package/src/generation/filtering/core/CellFilterOperationTertiary.js +43 -59
  896. package/src/generation/filtering/core/CellFilterUnaryOperation.d.ts +0 -1
  897. package/src/generation/filtering/core/CellFilterUnaryOperation.d.ts.map +1 -1
  898. package/src/generation/filtering/core/CellFilterUnaryOperation.js +29 -33
  899. package/src/generation/filtering/numeric/CellFilterCache.d.ts +1 -0
  900. package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
  901. package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.d.ts +3 -2
  902. package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.d.ts.map +1 -1
  903. package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +9 -35
  904. package/src/generation/filtering/numeric/complex/CellFilterCurvature.d.ts +0 -1
  905. package/src/generation/filtering/numeric/complex/CellFilterCurvature.d.ts.map +1 -1
  906. package/src/generation/filtering/numeric/complex/CellFilterCurvature.js +19 -43
  907. package/src/generation/filtering/numeric/complex/CellFilterFXAA.d.ts +0 -1
  908. package/src/generation/filtering/numeric/complex/CellFilterFXAA.d.ts.map +1 -1
  909. package/src/generation/filtering/numeric/complex/CellFilterFXAA.js +2 -6
  910. package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.d.ts.map +1 -1
  911. package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +9 -12
  912. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts.map +1 -1
  913. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +2 -1
  914. package/src/generation/filtering/numeric/complex/CellFilterSobel.d.ts +0 -1
  915. package/src/generation/filtering/numeric/complex/CellFilterSobel.d.ts.map +1 -1
  916. package/src/generation/filtering/numeric/complex/CellFilterSobel.js +2 -6
  917. package/src/generation/filtering/numeric/math/CellFilterInverseLerp.d.ts +5 -4
  918. package/src/generation/filtering/numeric/math/CellFilterInverseLerp.d.ts.map +1 -1
  919. package/src/generation/filtering/numeric/math/CellFilterInverseLerp.js +5 -4
  920. package/src/generation/filtering/numeric/process/computeFilterSurfaceNormal.d.ts +17 -0
  921. package/src/generation/filtering/numeric/process/computeFilterSurfaceNormal.d.ts.map +1 -0
  922. package/src/generation/filtering/numeric/process/computeFilterSurfaceNormal.js +42 -0
  923. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
  924. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +7 -1
  925. package/src/generation/filtering/numeric/util/populateSampler2DFromCellFilter.d.ts.map +1 -1
  926. package/src/generation/filtering/numeric/util/populateSampler2DFromCellFilter.js +7 -10
  927. package/src/generation/filtering/numeric/util/sampler_from_filter.d.ts.map +1 -1
  928. package/src/generation/filtering/numeric/util/sampler_from_filter.js +2 -1
  929. package/src/generation/grid/GridData.d.ts.map +1 -1
  930. package/src/generation/grid/GridData.js +14 -1
  931. package/src/generation/grid/actions/ContinuousGridCellAction.d.ts +10 -3
  932. package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
  933. package/src/generation/grid/actions/ContinuousGridCellAction.js +18 -3
  934. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts +11 -1
  935. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
  936. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +13 -3
  937. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.d.ts +1 -1
  938. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.js +2 -2
  939. package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts +1 -1
  940. package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts.map +1 -1
  941. package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.js +4 -6
  942. package/src/generation/grid/coords/grid_to_texel.d.ts +9 -0
  943. package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -0
  944. package/src/generation/grid/coords/grid_to_texel.js +10 -0
  945. package/src/generation/grid/coords/texel_to_grid.d.ts +9 -0
  946. package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -0
  947. package/src/generation/grid/coords/texel_to_grid.js +10 -0
  948. package/src/generation/grid/generation/GridTaskApplyActionToCells.d.ts +2 -2
  949. package/src/generation/grid/generation/GridTaskApplyActionToCells.d.ts.map +1 -1
  950. package/src/generation/grid/generation/GridTaskApplyActionToCells.js +10 -6
  951. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
  952. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +20 -21
  953. package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts +7 -0
  954. package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
  955. package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +18 -10
  956. package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.d.ts.map +1 -1
  957. package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.js +16 -7
  958. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts +5 -3
  959. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
  960. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +26 -23
  961. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
  962. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +10 -1
  963. package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
  964. package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +4 -0
  965. package/src/generation/grid/generation/road/GridTaskGenerateRoads.d.ts +15 -8
  966. package/src/generation/grid/generation/road/GridTaskGenerateRoads.d.ts.map +1 -1
  967. package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +89 -92
  968. package/src/generation/markers/GridActionRuleSet.d.ts.map +1 -1
  969. package/src/generation/markers/GridActionRuleSet.js +10 -2
  970. package/src/generation/markers/GridCellActionPlaceMarker.d.ts +11 -0
  971. package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
  972. package/src/generation/markers/GridCellActionPlaceMarker.js +20 -3
  973. package/src/generation/markers/GridCellActionPlaceMarkerGroup.d.ts +3 -1
  974. package/src/generation/markers/GridCellActionPlaceMarkerGroup.d.ts.map +1 -1
  975. package/src/generation/markers/GridCellActionPlaceMarkerGroup.js +9 -2
  976. package/src/generation/markers/MarkerNode.d.ts +8 -3
  977. package/src/generation/markers/MarkerNode.d.ts.map +1 -1
  978. package/src/generation/markers/MarkerNode.js +12 -5
  979. package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +1 -1
  980. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessor.d.ts +1 -1
  981. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessor.d.ts.map +1 -1
  982. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessor.js +1 -1
  983. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.d.ts +1 -1
  984. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.d.ts.map +1 -1
  985. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.js +1 -1
  986. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts +1 -1
  987. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts.map +1 -1
  988. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.js +2 -2
  989. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.d.ts +1 -1
  990. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.d.ts.map +1 -1
  991. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.js +2 -2
  992. package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.d.ts.map +1 -1
  993. package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.js +6 -4
  994. package/src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.d.ts.map +1 -1
  995. package/src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.js +1 -3
  996. package/src/generation/markers/actions/terrain/MarkerNodeActionPaintTerrain.d.ts.map +1 -1
  997. package/src/generation/markers/actions/terrain/MarkerNodeActionPaintTerrain.js +12 -11
  998. package/src/generation/markers/matcher/MarkerNodeMatcherAnd.js +2 -2
  999. package/src/generation/markers/transform/MarkerNodeTransformer.d.ts +4 -1
  1000. package/src/generation/markers/transform/MarkerNodeTransformer.d.ts.map +1 -1
  1001. package/src/generation/markers/transform/MarkerNodeTransformer.js +4 -1
  1002. package/src/generation/markers/transform/MarkerNodeTransformerAddPositionYFromFilter.d.ts.map +1 -1
  1003. package/src/generation/markers/transform/MarkerNodeTransformerAddPositionYFromFilter.js +1 -3
  1004. package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.d.ts +5 -0
  1005. package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.d.ts.map +1 -1
  1006. package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.js +15 -0
  1007. package/src/generation/markers/transform/MarkerNodeTransformerRecordProperty.d.ts.map +1 -1
  1008. package/src/generation/markers/transform/MarkerNodeTransformerRecordProperty.js +1 -3
  1009. package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.d.ts.map +1 -1
  1010. package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js +2 -4
  1011. package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.d.ts.map +1 -1
  1012. package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js +1 -3
  1013. package/src/generation/placement/GridCellPlacementRule.d.ts.map +1 -1
  1014. package/src/generation/placement/GridCellPlacementRule.js +1 -3
  1015. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
  1016. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +8 -10
  1017. package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.d.ts.map +1 -1
  1018. package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.js +6 -4
  1019. package/src/generation/placement/action/random/weighted/WeightedGridCellAction.d.ts.map +1 -1
  1020. package/src/generation/placement/action/random/weighted/WeightedGridCellAction.js +1 -3
  1021. package/src/generation/rules/CellMatcher.d.ts +3 -1
  1022. package/src/generation/rules/CellMatcher.d.ts.map +1 -1
  1023. package/src/generation/rules/CellMatcher.js +3 -1
  1024. package/src/generation/rules/CellMatcherFromFilter.d.ts.map +1 -1
  1025. package/src/generation/rules/CellMatcherFromFilter.js +1 -3
  1026. package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
  1027. package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -20
  1028. package/src/generation/test_support/executeTaskTreeSync.d.ts +9 -0
  1029. package/src/generation/test_support/executeTaskTreeSync.d.ts.map +1 -0
  1030. package/src/generation/test_support/executeTaskTreeSync.js +78 -0
  1031. package/src/generation/theme/TerrainLayerRuleAggregator.d.ts +2 -1
  1032. package/src/generation/theme/TerrainLayerRuleAggregator.d.ts.map +1 -1
  1033. package/src/generation/theme/TerrainLayerRuleAggregator.js +9 -6
  1034. package/src/generation/theme/Theme.d.ts +1 -1
  1035. package/src/generation/theme/Theme.d.ts.map +1 -1
  1036. package/src/generation/theme/Theme.js +2 -2
  1037. package/src/generation/theme/ThemeEngine.d.ts +3 -3
  1038. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  1039. package/src/generation/theme/ThemeEngine.js +26 -16
  1040. package/src/generation/theme/cell/CellProcessingRule.d.ts +3 -3
  1041. package/src/generation/theme/cell/CellProcessingRule.d.ts.map +1 -1
  1042. package/src/generation/theme/cell/CellProcessingRule.js +6 -10
  1043. package/src/generation/theme/cell/CellProcessingRuleSet.d.ts +1 -1
  1044. package/src/generation/theme/cell/CellProcessingRuleSet.d.ts.map +1 -1
  1045. package/src/generation/theme/cell/CellProcessingRuleSet.js +2 -2
  1046. package/src/view/common/ListView.js +1 -1
  1047. package/src/view/elements/BottomLeftResizeHandleView.d.ts.map +1 -1
  1048. package/src/view/elements/BottomLeftResizeHandleView.js +13 -5
  1049. package/src/core/font/FontAsset.d.ts.map +0 -1
  1050. package/src/core/font/FontAssetLoader.d.ts.map +0 -1
  1051. package/src/core/geom/3d/shape/util/shape_to_visual_entity.d.ts.map +0 -1
  1052. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts.map +0 -1
  1053. package/src/core/process/action/AsynchronousDelayAction.d.ts.map +0 -1
  1054. package/src/engine/graphics/sh3/path_tracer/sampling/v3_orthonormal_matrix_from_normal.d.ts.map +0 -1
  1055. package/src/engine/physics/computeInterceptPoint.d.ts.map +0 -1
  1056. package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +0 -1
  1057. package/src/engine/physics/gjk/gjk.d.ts.map +0 -1
  1058. package/src/engine/physics/gjk/gjk_epa_penetration.d.ts.map +0 -1
  1059. package/src/engine/physics/gjk/minkowski_support.d.ts.map +0 -1
  1060. package/src/engine/physics/gjk/mpr.d.ts.map +0 -1
  1061. package/src/engine/physics/integration/quat_integrate.d.ts.map +0 -1
  1062. package/src/engine/physics/island/union_find.d.ts.map +0 -1
  1063. package/src/engine/physics/narrowphase/clip_against_axis_uv.d.ts.map +0 -1
  1064. package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +0 -1
  1065. package/src/engine/physics/narrowphase/ray_shapes.d.ts +0 -66
  1066. package/src/engine/physics/narrowphase/ray_shapes.d.ts.map +0 -1
  1067. package/src/engine/physics/narrowphase/ray_shapes.js +0 -187
  1068. package/src/engine/sound/ecs/emitter/SoundEmitterChannel.d.ts +0 -23
  1069. package/src/engine/sound/ecs/emitter/SoundEmitterChannel.d.ts.map +0 -1
  1070. package/src/engine/sound/ecs/emitter/SoundEmitterChannel.js +0 -32
  1071. package/src/engine/sound/ecs/emitter/SoundTrackNodes.d.ts +0 -18
  1072. package/src/engine/sound/ecs/emitter/SoundTrackNodes.d.ts.map +0 -1
  1073. package/src/engine/sound/ecs/emitter/SoundTrackNodes.js +0 -18
  1074. package/src/engine/sound/sopra/AbstractAudioClip.d.ts +0 -26
  1075. package/src/engine/sound/sopra/AbstractAudioClip.d.ts.map +0 -1
  1076. package/src/engine/sound/sopra/AbstractAudioClip.js +0 -29
  1077. package/src/engine/sound/sopra/ContainerAudioClip.d.ts +0 -12
  1078. package/src/engine/sound/sopra/ContainerAudioClip.d.ts.map +0 -1
  1079. package/src/engine/sound/sopra/ContainerAudioClip.js +0 -13
  1080. package/src/engine/sound/sopra/RandomContainerAudioClip.d.ts +0 -12
  1081. package/src/engine/sound/sopra/RandomContainerAudioClip.d.ts.map +0 -1
  1082. package/src/engine/sound/sopra/RandomContainerAudioClip.js +0 -15
  1083. package/src/engine/sound/sopra/SequenceContainerAudioClip.d.ts +0 -7
  1084. package/src/engine/sound/sopra/SequenceContainerAudioClip.d.ts.map +0 -1
  1085. package/src/engine/sound/sopra/SequenceContainerAudioClip.js +0 -8
  1086. package/src/engine/sound/sopra/SilenceAudioClip.d.ts +0 -13
  1087. package/src/engine/sound/sopra/SilenceAudioClip.d.ts.map +0 -1
  1088. package/src/engine/sound/sopra/SilenceAudioClip.js +0 -15
  1089. package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.d.ts +0 -21
  1090. package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.d.ts.map +0 -1
  1091. package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.js +0 -68
  1092. package/src/generation/grid/generation/grid/GridTaskGridAlignedNodeGenerator.d.ts +0 -10
  1093. package/src/generation/grid/generation/grid/GridTaskGridAlignedNodeGenerator.d.ts.map +0 -1
  1094. package/src/generation/grid/generation/grid/GridTaskGridAlignedNodeGenerator.js +0 -17
  1095. /package/src/{engine/physics → core/geom/3d}/gjk/NOTES.md +0 -0
  1096. /package/src/{engine/physics → core/geom/3d}/gjk/gjk.d.ts +0 -0
  1097. /package/src/{engine/graphics/sh3/path_tracer/sampling → core/geom/vec3}/v3_orthonormal_matrix_from_normal.d.ts +0 -0
  1098. /package/src/{engine/physics → core/math/physics/kinematics}/computeInterceptPoint.d.ts +0 -0
@@ -1,339 +1,344 @@
1
- import { Ray3 } from "../../../core/geom/3d/ray/Ray3.js";
2
- import { PhysicsSurfacePoint } from "../queries/PhysicsSurfacePoint.js";
3
- import { v3_quat3_apply } from "../../../core/geom/vec3/v3_quat3_apply.js";
4
- import { v3_length } from "../../../core/geom/vec3/v3_length.js";
5
- import { world_inverse_inertia_apply } from "../inertia/world_inverse_inertia.js";
6
- import { BodyKind } from "../ecs/BodyKind.js";
7
-
8
- /**
9
- * # Raycast vehicle controller
10
- *
11
- * The vehicle model most games ship: a single rigid-body **chassis** plus a set
12
- * of **raycast wheels**. Each wheel is not a body — it is a downward ray from a
13
- * chassis-local mount point. Every frame, for each wheel, the controller:
14
- *
15
- * 1. casts the suspension ray and, on a ground hit, measures the spring
16
- * compression;
17
- * 2. applies a spring + damper **suspension force** along the contact normal
18
- * (this is what holds the chassis up);
19
- * 3. applies **tyre friction** at the contact patch — a lateral grip impulse
20
- * that resists sideways slide, plus a longitudinal drive / brake impulse,
21
- * the two clamped together to a friction circle `μ·N`.
22
- *
23
- * Steering rotates the steered wheels' forward direction; a drive force is split
24
- * across the driven wheels. It is a *controller on top of the public physics
25
- * API* (`raycast` + `applyForceAt` + `applyImpulseAt`), not a new constraint —
26
- * call {@link update} once per frame **before** `PhysicsSystem.fixedUpdate`, so
27
- * the suspension force it accumulates is integrated by that step and the
28
- * friction impulses act on the current velocity.
29
- *
30
- * The 6-DOF joint (spring linear + motor angular) is the alternative
31
- * "simulated wheel" path; this raycast controller is the lighter, more robust
32
- * default. Suspension-ray accuracy follows `PhysicsSystem.raycast`, which is
33
- * narrowphase-exact for sphere / box / capsule / mesh / heightmap ground.
34
- *
35
- * @author Alex Goldring
36
- * @copyright Company Named Limited (c) 2026
37
- */
38
-
39
- const scratch_v = new Float64Array(3);
40
- const scratch_i = new Float64Array(3);
41
-
42
- /**
43
- * Effective mass denominator for a unit-direction velocity constraint at a
44
- * body-relative point: `invM + (r×d)·Iw⁻¹·(r×d)`.
45
- * @returns {number}
46
- */
47
- function effective_mass(rb, transform, invM, rx, ry, rz, dx, dy, dz) {
48
- let k = invM;
49
- const ii = rb.inverseInertiaLocal;
50
- if (ii.x !== 0 || ii.y !== 0 || ii.z !== 0) {
51
- const cx = ry * dz - rz * dy;
52
- const cy = rz * dx - rx * dz;
53
- const cz = rx * dy - ry * dx;
54
- world_inverse_inertia_apply(scratch_i, 0, ii, transform.rotation, cx, cy, cz);
55
- k += cx * scratch_i[0] + cy * scratch_i[1] + cz * scratch_i[2];
56
- }
57
- return k;
58
- }
59
-
60
- /** Rotate vector `(vx,vy,vz)` about unit axis `(ux,uy,uz)` by `angle`, into `out`. */
61
- function rotate_about(out, vx, vy, vz, ux, uy, uz, angle) {
62
- const c = Math.cos(angle), s = Math.sin(angle);
63
- const dot = ux * vx + uy * vy + uz * vz;
64
- // v·c + (k×v)·s + k·(k·v)·(1−c)
65
- const kxx = uy * vz - uz * vy;
66
- const kxy = uz * vx - ux * vz;
67
- const kxz = ux * vy - uy * vx;
68
- out[0] = vx * c + kxx * s + ux * dot * (1 - c);
69
- out[1] = vy * c + kxy * s + uy * dot * (1 - c);
70
- out[2] = vz * c + kxz * s + uz * dot * (1 - c);
71
- }
72
-
73
-
74
- /**
75
- * One wheel's config + per-frame runtime state. The runtime fields
76
- * (`inContact`, `compression`, contact point/normal, `rotation`, …) are read by
77
- * rendering / gameplay; do not write them.
78
- */
79
- export class Wheel {
80
- constructor() {
81
- // --- config ---
82
- /** Mount point on the chassis, local. @type {Float64Array} */
83
- this.localPosition = new Float64Array(3);
84
- /** Suspension direction (local, unit, points "down"). @type {Float64Array} */
85
- this.localSuspensionDir = Float64Array.from([0, -1, 0]);
86
- /** Forward / rolling direction (local, unit). @type {Float64Array} */
87
- this.localForward = Float64Array.from([0, 0, 1]);
88
- this.suspensionRestLength = 0.5;
89
- this.suspensionStiffness = 100;
90
- this.suspensionDamping = 10;
91
- this.suspensionMaxForce = Infinity;
92
- this.radius = 0.3;
93
- this.friction = 1.2;
94
- this.steered = false;
95
- this.driven = false;
96
-
97
- // --- runtime ---
98
- this.inContact = false;
99
- this.suspensionLength = this.suspensionRestLength;
100
- this.compression = 0;
101
- /** World contact point. @type {Float64Array} */
102
- this.contactPoint = new Float64Array(3);
103
- /** World contact normal. @type {Float64Array} */
104
- this.contactNormal = Float64Array.from([0, 1, 0]);
105
- /** Body id of the surface under the wheel, or −1. */
106
- this.contactBodyId = -1;
107
- /** Current steering angle (rad), set via {@link RaycastVehicle#setSteering}. */
108
- this.steering = 0;
109
- /** Accumulated spin angle (rad) for rendering. */
110
- this.rotation = 0;
111
- /** Forward ground speed at the contact (m/s). */
112
- this.forwardSpeed = 0;
113
- /** Suspension force magnitude applied this frame (N). */
114
- this.suspensionForce = 0;
115
- }
116
- }
117
-
118
- export class RaycastVehicle {
119
- /**
120
- * @param {PhysicsSystem} system
121
- * @param {RigidBody} chassisBody the chassis rigid body (Dynamic)
122
- * @param {Transform} chassisTransform its world transform
123
- */
124
- constructor(system, chassisBody, chassisTransform) {
125
- this.system = system;
126
- this.chassisBody = chassisBody;
127
- this.chassisTransform = chassisTransform;
128
-
129
- /** @type {Wheel[]} */
130
- this.wheels = [];
131
-
132
- this.__driveForce = 0;
133
- this.__brakeForce = 0;
134
- this.__drivenCount = 0;
135
-
136
- this.__ray = new Ray3();
137
- this.__hit = new PhysicsSurfacePoint();
138
- // Exclude the chassis' own colliders from the suspension raycast.
139
- this.__filter = (entity, collider) => collider._bodyId !== this.chassisBody._bodyId;
140
-
141
- // Reused force / impulse / point payloads for the public API calls.
142
- this.__force = { x: 0, y: 0, z: 0 };
143
- this.__point = { x: 0, y: 0, z: 0 };
144
- }
145
-
146
- /**
147
- * Add a wheel. Returns the created {@link Wheel} (also pushed to
148
- * {@link wheels}); set any further config fields on it before stepping.
149
- *
150
- * @param {object} opts
151
- * @param {number[]} opts.localPosition mount point on the chassis, local.
152
- * @param {number[]} [opts.localSuspensionDir] unit "down", default (0,−1,0).
153
- * @param {number[]} [opts.localForward] unit rolling dir, default (0,0,1).
154
- * @param {number} [opts.suspensionRestLength]
155
- * @param {number} [opts.suspensionStiffness] N/m.
156
- * @param {number} [opts.suspensionDamping] N·s/m.
157
- * @param {number} [opts.suspensionMaxForce] N (clamp).
158
- * @param {number} [opts.radius]
159
- * @param {number} [opts.friction] tyre friction coefficient μ.
160
- * @param {boolean} [opts.steered]
161
- * @param {boolean} [opts.driven]
162
- * @returns {Wheel}
163
- */
164
- addWheel(opts) {
165
- const w = new Wheel();
166
- const p = opts.localPosition;
167
- w.localPosition[0] = p[0]; w.localPosition[1] = p[1]; w.localPosition[2] = p[2];
168
- if (opts.localSuspensionDir) {
169
- const d = opts.localSuspensionDir, L = v3_length(d[0], d[1], d[2]) || 1;
170
- w.localSuspensionDir[0] = d[0] / L; w.localSuspensionDir[1] = d[1] / L; w.localSuspensionDir[2] = d[2] / L;
171
- }
172
- if (opts.localForward) {
173
- const f = opts.localForward, L = v3_length(f[0], f[1], f[2]) || 1;
174
- w.localForward[0] = f[0] / L; w.localForward[1] = f[1] / L; w.localForward[2] = f[2] / L;
175
- }
176
- if (opts.suspensionRestLength !== undefined) w.suspensionRestLength = opts.suspensionRestLength;
177
- if (opts.suspensionStiffness !== undefined) w.suspensionStiffness = opts.suspensionStiffness;
178
- if (opts.suspensionDamping !== undefined) w.suspensionDamping = opts.suspensionDamping;
179
- if (opts.suspensionMaxForce !== undefined) w.suspensionMaxForce = opts.suspensionMaxForce;
180
- if (opts.radius !== undefined) w.radius = opts.radius;
181
- if (opts.friction !== undefined) w.friction = opts.friction;
182
- if (opts.steered !== undefined) w.steered = opts.steered;
183
- if (opts.driven !== undefined) w.driven = opts.driven;
184
- w.suspensionLength = w.suspensionRestLength;
185
- this.wheels.push(w);
186
- if (w.driven) this.__drivenCount++;
187
- return w;
188
- }
189
-
190
- /** Set the steering angle (rad) on every steered wheel. */
191
- setSteering(angle) {
192
- for (let i = 0; i < this.wheels.length; i++) {
193
- if (this.wheels[i].steered) this.wheels[i].steering = angle;
194
- }
195
- }
196
-
197
- /** Total engine drive force (N), split evenly across the driven wheels. */
198
- setDriveForce(force) { this.__driveForce = force; }
199
-
200
- /** Brake force (N) per wheel, opposing each wheel's forward motion. */
201
- setBrake(force) { this.__brakeForce = force; }
202
-
203
- /**
204
- * Step the vehicle: cast suspension rays, apply suspension + tyre forces.
205
- * Call once per frame **before** `PhysicsSystem.fixedUpdate(dt)` with the
206
- * same `dt`.
207
- * @param {number} dt
208
- */
209
- update(dt) {
210
- const rb = this.chassisBody;
211
- if (rb.kind !== BodyKind.Dynamic || dt <= 0) return;
212
- const tr = this.chassisTransform;
213
- const invMass = rb.mass > 0 ? 1 / rb.mass : 0;
214
- const q = tr.rotation;
215
- const px = tr.position.x, py = tr.position.y, pz = tr.position.z;
216
- const lv = rb.linearVelocity, av = rb.angularVelocity;
217
- const drivePer = this.__drivenCount > 0 ? this.__driveForce / this.__drivenCount : 0;
218
-
219
- for (let wi = 0; wi < this.wheels.length; wi++) {
220
- const w = this.wheels[wi];
221
-
222
- // World mount point and suspension axis.
223
- v3_quat3_apply(scratch_v, 0, w.localPosition[0], w.localPosition[1], w.localPosition[2], q[0], q[1], q[2], q[3]);
224
- const mx = px + scratch_v[0], my = py + scratch_v[1], mz = pz + scratch_v[2];
225
- v3_quat3_apply(scratch_v, 0, w.localSuspensionDir[0], w.localSuspensionDir[1], w.localSuspensionDir[2], q[0], q[1], q[2], q[3]);
226
- const sdx = scratch_v[0], sdy = scratch_v[1], sdz = scratch_v[2]; // suspension down (unit)
227
-
228
- const maxLen = w.suspensionRestLength + w.radius;
229
- this.__ray.setOrigin(mx, my, mz);
230
- this.__ray.setDirection(sdx, sdy, sdz);
231
- this.__ray.tMax = maxLen;
232
-
233
- const hit = this.system.raycast(this.__ray, this.__hit, this.__filter);
234
- // `raycast` already bounds the hit to ray.tMax (= maxLen) and only
235
- // returns true for t strictly < maxLen, so `__hit.t > maxLen` was dead.
236
- if (!hit) {
237
- // Airborne: suspension fully extended, no force. Reset ALL the
238
- // contact-frame fields including contactBodyId and forwardSpeed,
239
- // which otherwise retain stale last-grounded-frame values.
240
- w.inContact = false;
241
- w.suspensionForce = 0;
242
- w.suspensionLength = w.suspensionRestLength;
243
- w.compression = 0;
244
- w.contactBodyId = -1; // documented no-contact sentinel
245
- w.forwardSpeed = 0;
246
- continue;
247
- }
248
-
249
- const t = this.__hit.t;
250
- w.inContact = true;
251
- w.contactBodyId = this.__hit.body_id;
252
- w.suspensionLength = t - w.radius;
253
- if (w.suspensionLength < 0) w.suspensionLength = 0;
254
- w.compression = w.suspensionRestLength - w.suspensionLength;
255
-
256
- // Contact point along the ray; normal from the hit.
257
- const cx = mx + sdx * t, cy = my + sdy * t, cz = mz + sdz * t;
258
- let nx = this.__hit.normal.x, ny = this.__hit.normal.y, nz = this.__hit.normal.z;
259
- const nlen = v3_length(nx, ny, nz) || 1;
260
- nx /= nlen; ny /= nlen; nz /= nlen;
261
- w.contactPoint[0] = cx; w.contactPoint[1] = cy; w.contactPoint[2] = cz;
262
- w.contactNormal[0] = nx; w.contactNormal[1] = ny; w.contactNormal[2] = nz;
263
-
264
- // Velocity of the chassis at the contact point.
265
- const rx = cx - px, ry = cy - py, rz = cz - pz;
266
- const vptx = lv.x + av.y * rz - av.z * ry;
267
- const vpty = lv.y + av.z * rx - av.x * rz;
268
- const vptz = lv.z + av.x * ry - av.y * rx;
269
-
270
- // --- Suspension: spring + damper along the contact normal ---
271
- const projVel = vptx * nx + vpty * ny + vptz * nz; // closing speed along normal
272
- let susForce = w.suspensionStiffness * w.compression - w.suspensionDamping * projVel;
273
- if (susForce < 0) susForce = 0;
274
- else if (susForce > w.suspensionMaxForce) susForce = w.suspensionMaxForce;
275
- w.suspensionForce = susForce;
276
-
277
- if (susForce !== 0) {
278
- this.__force.x = nx * susForce; this.__force.y = ny * susForce; this.__force.z = nz * susForce;
279
- this.__point.x = cx; this.__point.y = cy; this.__point.z = cz;
280
- this.system.applyForceAt(rb, tr, this.__force, this.__point);
281
- }
282
-
283
- // --- Tyre friction: forward / side basis in the contact plane ---
284
- v3_quat3_apply(scratch_v, 0, w.localForward[0], w.localForward[1], w.localForward[2], q[0], q[1], q[2], q[3]);
285
- let fwx = scratch_v[0], fwy = scratch_v[1], fwz = scratch_v[2];
286
- if (w.steering !== 0) {
287
- // Steer about the suspension-up axis (−suspension dir).
288
- rotate_about(scratch_v, fwx, fwy, fwz, -sdx, -sdy, -sdz, w.steering);
289
- fwx = scratch_v[0]; fwy = scratch_v[1]; fwz = scratch_v[2];
290
- }
291
- // Project forward onto the contact plane, normalise.
292
- let fdotn = fwx * nx + fwy * ny + fwz * nz;
293
- fwx -= fdotn * nx; fwy -= fdotn * ny; fwz -= fdotn * nz;
294
- let fl = v3_length(fwx, fwy, fwz);
295
- if (fl < 1e-6) continue; // degenerate (forward parallel to normal)
296
- fwx /= fl; fwy /= fl; fwz /= fl;
297
- // Side = normal × forward (already unit & in-plane).
298
- const sx = ny * fwz - nz * fwy;
299
- const sy = nz * fwx - nx * fwz;
300
- const sz = nx * fwy - ny * fwx;
301
-
302
- const fwdVel = vptx * fwx + vpty * fwy + vptz * fwz;
303
- const sideVel = vptx * sx + vpty * sy + vptz * sz;
304
- w.forwardSpeed = fwdVel;
305
-
306
- // Lateral grip: impulse that cancels the side velocity.
307
- const denomSide = effective_mass(rb, tr, invMass, rx, ry, rz, sx, sy, sz);
308
- let jSide = denomSide > 0 ? -sideVel / denomSide : 0;
309
-
310
- // Longitudinal: engine drive minus brake (brake never reverses).
311
- let jFwd = w.driven ? drivePer * dt : 0;
312
- if (this.__brakeForce > 0 && fwdVel !== 0) {
313
- const denomFwd = effective_mass(rb, tr, invMass, rx, ry, rz, fwx, fwy, fwz);
314
- const stopImpulse = denomFwd > 0 ? Math.abs(fwdVel) / denomFwd : 0;
315
- const brakeImpulse = Math.min(this.__brakeForce * dt, stopImpulse);
316
- jFwd -= Math.sign(fwdVel) * brakeImpulse;
317
- }
318
-
319
- // Friction circle: clamp the combined tyre impulse to μ·N·dt.
320
- const budget = w.friction * susForce * dt;
321
- const mag = Math.sqrt(jFwd * jFwd + jSide * jSide);
322
- if (mag > budget && mag > 0) {
323
- const scale = budget / mag;
324
- jFwd *= scale; jSide *= scale;
325
- }
326
-
327
- if (jFwd !== 0 || jSide !== 0) {
328
- this.__force.x = fwx * jFwd + sx * jSide;
329
- this.__force.y = fwy * jFwd + sy * jSide;
330
- this.__force.z = fwz * jFwd + sz * jSide;
331
- this.__point.x = cx; this.__point.y = cy; this.__point.z = cz;
332
- this.system.applyImpulseAt(rb, tr, this.__force, this.__point);
333
- }
334
-
335
- // Visual wheel spin from forward ground speed.
336
- if (w.radius > 0) w.rotation += (fwdVel / w.radius) * dt;
337
- }
338
- }
339
- }
1
+ import { Ray3 } from "../../../core/geom/3d/ray/Ray3.js";
2
+ import { PhysicsSurfacePoint } from "../queries/PhysicsSurfacePoint.js";
3
+ import { v3_quat3_apply } from "../../../core/geom/vec3/v3_quat3_apply.js";
4
+ import { v3_length } from "../../../core/geom/vec3/v3_length.js";
5
+ import { angular_effective_mass_raw } from "../inertia/world_inverse_inertia.js";
6
+ import { BodyKind } from "../ecs/BodyKind.js";
7
+
8
+ /**
9
+ * # Raycast vehicle controller
10
+ *
11
+ * The vehicle model most games ship: a single rigid-body **chassis** plus a set
12
+ * of **raycast wheels**. Each wheel is not a body — it is a downward ray from a
13
+ * chassis-local mount point. Every frame, for each wheel, the controller:
14
+ *
15
+ * 1. casts the suspension ray and, on a ground hit, measures the spring
16
+ * compression;
17
+ * 2. applies a spring + damper **suspension force** along the contact normal
18
+ * (this is what holds the chassis up);
19
+ * 3. applies **tyre friction** at the contact patch — a lateral grip impulse
20
+ * that resists sideways slide, plus a longitudinal drive / brake impulse,
21
+ * the two clamped together to a friction circle `μ·N`.
22
+ *
23
+ * Steering rotates the steered wheels' forward direction; a drive force is split
24
+ * across the driven wheels. It is a *controller on top of the public physics
25
+ * API* (`raycast` + `applyForceAt` + `applyImpulseAt`), not a new constraint —
26
+ * call {@link update} once per frame **before** `PhysicsSystem.fixedUpdate`, so
27
+ * the suspension force it accumulates is integrated by that step and the
28
+ * friction impulses act on the current velocity.
29
+ *
30
+ * The 6-DOF joint (spring linear + motor angular) is the alternative
31
+ * "simulated wheel" path; this raycast controller is the lighter, more robust
32
+ * default. Suspension-ray accuracy follows `PhysicsSystem.raycast`, which is
33
+ * narrowphase-exact for sphere / box / capsule / mesh / heightmap ground.
34
+ *
35
+ * @author Alex Goldring
36
+ * @copyright Company Named Limited (c) 2026
37
+ */
38
+
39
+ const scratch_v = new Float64Array(3);
40
+ const scratch_i = new Float64Array(3);
41
+
42
+ /**
43
+ * Effective mass denominator for a unit-direction velocity constraint at a
44
+ * body-relative point: `invM + (r×d)·Iw⁻¹·(r×d)`. The angular term is the
45
+ * shared {@link angular_effective_mass_raw} kernel — the same math the
46
+ * contact/joint solver runs, so the two paths stay bit-identical.
47
+ * @returns {number}
48
+ */
49
+ function effective_mass(rb, transform, invM, rx, ry, rz, dx, dy, dz) {
50
+ let k = invM;
51
+ const ii = rb.inverseInertiaLocal;
52
+ if (ii.x !== 0 || ii.y !== 0 || ii.z !== 0) {
53
+ const q = transform.rotation;
54
+ k += angular_effective_mass_raw(
55
+ ii.x, ii.y, ii.z,
56
+ q.x, q.y, q.z, q.w,
57
+ rx, ry, rz,
58
+ dx, dy, dz,
59
+ scratch_i
60
+ );
61
+ }
62
+ return k;
63
+ }
64
+
65
+ /** Rotate vector `(vx,vy,vz)` about unit axis `(ux,uy,uz)` by `angle`, into `out`. */
66
+ function rotate_about(out, vx, vy, vz, ux, uy, uz, angle) {
67
+ const c = Math.cos(angle), s = Math.sin(angle);
68
+ const dot = ux * vx + uy * vy + uz * vz;
69
+ // c + (k×v)·s + (k·v)·(1c)
70
+ const kxx = uy * vz - uz * vy;
71
+ const kxy = uz * vx - ux * vz;
72
+ const kxz = ux * vy - uy * vx;
73
+ out[0] = vx * c + kxx * s + ux * dot * (1 - c);
74
+ out[1] = vy * c + kxy * s + uy * dot * (1 - c);
75
+ out[2] = vz * c + kxz * s + uz * dot * (1 - c);
76
+ }
77
+
78
+
79
+ /**
80
+ * One wheel's config + per-frame runtime state. The runtime fields
81
+ * (`inContact`, `compression`, contact point/normal, `rotation`, …) are read by
82
+ * rendering / gameplay; do not write them.
83
+ */
84
+ export class Wheel {
85
+ constructor() {
86
+ // --- config ---
87
+ /** Mount point on the chassis, local. @type {Float64Array} */
88
+ this.localPosition = new Float64Array(3);
89
+ /** Suspension direction (local, unit, points "down"). @type {Float64Array} */
90
+ this.localSuspensionDir = Float64Array.from([0, -1, 0]);
91
+ /** Forward / rolling direction (local, unit). @type {Float64Array} */
92
+ this.localForward = Float64Array.from([0, 0, 1]);
93
+ this.suspensionRestLength = 0.5;
94
+ this.suspensionStiffness = 100;
95
+ this.suspensionDamping = 10;
96
+ this.suspensionMaxForce = Infinity;
97
+ this.radius = 0.3;
98
+ this.friction = 1.2;
99
+ this.steered = false;
100
+ this.driven = false;
101
+
102
+ // --- runtime ---
103
+ this.inContact = false;
104
+ this.suspensionLength = this.suspensionRestLength;
105
+ this.compression = 0;
106
+ /** World contact point. @type {Float64Array} */
107
+ this.contactPoint = new Float64Array(3);
108
+ /** World contact normal. @type {Float64Array} */
109
+ this.contactNormal = Float64Array.from([0, 1, 0]);
110
+ /** Body id of the surface under the wheel, or −1. */
111
+ this.contactBodyId = -1;
112
+ /** Current steering angle (rad), set via {@link RaycastVehicle#setSteering}. */
113
+ this.steering = 0;
114
+ /** Accumulated spin angle (rad) for rendering. */
115
+ this.rotation = 0;
116
+ /** Forward ground speed at the contact (m/s). */
117
+ this.forwardSpeed = 0;
118
+ /** Suspension force magnitude applied this frame (N). */
119
+ this.suspensionForce = 0;
120
+ }
121
+ }
122
+
123
+ export class RaycastVehicle {
124
+ /**
125
+ * @param {PhysicsSystem} system
126
+ * @param {RigidBody} chassisBody the chassis rigid body (Dynamic)
127
+ * @param {Transform} chassisTransform its world transform
128
+ */
129
+ constructor(system, chassisBody, chassisTransform) {
130
+ this.system = system;
131
+ this.chassisBody = chassisBody;
132
+ this.chassisTransform = chassisTransform;
133
+
134
+ /** @type {Wheel[]} */
135
+ this.wheels = [];
136
+
137
+ this.__driveForce = 0;
138
+ this.__brakeForce = 0;
139
+ this.__drivenCount = 0;
140
+
141
+ this.__ray = new Ray3();
142
+ this.__hit = new PhysicsSurfacePoint();
143
+ // Exclude the chassis' own colliders from the suspension raycast.
144
+ this.__filter = (entity, collider) => collider._bodyId !== this.chassisBody._bodyId;
145
+
146
+ // Reused force / impulse / point payloads for the public API calls.
147
+ this.__force = { x: 0, y: 0, z: 0 };
148
+ this.__point = { x: 0, y: 0, z: 0 };
149
+ }
150
+
151
+ /**
152
+ * Add a wheel. Returns the created {@link Wheel} (also pushed to
153
+ * {@link wheels}); set any further config fields on it before stepping.
154
+ *
155
+ * @param {object} opts
156
+ * @param {number[]} opts.localPosition mount point on the chassis, local.
157
+ * @param {number[]} [opts.localSuspensionDir] unit "down", default (0,−1,0).
158
+ * @param {number[]} [opts.localForward] unit rolling dir, default (0,0,1).
159
+ * @param {number} [opts.suspensionRestLength]
160
+ * @param {number} [opts.suspensionStiffness] N/m.
161
+ * @param {number} [opts.suspensionDamping] N·s/m.
162
+ * @param {number} [opts.suspensionMaxForce] N (clamp).
163
+ * @param {number} [opts.radius]
164
+ * @param {number} [opts.friction] tyre friction coefficient μ.
165
+ * @param {boolean} [opts.steered]
166
+ * @param {boolean} [opts.driven]
167
+ * @returns {Wheel}
168
+ */
169
+ addWheel(opts) {
170
+ const w = new Wheel();
171
+ const p = opts.localPosition;
172
+ w.localPosition[0] = p[0]; w.localPosition[1] = p[1]; w.localPosition[2] = p[2];
173
+ if (opts.localSuspensionDir) {
174
+ const d = opts.localSuspensionDir, L = v3_length(d[0], d[1], d[2]) || 1;
175
+ w.localSuspensionDir[0] = d[0] / L; w.localSuspensionDir[1] = d[1] / L; w.localSuspensionDir[2] = d[2] / L;
176
+ }
177
+ if (opts.localForward) {
178
+ const f = opts.localForward, L = v3_length(f[0], f[1], f[2]) || 1;
179
+ w.localForward[0] = f[0] / L; w.localForward[1] = f[1] / L; w.localForward[2] = f[2] / L;
180
+ }
181
+ if (opts.suspensionRestLength !== undefined) w.suspensionRestLength = opts.suspensionRestLength;
182
+ if (opts.suspensionStiffness !== undefined) w.suspensionStiffness = opts.suspensionStiffness;
183
+ if (opts.suspensionDamping !== undefined) w.suspensionDamping = opts.suspensionDamping;
184
+ if (opts.suspensionMaxForce !== undefined) w.suspensionMaxForce = opts.suspensionMaxForce;
185
+ if (opts.radius !== undefined) w.radius = opts.radius;
186
+ if (opts.friction !== undefined) w.friction = opts.friction;
187
+ if (opts.steered !== undefined) w.steered = opts.steered;
188
+ if (opts.driven !== undefined) w.driven = opts.driven;
189
+ w.suspensionLength = w.suspensionRestLength;
190
+ this.wheels.push(w);
191
+ if (w.driven) this.__drivenCount++;
192
+ return w;
193
+ }
194
+
195
+ /** Set the steering angle (rad) on every steered wheel. */
196
+ setSteering(angle) {
197
+ for (let i = 0; i < this.wheels.length; i++) {
198
+ if (this.wheels[i].steered) this.wheels[i].steering = angle;
199
+ }
200
+ }
201
+
202
+ /** Total engine drive force (N), split evenly across the driven wheels. */
203
+ setDriveForce(force) { this.__driveForce = force; }
204
+
205
+ /** Brake force (N) per wheel, opposing each wheel's forward motion. */
206
+ setBrake(force) { this.__brakeForce = force; }
207
+
208
+ /**
209
+ * Step the vehicle: cast suspension rays, apply suspension + tyre forces.
210
+ * Call once per frame **before** `PhysicsSystem.fixedUpdate(dt)` with the
211
+ * same `dt`.
212
+ * @param {number} dt
213
+ */
214
+ update(dt) {
215
+ const rb = this.chassisBody;
216
+ if (rb.kind !== BodyKind.Dynamic || dt <= 0) return;
217
+ const tr = this.chassisTransform;
218
+ const invMass = rb.mass > 0 ? 1 / rb.mass : 0;
219
+ const q = tr.rotation;
220
+ const px = tr.position.x, py = tr.position.y, pz = tr.position.z;
221
+ const lv = rb.linearVelocity, av = rb.angularVelocity;
222
+ const drivePer = this.__drivenCount > 0 ? this.__driveForce / this.__drivenCount : 0;
223
+
224
+ for (let wi = 0; wi < this.wheels.length; wi++) {
225
+ const w = this.wheels[wi];
226
+
227
+ // World mount point and suspension axis.
228
+ v3_quat3_apply(scratch_v, 0, w.localPosition[0], w.localPosition[1], w.localPosition[2], q[0], q[1], q[2], q[3]);
229
+ const mx = px + scratch_v[0], my = py + scratch_v[1], mz = pz + scratch_v[2];
230
+ v3_quat3_apply(scratch_v, 0, w.localSuspensionDir[0], w.localSuspensionDir[1], w.localSuspensionDir[2], q[0], q[1], q[2], q[3]);
231
+ const sdx = scratch_v[0], sdy = scratch_v[1], sdz = scratch_v[2]; // suspension down (unit)
232
+
233
+ const maxLen = w.suspensionRestLength + w.radius;
234
+ this.__ray.setOrigin(mx, my, mz);
235
+ this.__ray.setDirection(sdx, sdy, sdz);
236
+ this.__ray.tMax = maxLen;
237
+
238
+ const hit = this.system.raycast(this.__ray, this.__hit, this.__filter);
239
+ // `raycast` already bounds the hit to ray.tMax (= maxLen) and only
240
+ // returns true for t strictly < maxLen, so `__hit.t > maxLen` was dead.
241
+ if (!hit) {
242
+ // Airborne: suspension fully extended, no force. Reset ALL the
243
+ // contact-frame fields — including contactBodyId and forwardSpeed,
244
+ // which otherwise retain stale last-grounded-frame values.
245
+ w.inContact = false;
246
+ w.suspensionForce = 0;
247
+ w.suspensionLength = w.suspensionRestLength;
248
+ w.compression = 0;
249
+ w.contactBodyId = -1; // documented no-contact sentinel
250
+ w.forwardSpeed = 0;
251
+ continue;
252
+ }
253
+
254
+ const t = this.__hit.t;
255
+ w.inContact = true;
256
+ w.contactBodyId = this.__hit.body_id;
257
+ w.suspensionLength = t - w.radius;
258
+ if (w.suspensionLength < 0) w.suspensionLength = 0;
259
+ w.compression = w.suspensionRestLength - w.suspensionLength;
260
+
261
+ // Contact point along the ray; normal from the hit.
262
+ const cx = mx + sdx * t, cy = my + sdy * t, cz = mz + sdz * t;
263
+ let nx = this.__hit.normal.x, ny = this.__hit.normal.y, nz = this.__hit.normal.z;
264
+ const nlen = v3_length(nx, ny, nz) || 1;
265
+ nx /= nlen; ny /= nlen; nz /= nlen;
266
+ w.contactPoint[0] = cx; w.contactPoint[1] = cy; w.contactPoint[2] = cz;
267
+ w.contactNormal[0] = nx; w.contactNormal[1] = ny; w.contactNormal[2] = nz;
268
+
269
+ // Velocity of the chassis at the contact point.
270
+ const rx = cx - px, ry = cy - py, rz = cz - pz;
271
+ const vptx = lv.x + av.y * rz - av.z * ry;
272
+ const vpty = lv.y + av.z * rx - av.x * rz;
273
+ const vptz = lv.z + av.x * ry - av.y * rx;
274
+
275
+ // --- Suspension: spring + damper along the contact normal ---
276
+ const projVel = vptx * nx + vpty * ny + vptz * nz; // closing speed along normal
277
+ let susForce = w.suspensionStiffness * w.compression - w.suspensionDamping * projVel;
278
+ if (susForce < 0) susForce = 0;
279
+ else if (susForce > w.suspensionMaxForce) susForce = w.suspensionMaxForce;
280
+ w.suspensionForce = susForce;
281
+
282
+ if (susForce !== 0) {
283
+ this.__force.x = nx * susForce; this.__force.y = ny * susForce; this.__force.z = nz * susForce;
284
+ this.__point.x = cx; this.__point.y = cy; this.__point.z = cz;
285
+ this.system.applyForceAt(rb, tr, this.__force, this.__point);
286
+ }
287
+
288
+ // --- Tyre friction: forward / side basis in the contact plane ---
289
+ v3_quat3_apply(scratch_v, 0, w.localForward[0], w.localForward[1], w.localForward[2], q[0], q[1], q[2], q[3]);
290
+ let fwx = scratch_v[0], fwy = scratch_v[1], fwz = scratch_v[2];
291
+ if (w.steering !== 0) {
292
+ // Steer about the suspension-up axis (−suspension dir).
293
+ rotate_about(scratch_v, fwx, fwy, fwz, -sdx, -sdy, -sdz, w.steering);
294
+ fwx = scratch_v[0]; fwy = scratch_v[1]; fwz = scratch_v[2];
295
+ }
296
+ // Project forward onto the contact plane, normalise.
297
+ let fdotn = fwx * nx + fwy * ny + fwz * nz;
298
+ fwx -= fdotn * nx; fwy -= fdotn * ny; fwz -= fdotn * nz;
299
+ let fl = v3_length(fwx, fwy, fwz);
300
+ if (fl < 1e-6) continue; // degenerate (forward parallel to normal)
301
+ fwx /= fl; fwy /= fl; fwz /= fl;
302
+ // Side = normal × forward (already unit & in-plane).
303
+ const sx = ny * fwz - nz * fwy;
304
+ const sy = nz * fwx - nx * fwz;
305
+ const sz = nx * fwy - ny * fwx;
306
+
307
+ const fwdVel = vptx * fwx + vpty * fwy + vptz * fwz;
308
+ const sideVel = vptx * sx + vpty * sy + vptz * sz;
309
+ w.forwardSpeed = fwdVel;
310
+
311
+ // Lateral grip: impulse that cancels the side velocity.
312
+ const denomSide = effective_mass(rb, tr, invMass, rx, ry, rz, sx, sy, sz);
313
+ let jSide = denomSide > 0 ? -sideVel / denomSide : 0;
314
+
315
+ // Longitudinal: engine drive minus brake (brake never reverses).
316
+ let jFwd = w.driven ? drivePer * dt : 0;
317
+ if (this.__brakeForce > 0 && fwdVel !== 0) {
318
+ const denomFwd = effective_mass(rb, tr, invMass, rx, ry, rz, fwx, fwy, fwz);
319
+ const stopImpulse = denomFwd > 0 ? Math.abs(fwdVel) / denomFwd : 0;
320
+ const brakeImpulse = Math.min(this.__brakeForce * dt, stopImpulse);
321
+ jFwd -= Math.sign(fwdVel) * brakeImpulse;
322
+ }
323
+
324
+ // Friction circle: clamp the combined tyre impulse to μ·N·dt.
325
+ const budget = w.friction * susForce * dt;
326
+ const mag = Math.sqrt(jFwd * jFwd + jSide * jSide);
327
+ if (mag > budget && mag > 0) {
328
+ const scale = budget / mag;
329
+ jFwd *= scale; jSide *= scale;
330
+ }
331
+
332
+ if (jFwd !== 0 || jSide !== 0) {
333
+ this.__force.x = fwx * jFwd + sx * jSide;
334
+ this.__force.y = fwy * jFwd + sy * jSide;
335
+ this.__force.z = fwz * jFwd + sz * jSide;
336
+ this.__point.x = cx; this.__point.y = cy; this.__point.z = cz;
337
+ this.system.applyImpulseAt(rb, tr, this.__force, this.__point);
338
+ }
339
+
340
+ // Visual wheel spin from forward ground speed.
341
+ if (w.radius > 0) w.rotation += (fwdVel / w.radius) * dt;
342
+ }
343
+ }
344
+ }