@woosh/meep-engine 3.44.0 → 3.46.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 (447) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/package.json +1 -1
  3. package/src/core/assert.d.ts.map +1 -1
  4. package/src/core/assert.js +5 -1
  5. package/src/core/binary/hash/XXH128Hash.d.ts +1 -37
  6. package/src/core/binary/hash/XXH128Hash.d.ts.map +1 -1
  7. package/src/core/binary/hash/XXH128Hash.js +4 -55
  8. package/src/core/binary/hash/XXH3_SECRET.d.ts +1 -12
  9. package/src/core/binary/hash/XXH3_SECRET.d.ts.map +1 -1
  10. package/src/core/binary/hash/XXH3_SECRET.js +4 -25
  11. package/src/core/binary/hash/crc32.d.ts +1 -15
  12. package/src/core/binary/hash/crc32.d.ts.map +1 -1
  13. package/src/core/binary/hash/crc32.js +4 -96
  14. package/src/core/binary/hash/xxh3_128.d.ts +1 -9
  15. package/src/core/binary/hash/xxh3_128.d.ts.map +1 -1
  16. package/src/core/binary/hash/xxh3_128.js +4 -341
  17. package/src/core/binary/hash/xxh3_64.d.ts +1 -8
  18. package/src/core/binary/hash/xxh3_64.d.ts.map +1 -1
  19. package/src/core/binary/hash/xxh3_64.js +4 -241
  20. package/src/core/binary/hash/xxh3_common.d.ts +1 -223
  21. package/src/core/binary/hash/xxh3_common.d.ts.map +1 -1
  22. package/src/core/binary/hash/xxh3_common.js +90 -476
  23. package/src/core/collection/array/array_sort_insertion_ascending.d.ts +19 -0
  24. package/src/core/collection/array/array_sort_insertion_ascending.d.ts.map +1 -0
  25. package/src/core/collection/array/array_sort_insertion_ascending.js +31 -0
  26. package/src/core/collection/array/combine_hash.d.ts +6 -0
  27. package/src/core/collection/array/combine_hash.d.ts.map +1 -1
  28. package/src/core/collection/array/combine_hash.js +6 -0
  29. package/src/core/function/FunctionCompiler.js +2 -2
  30. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts +27 -0
  31. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts.map +1 -0
  32. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.js +39 -0
  33. package/src/core/geom/3d/aabb/aabb3_from_v3_array.d.ts.map +1 -1
  34. package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +4 -1
  35. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +2 -2
  36. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -1
  37. package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +1 -1
  38. package/src/core/geom/3d/mat4/m4_multiply.d.ts +3 -0
  39. package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
  40. package/src/core/geom/3d/mat4/m4_multiply.js +3 -0
  41. package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts +30 -0
  42. package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts.map +1 -0
  43. package/src/core/geom/3d/mat4/m4_multiply_f64.js +106 -0
  44. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts +21 -0
  45. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts.map +1 -0
  46. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.js +36 -0
  47. package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts +25 -0
  48. package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts.map +1 -0
  49. package/src/core/geom/3d/pose/pose3_apply_point_array.js +40 -0
  50. package/src/core/geom/3d/pose/pose3_compose_array.d.ts +28 -0
  51. package/src/core/geom/3d/pose/pose3_compose_array.d.ts.map +1 -0
  52. package/src/core/geom/3d/pose/pose3_compose_array.js +41 -0
  53. package/src/core/geom/3d/pose/pose3_to_local_array.d.ts +29 -0
  54. package/src/core/geom/3d/pose/pose3_to_local_array.d.ts.map +1 -0
  55. package/src/core/geom/3d/pose/pose3_to_local_array.js +42 -0
  56. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts +28 -0
  57. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts.map +1 -0
  58. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.js +66 -0
  59. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts +22 -0
  60. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts.map +1 -0
  61. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.js +30 -0
  62. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts +23 -0
  63. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts.map +1 -0
  64. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.js +31 -0
  65. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts +26 -0
  66. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts.map +1 -0
  67. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js +46 -0
  68. package/src/core/geom/ConicRay.js +2 -2
  69. package/src/core/geom/Vector4.d.ts.map +1 -1
  70. package/src/core/geom/Vector4.js +8 -5
  71. package/src/core/geom/vec3/v3_distance_array.d.ts +11 -0
  72. package/src/core/geom/vec3/v3_distance_array.d.ts.map +1 -0
  73. package/src/core/geom/vec3/v3_distance_array.js +19 -0
  74. package/src/core/geom/vec3/v3_normalize_array_checked.d.ts +23 -0
  75. package/src/core/geom/vec3/v3_normalize_array_checked.d.ts.map +1 -0
  76. package/src/core/geom/vec3/v3_normalize_array_checked.js +49 -0
  77. package/src/core/geom/vec3/v3_reject_array.d.ts +15 -0
  78. package/src/core/geom/vec3/v3_reject_array.d.ts.map +1 -0
  79. package/src/core/geom/vec3/v3_reject_array.js +32 -0
  80. package/src/core/graph/csr/csr_build_incidence.d.ts +26 -0
  81. package/src/core/graph/csr/csr_build_incidence.d.ts.map +1 -0
  82. package/src/core/graph/csr/csr_build_incidence.js +71 -0
  83. package/src/core/graph/csr/csr_graph_color_greedy.d.ts +25 -0
  84. package/src/core/graph/csr/csr_graph_color_greedy.d.ts.map +1 -0
  85. package/src/core/graph/csr/csr_graph_color_greedy.js +83 -0
  86. package/src/core/graph/csr/csr_graph_validate_coloring.d.ts +15 -0
  87. package/src/core/graph/csr/csr_graph_validate_coloring.d.ts.map +1 -0
  88. package/src/core/graph/csr/csr_graph_validate_coloring.js +33 -0
  89. package/src/core/math/hash/XXH128Hash.d.ts +38 -0
  90. package/src/core/math/hash/XXH128Hash.d.ts.map +1 -0
  91. package/src/core/math/hash/XXH128Hash.js +55 -0
  92. package/src/core/math/hash/XXH3_SECRET.d.ts +13 -0
  93. package/src/core/math/hash/XXH3_SECRET.d.ts.map +1 -0
  94. package/src/core/math/hash/XXH3_SECRET.js +25 -0
  95. package/src/core/math/hash/crc32.d.ts +16 -0
  96. package/src/core/math/hash/crc32.d.ts.map +1 -0
  97. package/src/core/math/hash/crc32.js +96 -0
  98. package/src/core/math/hash/xxh3_128.d.ts +10 -0
  99. package/src/core/math/hash/xxh3_128.d.ts.map +1 -0
  100. package/src/core/math/hash/xxh3_128.js +341 -0
  101. package/src/core/math/hash/xxh3_64.d.ts +9 -0
  102. package/src/core/math/hash/xxh3_64.d.ts.map +1 -0
  103. package/src/core/math/hash/xxh3_64.js +241 -0
  104. package/src/core/math/hash/xxh3_common.d.ts +224 -0
  105. package/src/core/math/hash/xxh3_common.d.ts.map +1 -0
  106. package/src/core/math/hash/xxh3_common.js +476 -0
  107. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts +26 -0
  108. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts.map +1 -0
  109. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.js +71 -0
  110. package/src/core/math/lookup/ParameterLookupTable.js +2 -2
  111. package/src/core/math/max2_exact.d.ts +15 -0
  112. package/src/core/math/max2_exact.d.ts.map +1 -0
  113. package/src/core/math/max2_exact.js +30 -0
  114. package/src/core/math/min2_exact.d.ts +20 -0
  115. package/src/core/math/min2_exact.d.ts.map +1 -0
  116. package/src/core/math/min2_exact.js +35 -0
  117. package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
  118. package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
  119. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
  120. package/src/engine/asset/AssetDescription.js +2 -2
  121. package/src/engine/ecs/animation/Animation.js +2 -2
  122. package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
  123. package/src/engine/ecs/animation/AnimationClip.js +7 -5
  124. package/src/engine/ecs/gui/GUIElement.d.ts.map +1 -1
  125. package/src/engine/ecs/gui/GUIElement.js +7 -5
  126. package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
  127. package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
  128. package/src/engine/ecs/gui/position/ViewportPosition.js +11 -7
  129. package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -1
  130. package/src/engine/ecs/ik/IKGoalSystem.js +3 -19
  131. package/src/engine/ecs/parent/parent_entity_model_of.d.ts +17 -0
  132. package/src/engine/ecs/parent/parent_entity_model_of.d.ts.map +1 -0
  133. package/src/engine/ecs/parent/parent_entity_model_of.js +26 -0
  134. package/src/engine/ecs/transform/Transform64.d.ts +1 -1
  135. package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
  136. package/src/engine/ecs/transform/Transform64.js +5 -4
  137. package/src/engine/ecs/transform/t64_read_pose_array.d.ts +15 -0
  138. package/src/engine/ecs/transform/t64_read_pose_array.d.ts.map +1 -0
  139. package/src/engine/ecs/transform/t64_read_pose_array.js +24 -0
  140. package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
  141. package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +8 -5
  142. package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -2
  143. package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
  144. package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -2
  145. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -2
  146. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
  147. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.d.ts.map +1 -1
  148. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +8 -5
  149. package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
  150. package/src/engine/graphics/ecs/decal/v2/Decal.js +9 -8
  151. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts +2 -0
  152. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map +1 -1
  153. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js +10 -21
  154. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -1
  155. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +9 -6
  156. package/src/engine/graphics3/AnimationGraphSystem.d.ts +5 -0
  157. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  158. package/src/engine/graphics3/AnimationGraphSystem.js +48 -2
  159. package/src/engine/graphics3/AnimationSystem.d.ts +5 -0
  160. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  161. package/src/engine/graphics3/AnimationSystem.js +47 -2
  162. package/src/engine/graphics3/ParticipatingMedia.js +204 -204
  163. package/src/engine/graphics3/animation/AnimationClips.d.ts +5 -0
  164. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
  165. package/src/engine/graphics3/animation/AnimationClips.js +5 -0
  166. package/src/engine/graphics3/register_clips.d.ts +29 -0
  167. package/src/engine/graphics3/register_clips.d.ts.map +1 -1
  168. package/src/engine/graphics3/register_clips.js +52 -0
  169. package/src/engine/grid/obstacle/GridObstacle.js +2 -2
  170. package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
  171. package/src/engine/interpolation/Interpolated.js +2 -2
  172. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +9 -0
  173. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
  174. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +3 -1
  175. package/src/engine/physics/cloth/PLAN.md +10 -8
  176. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +22 -0
  177. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -1
  178. package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +51 -19
  179. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
  180. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +16 -2
  181. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -1
  182. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +19 -24
  183. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +7 -0
  184. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -1
  185. package/src/engine/physics/cloth/collider/ClothColliderIndex.js +85 -67
  186. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -1
  187. package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +19 -101
  188. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +2 -5
  189. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -1
  190. package/src/engine/physics/cloth/collider/cloth_collider_pack.js +7 -15
  191. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -1
  192. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +16 -61
  193. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  194. package/src/engine/physics/cloth/ecs/Cloth.js +7 -5
  195. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -1
  196. package/src/engine/physics/cloth/ecs/ClothCollider.js +7 -5
  197. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +0 -1
  198. package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +6 -19
  199. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +1 -2
  200. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
  201. package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +3 -12
  202. package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
  203. package/src/engine/physics/cloth/ecs/ClothDynamics.js +20 -11
  204. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  205. package/src/engine/physics/cloth/ecs/ClothWorld.js +40 -130
  206. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  207. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +17 -58
  208. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  209. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +3 -3
  210. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
  211. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +44 -104
  212. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -1
  213. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +6 -13
  214. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -1
  215. package/src/engine/physics/cloth/ecs/cloth_holds.js +15 -40
  216. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
  217. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +45 -79
  218. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  219. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +7 -27
  220. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  221. package/src/engine/physics/cloth/ecs/cloth_write_back.js +30 -62
  222. package/src/engine/physics/cloth/playground/cloth_playground_build.d.ts.map +1 -1
  223. package/src/engine/physics/cloth/playground/cloth_playground_build.js +2 -3
  224. package/src/engine/physics/cloth/playground/collide_main.js +2 -28
  225. package/src/engine/physics/cloth/playground/garment_main.js +4 -19
  226. package/src/engine/physics/cloth/playground/main.js +6 -48
  227. package/src/engine/physics/cloth/playground/rig_main.js +947 -955
  228. package/src/engine/physics/cloth/playground/wind_main.js +8 -7
  229. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  230. package/src/engine/physics/cloth/solver/ClothState.js +16 -76
  231. package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts +10 -8
  232. package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts.map +1 -1
  233. package/src/engine/physics/cloth/solver/cloth_color_particles.js +30 -102
  234. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  235. package/src/engine/physics/cloth/solver/cloth_contact_find.js +3 -2
  236. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -1
  237. package/src/engine/physics/cloth/solver/cloth_hold_line.js +2 -14
  238. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts +21 -0
  239. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts.map +1 -0
  240. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.js +45 -0
  241. package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts +32 -0
  242. package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts.map +1 -0
  243. package/src/engine/physics/cloth/solver/cloth_particle_coupling.js +133 -0
  244. package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts +16 -0
  245. package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts.map +1 -0
  246. package/src/engine/physics/cloth/solver/cloth_particle_of_source.js +19 -0
  247. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  248. package/src/engine/physics/cloth/solver/cloth_self_find.js +6 -55
  249. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
  250. package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +30 -65
  251. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  252. package/src/engine/physics/cloth/solver/cloth_step.js +6 -28
  253. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  254. package/src/engine/physics/cloth/solver/cloth_step_instance.js +2 -3
  255. package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts +21 -0
  256. package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts.map +1 -0
  257. package/src/engine/physics/cloth/solver/cloth_stretch_residual.js +54 -0
  258. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts +15 -0
  259. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts.map +1 -1
  260. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.js +28 -0
  261. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts +30 -0
  262. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts.map +1 -0
  263. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.js +56 -0
  264. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  265. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +3 -17
  266. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +2 -1
  267. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
  268. package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -25
  269. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +3 -1
  270. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
  271. package/src/engine/physics/cloth/wind/cloth_sample_air.js +40 -62
  272. package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -1
  273. package/src/engine/physics/ecs/ContactProbeSystem.js +2 -18
  274. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  275. package/src/engine/physics/ecs/PhysicsSystem.js +9 -50
  276. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  277. package/src/engine/physics/fluid/FluidField.js +7 -5
  278. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
  279. package/src/engine/physics/fluid/ecs/FluidComponent.js +19 -11
  280. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts +24 -0
  281. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts.map +1 -0
  282. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.js +42 -0
  283. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts +25 -0
  284. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts.map +1 -0
  285. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.js +40 -0
  286. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +2 -2
  287. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +2 -2
  288. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  289. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +11 -7
  290. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
  291. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +11 -7
  292. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
  293. package/src/engine/physics/fluid/effector/WakeFluidEffector.js +16 -9
  294. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -1
  295. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +40 -90
  296. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
  297. package/src/engine/physics/narrowphase/capsule_contacts.js +3 -5
  298. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
  299. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +2 -14
  300. package/src/engine/physics/narrowphase/hull_sphere_contact.d.ts.map +1 -1
  301. package/src/engine/physics/narrowphase/hull_sphere_contact.js +2 -5
  302. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  303. package/src/engine/physics/narrowphase/narrowphase_step.js +13 -32
  304. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
  305. package/src/engine/physics/narrowphase/sphere_box_contact.js +2 -5
  306. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
  307. package/src/engine/sound/ecs/audio/AudioEmitter.js +12 -7
  308. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
  309. package/src/engine/sound/ecs/trigger/AudioEventTrigger.js +192 -191
  310. package/src/engine/sound/simulation/core/AcousticMedium.js +2 -2
  311. package/src/engine/sound/simulation/definition/AcousticDirectivity.js +2 -2
  312. package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
  313. package/src/engine/sound/simulation/definition/AcousticMaterial.js +11 -7
  314. package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -1
  315. package/src/engine/sound/sopra/definition/BusDefinition.js +5 -4
  316. package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -1
  317. package/src/engine/sound/sopra/definition/DuckingRule.js +7 -5
  318. package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
  319. package/src/engine/sound/sopra/definition/EventDescription.js +23 -13
  320. package/src/engine/sound/sopra/definition/MixerSnapshot.js +2 -2
  321. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -1
  322. package/src/engine/sound/sopra/definition/ParameterDefinition.js +7 -5
  323. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +2 -2
  324. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -1
  325. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +4 -3
  326. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +2 -2
  327. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +3 -3
  328. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -1
  329. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +16 -9
  330. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +2 -2
  331. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +1 -1
  332. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -1
  333. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +2 -2
  334. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
  335. package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +7 -5
  336. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
  337. package/src/engine/sound/sopra/definition/effect/EqEffect.js +8 -5
  338. package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +2 -2
  339. package/src/engine/sound/sopra/legacy/SoundEmitter.d.ts.map +1 -1
  340. package/src/engine/sound/sopra/legacy/SoundEmitter.js +357 -352
  341. package/src/engine/sound/sopra/legacy/SoundTrack.d.ts.map +1 -1
  342. package/src/engine/sound/sopra/legacy/SoundTrack.js +281 -278
  343. package/src/format/image/png/PNGReader.js +644 -644
  344. package/src/format/image/png/crc32.d.ts +1 -1
  345. package/src/format/image/png/crc32.js +7 -8
  346. package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -1
  347. package/src/format/texture/basis/transcode/etc1s_to_astc.js +2 -1
  348. package/src/shade/descriptor/binding/BindGroupLayoutDescriptor.js +2 -2
  349. package/src/shade/descriptor/binding/BindGroupLayoutEntry.d.ts.map +1 -1
  350. package/src/shade/descriptor/binding/BindGroupLayoutEntry.js +12 -8
  351. package/src/shade/descriptor/binding/StorageTextureBindingLayout.js +2 -2
  352. package/src/shade/descriptor/binding/TextureBindingLayout.js +2 -2
  353. package/src/shade/descriptor/blend/BlendComponent.js +2 -2
  354. package/src/shade/descriptor/pipeline/PipelineDescriptorBase.js +2 -2
  355. package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +2 -2
  356. package/src/shade/descriptor/pipeline/ProgrammableStage.js +2 -2
  357. package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +2 -2
  358. package/src/shade/descriptor/pipeline/render/ColorTargetState.js +2 -2
  359. package/src/shade/descriptor/pipeline/render/FragmentState.js +2 -2
  360. package/src/shade/descriptor/pipeline/render/PrimitiveState.js +2 -2
  361. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
  362. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +8 -5
  363. package/src/shade/descriptor/pipeline/render/VertexAttribute.js +2 -2
  364. package/src/shade/descriptor/texture/SamplerDescriptor.d.ts.map +1 -1
  365. package/src/shade/descriptor/texture/SamplerDescriptor.js +20 -12
  366. package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
  367. package/src/shade/descriptor/texture/TextureDescriptor.js +11 -7
  368. package/src/shade/device/graph/BufferResourceDescriptor.d.ts.map +1 -1
  369. package/src/shade/device/graph/BufferResourceDescriptor.js +196 -193
  370. package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
  371. package/src/shade/device/graph/TextureResourceDescriptor.js +178 -173
  372. package/src/shade/device/timing/profile/sgpt_read_header.js +1 -1
  373. package/src/shade/device/timing/profile/sgpt_read_records.js +1 -1
  374. package/src/shade/device/timing/profile/sgpt_write_header.js +1 -1
  375. package/src/shade/device/timing/profile/sgpt_write_record.js +1 -1
  376. package/src/shade/playground/image_decode_bench/main.js +2 -1
  377. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  378. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +2 -1
  379. package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.d.ts.map +1 -1
  380. package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +2 -1
  381. package/src/shade/playground/ssr_variance/statistics.d.ts.map +1 -1
  382. package/src/shade/playground/ssr_variance/statistics.js +2 -1
  383. package/src/shade/playground/texture_encode/main.d.ts.map +1 -1
  384. package/src/shade/playground/texture_encode/main.js +2 -1
  385. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  386. package/src/shade/playground/volumetrics_froxel/measure.js +2 -1
  387. package/src/shade/renderer/binding/BufferBinding.js +2 -2
  388. package/src/shade/renderer/buffer/table/gpu_database_check_links.d.ts.map +1 -1
  389. package/src/shade/renderer/buffer/table/gpu_database_check_links.js +2 -1
  390. package/src/shade/renderer/camera/Camera.js +2 -2
  391. package/src/shade/renderer/geometry/Attribute.js +2 -2
  392. package/src/shade/renderer/geometry/Geometry.js +2 -2
  393. package/src/shade/renderer/geometry/geometry_deduplicate_vertices.js +2 -2
  394. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +2 -2
  395. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  396. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +3 -2
  397. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.d.ts.map +1 -1
  398. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.js +2 -1
  399. package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.d.ts.map +1 -1
  400. package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.js +2 -1
  401. package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.d.ts.map +1 -1
  402. package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.js +2 -1
  403. package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.d.ts.map +1 -1
  404. package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js +3 -2
  405. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.d.ts.map +1 -1
  406. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js +2 -1
  407. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.d.ts.map +1 -1
  408. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js +2 -1
  409. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_asset_id.js +13 -13
  410. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_directory_block_checksum.js +41 -41
  411. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_frame_checksum.js +41 -41
  412. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_header_checksum.js +25 -25
  413. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
  414. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +3 -2
  415. package/src/shade/renderer/material/StandardShadeMaterial.d.ts.map +1 -1
  416. package/src/shade/renderer/material/StandardShadeMaterial.js +13 -8
  417. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.d.ts.map +1 -1
  418. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.js +3 -2
  419. package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.d.ts.map +1 -1
  420. package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.js +14 -5
  421. package/src/shade/renderer/scene/optimization/sampler2d_from_image_bitmap.js +1 -1
  422. package/src/shade/renderer/shader/type/WGSLStructField.js +2 -2
  423. package/src/shade/renderer/shader/type/WebGPUArray.js +2 -2
  424. package/src/shade/renderer/shader/type/WebGPUStruct.d.ts.map +1 -1
  425. package/src/shade/renderer/shader/type/WebGPUStruct.js +9 -6
  426. package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
  427. package/src/shade/renderer/texture/ShadeTexture.js +17 -10
  428. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +2 -2
  429. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -4
  430. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +6 -6
  431. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  432. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +46 -55
  433. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +3 -3
  434. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
  435. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +14 -4
  436. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +10 -1
  437. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  438. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +82 -40
  439. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +4 -1
  440. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  441. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +8 -4
  442. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +98 -86
  443. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
  444. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +440 -298
  445. package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
  446. package/src/view/common/HTMLElementCacheKey.js +4 -3
  447. package/src/view/minimap/MinimapMarker.js +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloth_worst_tether_ratio.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_worst_tether_ratio.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,mDATW,YAAY,GAAC,YAAY,oBACzB,UAAU,GAAC,WAAW,GAAC,MAAM,EAAE,YAC/B,YAAY,GAAC,YAAY,GAAC,MAAM,EAAE,cAClC,MAAM,GACJ,MAAM,CA6BlB"}
@@ -0,0 +1,56 @@
1
+ import { v3_length } from "../../../../core/geom/vec3/v3_length.js";
2
+ import { max2_exact } from "../../../../core/math/max2_exact.js";
3
+
4
+ /**
5
+ * How far the cloth has stretched away from its root, as the worst ratio over
6
+ * nodes of straight-line distance from node 0 to the fabric between them:
7
+ * `max ‖x_node − x_0‖ / d_geo(node)` over nodes `1 .. node_count − 1` — §7 P2's
8
+ * measure. At most 1 for a cloth that has not over-stretched anywhere, since no
9
+ * straight line is longer than the fabric it spans; `1.05` is a node five
10
+ * percent further out than the cloth reaches.
11
+ *
12
+ * Everything is measured from node 0, the root of the seeder's tree, which is
13
+ * where the rigs this was written for are held. A cloth held in several places
14
+ * wants each node measured from its own hold instead, and this is not that
15
+ * measure.
16
+ *
17
+ * A node at a NaN position reads NaN and so does the answer, whatever the other
18
+ * nodes say, so a broken state cannot pass for a well-behaved one.
19
+ *
20
+ * Takes the arrays rather than a `ClothInstance` so the solver side does not
21
+ * depend on the ECS one.
22
+ *
23
+ * @param {Float32Array|Float64Array} position 3 per particle
24
+ * @param {Int32Array|Uint32Array|number[]} particle_of_node particle index per node
25
+ * @param {Float32Array|Float64Array|number[]} geodesic fabric distance from node 0 per node, metres
26
+ * @param {number} node_count
27
+ * @returns {number} dimensionless; 0 for a cloth of fewer than two nodes
28
+ *
29
+ * @author Alex Goldring
30
+ * @copyright Company Named Limited (c) 2026
31
+ */
32
+ export function cloth_worst_tether_ratio(position, particle_of_node, geodesic, node_count) {
33
+ const root = particle_of_node[0] * 3;
34
+
35
+ const root_x = position[root];
36
+ const root_y = position[root + 1];
37
+ const root_z = position[root + 2];
38
+
39
+ let worst = 0;
40
+
41
+ for (let node = 1; node < node_count; node++) {
42
+ const p = particle_of_node[node] * 3;
43
+
44
+ const distance = v3_length(
45
+ position[p] - root_x,
46
+ position[p + 1] - root_y,
47
+ position[p + 2] - root_z
48
+ );
49
+
50
+ const ratio = distance / geodesic[node];
51
+
52
+ worst = max2_exact(worst, ratio);
53
+ }
54
+
55
+ return worst;
56
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_contact_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_contact_row.js"],"names":[],"mappings":"AAuHA;;;;;;;;GAQG;AACH,sDANW,YAAY,+BAEZ,MAAM,SACN,YAAY,GAAC,YAAY,QA+LnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,mEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QA8ChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,oEALW,YAAY,GAAC,YAAY,QACzB,MAAM,eACN,MAAM,qBACN,MAAM,QAqGhB;AAxdD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;GAKG;AACH,qCAFU,MAAM,CAE2B"}
1
+ {"version":3,"file":"cloth_contact_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_contact_row.js"],"names":[],"mappings":"AAwHA;;;;;;;;GAQG;AACH,sDANW,YAAY,+BAEZ,MAAM,SACN,YAAY,GAAC,YAAY,QA+LnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,mEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QA8ChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,oEALW,YAAY,GAAC,YAAY,QACzB,MAAM,eACN,MAAM,qBACN,MAAM,QAqGhB;AAxdD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;GAKG;AACH,qCAFU,MAAM,CAE2B"}
@@ -1,3 +1,4 @@
1
+ import { clamp } from "../../../../../core/math/clamp.js";
1
2
  import {
2
3
  CCR_FEATURE,
3
4
  CCR_FRICTION,
@@ -373,8 +374,8 @@ export function cloth_contact_warm_start(state, alpha, gamma, k_min_ratio, k_max
373
374
  lambda[slot] *= decay;
374
375
  friction_lambda[slot] *= decay;
375
376
 
376
- penalty[slot] = clamp_band(penalty[slot] * gamma, lo, hi);
377
- friction_penalty[slot] = clamp_band(friction_penalty[slot] * gamma, lo, hi);
377
+ penalty[slot] = clamp(penalty[slot] * gamma, lo, hi);
378
+ friction_penalty[slot] = clamp(friction_penalty[slot] * gamma, lo, hi);
378
379
  }
379
380
  }
380
381
  }
@@ -496,21 +497,6 @@ export function cloth_contact_dual_update(state, table, beta, k_max_ratio, inver
496
497
  }
497
498
  }
498
499
 
499
- /**
500
- * @param {number} value
501
- * @param {number} lo
502
- * @param {number} hi
503
- * @returns {number}
504
- * @private
505
- */
506
- function clamp_band(value, lo, hi) {
507
- if (value < lo) {
508
- return lo;
509
- }
510
-
511
- return value > hi ? hi : value;
512
- }
513
-
514
500
  /**
515
501
  * @type {Float64Array}
516
502
  * @private
@@ -21,7 +21,8 @@
21
21
  * callers (vegetation sway, dust drift) interpret the field as a direction ×
22
22
  * magnitude wind". Cloth's drag row is a relaxation toward a **velocity**, so
23
23
  * the same wind voxelised at 0.25 m instead of 1 m would blow a garment four
24
- * times as hard. The multiply by `cell_size` is here. `MEASUREMENTS.md` §45.
24
+ * times as hard. The multiply by `cell_size` is
25
+ * {@link fluid_sample_velocity_world_mps}'s. `MEASUREMENTS.md` §45.
25
26
  * - **Unbuilt fields read as null.** A `FluidComponent` exists from the moment
26
27
  * the entity is spawned and its field's buffers arrive at `build()`. Sampling
27
28
  * before that is a null dereference rather than a zero, so an unbuilt field is
@@ -1 +1 @@
1
- {"version":3,"file":"ClothFluidWind.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/ClothFluidWind.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH;IAEI;;;;OAIG;IACH,SAFU,gBAAgB,CAEO;IAEjC;;;;OAIG;IACH,qBAAkB;IAElB;;;OAGG;IACH,iBAAc;IAEd;;;OAGG;IACH,gBAAY;CAkIf;kCAnNiC,wBAAwB;iCACzB,uBAAuB"}
1
+ {"version":3,"file":"ClothFluidWind.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/ClothFluidWind.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH;IAEI;;;;OAIG;IACH,SAFU,gBAAgB,CAEO;IAEjC;;;;OAIG;IACH,qBAAkB;IAElB;;;OAGG;IACH,iBAAc;IAEd;;;OAGG;IACH,gBAAY;CA6Gf;kCA/LiC,wBAAwB;iCACzB,uBAAuB"}
@@ -1,4 +1,6 @@
1
1
  import { FluidComponent } from "../../fluid/ecs/FluidComponent.js";
2
+ import { fluid_sample_domain_bounds } from "../../fluid/ecs/fluid_sample_domain_bounds.js";
3
+ import { fluid_sample_velocity_world_mps } from "../../fluid/ecs/fluid_sample_velocity_world_mps.js";
2
4
  import { AbstractClothWind } from "./AbstractClothWind.js";
3
5
  import { ClothAmbientWind } from "./ClothAmbientWind.js";
4
6
 
@@ -25,7 +27,8 @@ import { ClothAmbientWind } from "./ClothAmbientWind.js";
25
27
  * callers (vegetation sway, dust drift) interpret the field as a direction ×
26
28
  * magnitude wind". Cloth's drag row is a relaxation toward a **velocity**, so
27
29
  * the same wind voxelised at 0.25 m instead of 1 m would blow a garment four
28
- * times as hard. The multiply by `cell_size` is here. `MEASUREMENTS.md` §45.
30
+ * times as hard. The multiply by `cell_size` is
31
+ * {@link fluid_sample_velocity_world_mps}'s. `MEASUREMENTS.md` §45.
29
32
  * - **Unbuilt fields read as null.** A `FluidComponent` exists from the moment
30
33
  * the entity is spawned and its field's buffers arrive at `build()`. Sampling
31
34
  * before that is a null dereference rather than a zero, so an unbuilt field is
@@ -109,20 +112,7 @@ export class ClothFluidWind extends AbstractClothWind {
109
112
  return;
110
113
  }
111
114
 
112
- const resolution = field.getResolution();
113
-
114
- const cell_size = component.cell_size;
115
-
116
- const origin = component.origin;
117
-
118
- const b = count * 6;
119
-
120
- bounds[b] = origin[0];
121
- bounds[b + 1] = origin[1];
122
- bounds[b + 2] = origin[2];
123
- bounds[b + 3] = origin[0] + resolution[0] * cell_size;
124
- bounds[b + 4] = origin[1] + resolution[1] * cell_size;
125
- bounds[b + 5] = origin[2] + resolution[2] * cell_size;
115
+ fluid_sample_domain_bounds(bounds, count * 6, component);
126
116
 
127
117
  components[count] = component;
128
118
 
@@ -194,16 +184,8 @@ export class ClothFluidWind extends AbstractClothWind {
194
184
  continue;
195
185
  }
196
186
 
197
- const component = this.__components[i];
198
-
199
- component.sampleVelocityAtWorld(out, x, y, z);
200
-
201
- // Cells per second to metres per second. See the header.
202
- const cell_size = component.cell_size;
203
-
204
- out[0] *= cell_size;
205
- out[1] *= cell_size;
206
- out[2] *= cell_size;
187
+ // In metres per second, not the field's cells per second. See the header.
188
+ fluid_sample_velocity_world_mps(out, 0, this.__components[i], x, y, z);
207
189
 
208
190
  return out;
209
191
  }
@@ -92,10 +92,12 @@ export function cloth_air_changed(state: ClothState, wind: AbstractClothWind, fr
92
92
  * The cloth's world-space axis-aligned bounds.
93
93
  *
94
94
  * The particles are local, so this is the bounds of the **rotated** local box
95
- * rather than the rotation of its bounds — the same eight-corner argument
95
+ * rather than the rotation of its bounds — the same argument
96
96
  * `cloth_gather_colliders` makes for its own query volume, and the same reason:
97
97
  * a rotated box is not a box.
98
98
  *
99
+ * A cloth with no particles has the empty box, `+∞` below and `−∞` above.
100
+ *
99
101
  * @param {ClothState} state
100
102
  * @param {Float64Array} frame_translation
101
103
  * @param {Float64Array} frame_rotation
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_sample_air.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/cloth_sample_air.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;;;GAaG;AACH,gGARW,YAAY,kBACZ,YAAY,WACZ,YAAY,SAEZ,MAAM,GAEJ,OAAO,CA8EnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iGATW,YAAY,kBACZ,YAAY,YACZ,YAAY,aACZ,MAAM,QACN,MAAM,GAGJ,OAAO,CAsBnB;AAED;;;;;;;;;;;;;GAaG;AACH,uEALW,YAAY,kBACZ,YAAY,OACZ,YAAY,GACV,IAAI,CAoEhB"}
1
+ {"version":3,"file":"cloth_sample_air.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/cloth_sample_air.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;;;GAaG;AACH,gGARW,YAAY,kBACZ,YAAY,WACZ,YAAY,SAEZ,MAAM,GAEJ,OAAO,CA8EnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iGATW,YAAY,kBACZ,YAAY,YACZ,YAAY,aACZ,MAAM,QACN,MAAM,GAGJ,OAAO,CAsBnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,uEALW,YAAY,kBACZ,YAAY,OACZ,YAAY,GACV,IAAI,CA4BhB"}
@@ -1,3 +1,5 @@
1
+ import { aabb3_from_v3_array } from "../../../../core/geom/3d/aabb/aabb3_from_v3_array.js";
2
+ import { aabb3_transform_oriented_array } from "../../../../core/geom/3d/aabb/aabb3_transform_oriented.js";
1
3
  import { v3_quaternion_apply } from "../../../../core/geom/vec3/v3_quaternion_apply.js";
2
4
  import { v3_quaternion_apply_inverse } from "../../../../core/geom/vec3/v3_quaternion_apply_inverse.js";
3
5
 
@@ -194,10 +196,12 @@ export function cloth_air_changed(state, wind, frame_translation, frame_rotation
194
196
  * The cloth's world-space axis-aligned bounds.
195
197
  *
196
198
  * The particles are local, so this is the bounds of the **rotated** local box
197
- * rather than the rotation of its bounds — the same eight-corner argument
199
+ * rather than the rotation of its bounds — the same argument
198
200
  * `cloth_gather_colliders` makes for its own query volume, and the same reason:
199
201
  * a rotated box is not a box.
200
202
  *
203
+ * A cloth with no particles has the empty box, `+∞` below and `−∞` above.
204
+ *
201
205
  * @param {ClothState} state
202
206
  * @param {Float64Array} frame_translation
203
207
  * @param {Float64Array} frame_rotation
@@ -205,71 +209,31 @@ export function cloth_air_changed(state, wind, frame_translation, frame_rotation
205
209
  * @returns {void}
206
210
  */
207
211
  export function cloth_air_bounds(state, frame_translation, frame_rotation, out) {
208
- const particle_count = state.particle_count;
209
-
210
- const position = state.position;
211
-
212
- let min_x = Infinity;
213
- let min_y = Infinity;
214
- let min_z = Infinity;
215
- let max_x = -Infinity;
216
- let max_y = -Infinity;
217
- let max_z = -Infinity;
218
-
219
- for (let i = 0; i < particle_count; i++) {
220
- const p = i * 3;
221
-
222
- const x = position[p];
223
- const y = position[p + 1];
224
- const z = position[p + 2];
225
-
226
- if (x < min_x) { min_x = x; }
227
- if (y < min_y) { min_y = y; }
228
- if (z < min_z) { min_z = z; }
229
- if (x > max_x) { max_x = x; }
230
- if (y > max_y) { max_y = y; }
231
- if (z > max_z) { max_z = z; }
212
+ if (state.particle_count === 0) {
213
+ // Rotating the empty box would subtract infinities and read NaN.
214
+ out[0] = Infinity;
215
+ out[1] = Infinity;
216
+ out[2] = Infinity;
217
+ out[3] = -Infinity;
218
+ out[4] = -Infinity;
219
+ out[5] = -Infinity;
220
+
221
+ return;
232
222
  }
233
223
 
234
- const qx = frame_rotation[0];
235
- const qy = frame_rotation[1];
236
- const qz = frame_rotation[2];
237
- const qw = frame_rotation[3];
224
+ aabb3_from_v3_array(LOCAL_BOX, state.position, state.particle_count * 3);
238
225
 
239
- let world_min_x = Infinity;
240
- let world_min_y = Infinity;
241
- let world_min_z = Infinity;
242
- let world_max_x = -Infinity;
243
- let world_max_y = -Infinity;
244
- let world_max_z = -Infinity;
245
-
246
- for (let corner = 0; corner < 8; corner++) {
247
- v3_quaternion_apply(
248
- WORLD, 0,
249
- (corner & 1) === 0 ? min_x : max_x,
250
- (corner & 2) === 0 ? min_y : max_y,
251
- (corner & 4) === 0 ? min_z : max_z,
252
- qx, qy, qz, qw
253
- );
254
-
255
- const x = WORLD[0] + frame_translation[0];
256
- const y = WORLD[1] + frame_translation[1];
257
- const z = WORLD[2] + frame_translation[2];
258
-
259
- if (x < world_min_x) { world_min_x = x; }
260
- if (y < world_min_y) { world_min_y = y; }
261
- if (z < world_min_z) { world_min_z = z; }
262
- if (x > world_max_x) { world_max_x = x; }
263
- if (y > world_max_y) { world_max_y = y; }
264
- if (z > world_max_z) { world_max_z = z; }
265
- }
226
+ // The frame pose as the seven contiguous numbers the transform reads,
227
+ // translation then rotation.
228
+ FRAME_POSE[0] = frame_translation[0];
229
+ FRAME_POSE[1] = frame_translation[1];
230
+ FRAME_POSE[2] = frame_translation[2];
231
+ FRAME_POSE[3] = frame_rotation[0];
232
+ FRAME_POSE[4] = frame_rotation[1];
233
+ FRAME_POSE[5] = frame_rotation[2];
234
+ FRAME_POSE[6] = frame_rotation[3];
266
235
 
267
- out[0] = world_min_x;
268
- out[1] = world_min_y;
269
- out[2] = world_min_z;
270
- out[3] = world_max_x;
271
- out[4] = world_max_y;
272
- out[5] = world_max_z;
236
+ aabb3_transform_oriented_array(out, 0, LOCAL_BOX, 0, FRAME_POSE, 0);
273
237
  }
274
238
 
275
239
  /**
@@ -278,6 +242,20 @@ export function cloth_air_bounds(state, frame_translation, frame_rotation, out)
278
242
  */
279
243
  const BOUNDS = new Float64Array(6);
280
244
 
245
+ /**
246
+ * The cloth's particle bounds in its local frame.
247
+ * @type {Float64Array}
248
+ * @private
249
+ */
250
+ const LOCAL_BOX = new Float64Array(6);
251
+
252
+ /**
253
+ * The cloth's frame pose, `[px, py, pz, qx, qy, qz, qw]`, for {@link aabb3_transform_oriented_array}.
254
+ * @type {Float64Array}
255
+ * @private
256
+ */
257
+ const FRAME_POSE = new Float64Array(7);
258
+
281
259
  /**
282
260
  * @type {Float64Array}
283
261
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"ContactProbeSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/ecs/ContactProbeSystem.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;GAaG;AACH;;IAEI,mEAAmD;IAEnD,2bASE;IAyCF;;;;OAIG;IACH,YAJW,YAAY,cACZ,mBAAmB,UACnB,MAAM,QAUhB;IAED;;;;OAIG;IACH,cAJW,YAAY,cACZ,mBAAmB,UACnB,MAAM,QAWhB;IAED,sCA2BC;;CAiKJ;uBA1VsB,qBAAqB;oCAER,uDAAuD;6BAY9D,mBAAmB;4BALzC,oCAAoC;4CAbC,oDAAoD;yBAiBvE,eAAe;yCAHC,uDAAuD;0BAbtE,kCAAkC;kCAC1B,oCAAoC;6BACzC,kCAAkC"}
1
+ {"version":3,"file":"ContactProbeSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/ecs/ContactProbeSystem.js"],"names":[],"mappings":"AAsEA;;;;;;;;;;;;;GAaG;AACH;;IAEI,mEAAmD;IAEnD,2bASE;IAyCF;;;;OAIG;IACH,YAJW,YAAY,cACZ,mBAAmB,UACnB,MAAM,QAUhB;IAED;;;;OAIG;IACH,cAJW,YAAY,cACZ,mBAAmB,UACnB,MAAM,QAWhB;IAED,sCA2BC;;CAiKJ;uBA1VsB,qBAAqB;oCAER,uDAAuD;6BAY9D,mBAAmB;4BALzC,oCAAoC;4CAdC,oDAAoD;yBAkBvE,eAAe;yCAHC,uDAAuD;0BAdtE,kCAAkC;kCAC1B,oCAAoC;6BACzC,kCAAkC"}
@@ -8,6 +8,7 @@ import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessS
8
8
  import { Animation } from "../../ecs/animation/Animation.js";
9
9
  import { GPUStateAuthority } from "../../ecs/gpu/GPUStateAuthority.js";
10
10
  import { ParentEntity } from "../../ecs/parent/ParentEntity.js";
11
+ import { parent_entity_model_of } from "../../ecs/parent/parent_entity_model_of.js";
11
12
  import { System } from "../../ecs/System.js";
12
13
  import { TRANSFORM_ATTACHMENT_EVENT_CHANGE } from "../../ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.js";
13
14
  import { TransformAttachment } from "../../ecs/transform-attachment/TransformAttachment.js";
@@ -327,7 +328,7 @@ export class ContactProbeSystem extends System {
327
328
  #world_of(result, entity) {
328
329
  const dataset = this.entityManager.dataset;
329
330
 
330
- const model = model_of(dataset, entity);
331
+ const model = parent_entity_model_of(dataset, entity);
331
332
 
332
333
  let cache = this.#caches.get(model);
333
334
 
@@ -356,23 +357,6 @@ export class ContactProbeSystem extends System {
356
357
  }
357
358
  }
358
359
 
359
- /**
360
- * The entity whose clips drive `entity`: the model its lifetime belongs to, or itself.
361
- *
362
- * @param {EntityComponentDataset} dataset
363
- * @param {number} entity
364
- * @returns {number}
365
- */
366
- function model_of(dataset, entity) {
367
- const owner = dataset.getComponent(entity, ParentEntity);
368
-
369
- if (owner === undefined || owner === null) {
370
- return entity;
371
- }
372
-
373
- return owner.entity;
374
- }
375
-
376
360
  /**
377
361
  * The top of the lifetime chain an entity belongs to.
378
362
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PhysicsSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/ecs/PhysicsSystem.js"],"names":[],"mappings":"AAqLA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;;IAEI,wDAAwC;IACxC,oKAIE;IAEF;;;;OAIG;IACH,kBAHU,WAAW,CAGO;IAE5B;;;;OAIG;IACH,WAFU,GAAG,CAES;IAEtB;;;;OAIG;IACH,YAFU,GAAG,CAEU;IAEvB;;;;OAIG;IACH,oBAHU,aAAa,CAGS;IAEhC;;;;;OAKG;IACH,OAFU,QAAQ,CAEK;IAEvB;;;;OAIG;IACH,eAFU,kBAAkB,CAEa;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W,CAAC,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAC,QAAQ,KAAG,OAAO,GAEzC,OAAO,CAInB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,uDATW,UAAU,MAAM,CAAC,wCAMjB,CAAC,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAC,QAAQ,KAAG,OAAO,GACzC,OAAO,CAInB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,0CATW,UAAU,MAAM,CAAC,YAEjB,UAAU,MAAM,CAAC,UACjB,WAAW,GAAC,MAAM,EAAE,iBACpB,MAAM,WACN,CAAC,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAC,QAAQ,KAAG,OAAO,GAEzC,MAAM,CAIlB;IAED;;;;;;;;;;;OAWG;IACH,YAFa,IAAI,CAMhB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,qBA+DC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,0BAiCC;IAED;;;;;;;;;;;;OAYG;IACH,sBAoCC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,qBA4EC;IAED;;;;;;;;;;OAUG;IACH,kCAwFC;IA6gBL;;;OAGG;IACH,0BAFU,OAAO,CAEsB;;CANtC;uBA/1FsB,qBAAqB;4BAQrC,oCAAoC;0BAsCO,gBAAgB;4CA/CtB,oDAAoD;yBA0CrD,eAAe;4BA/Bf,wBAAwB;oBA3B/C,gCAAgC;8BAkCtB,6BAA6B;yBAHlC,2BAA2B;mCAIC,iCAAiC;8BAOxD,4BAA4B;gCAdd,4BAA4B;oBAdpD,+BAA+B;yBA2C1B,eAAe;+BAOT,qBAAqB"}
@@ -5,18 +5,20 @@ import {
5
5
  bvh_query_user_data_intersects_aabb
6
6
  } from "../../../core/bvh2/bvh3/query/bvh_query_user_data_intersects_aabb.js";
7
7
  import { returnTrue } from "../../../core/function/returnTrue.js";
8
+ import { aabb3_array_round_outward_f32 } from "../../../core/geom/3d/aabb/aabb3_array_round_outward_f32.js";
8
9
  import {
9
10
  aabb3_transform_oriented,
10
11
  aabb3_transform_oriented_array
11
12
  } from "../../../core/geom/3d/aabb/aabb3_transform_oriented.js";
12
- import { quat3_multiply_array } from "../../../core/geom/3d/quaternion/quat3_multiply.js";
13
+ import {
14
+ quat3_multiply_conjugate_right_array
15
+ } from "../../../core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.js";
13
16
  import Vector3 from "../../../core/geom/Vector3.js";
14
- import { f32_next_down } from "../../../core/math/f32_next_down.js";
15
- import { f32_next_up } from "../../../core/math/f32_next_up.js";
16
17
  import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
17
18
  import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
18
19
  import { System } from "../../ecs/System.js";
19
20
  import { t64_announce_change } from "../../ecs/transform/t64_announce_change.js";
21
+ import { t64_read_pose_array } from "../../ecs/transform/t64_read_pose_array.js";
20
22
  import { TRANSFORM64_EVENT_PLACED } from "../../ecs/transform/TRANSFORM64_EVENT_PLACED.js";
21
23
  import {
22
24
  Transform64,
@@ -134,13 +136,6 @@ const TARGET_POSE_STRIDE = 8;
134
136
  */
135
137
  const scratch_target_dq = new Float64Array(4);
136
138
 
137
- /**
138
- * Scratch for {@link PhysicsSystem#__derive_target_velocities}: the conjugate of the body's current
139
- * orientation, `[x, y, z, w]`, the second operand of that rotation.
140
- * @type {Float64Array}
141
- */
142
- const scratch_target_conjugate = new Float64Array(4);
143
-
144
139
  /**
145
140
  * What {@link PhysicsSystem#collidersOf} answers for a body that has none: one shared, frozen
146
141
  * empty list.
@@ -154,31 +149,6 @@ const NO_COLLIDERS = Object.freeze([]);
154
149
  */
155
150
  let interpolation_log_deprecation_warned = false;
156
151
 
157
- /**
158
- * Round a world box outward to float32, in place: each lower bound down and each upper bound up
159
- * to a float32 value, so the box keeps containing what it bounded once the broadphase stores it.
160
- *
161
- * The BVHs store float32, and a plain write rounds to the NEAREST float32 — inward on any side
162
- * that rounds that way, by up to half a float32 step: 3 cm at 1e6 m. A static leaf is its body's
163
- * tight box, so a query reaching the body through its leaf missed whatever of the body lay
164
- * outside it. A ray dropped onto a 2 mm plate 1e6 m out missed it; so did rays a millimetre inside
165
- * a 1 m crate's faces 1e5 m out. The refit skip in stage 2 also leans on it: a stationary body's
166
- * box is contained by its own stored leaf only if that leaf did not shrink.
167
- *
168
- * @param {Float64Array} aabb `[x0, y0, z0, x1, y1, z1]`
169
- */
170
- function aabb3_round_outward_f32(aabb) {
171
- for (let i = 0; i < 3; i++) {
172
- const lower = aabb[i];
173
- const lower_f32 = Math.fround(lower);
174
- aabb[i] = lower_f32 > lower ? f32_next_down(lower_f32) : lower_f32;
175
-
176
- const upper = aabb[i + 3];
177
- const upper_f32 = Math.fround(upper);
178
- aabb[i + 3] = upper_f32 < upper ? f32_next_up(upper_f32) : upper_f32;
179
- }
180
- }
181
-
182
152
  /**
183
153
  * Rigid-body physics system.
184
154
  *
@@ -815,7 +785,7 @@ export class PhysicsSystem extends System {
815
785
  transform.rotation_x, transform.rotation_y, transform.rotation_z, transform.rotation_w
816
786
  );
817
787
 
818
- aabb3_round_outward_f32(scratch_world_aabb);
788
+ aabb3_array_round_outward_f32(scratch_world_aabb, 0, scratch_world_aabb, 0);
819
789
 
820
790
  const bvh = rb.kind === BodyKind.Static ? this.staticBvh : this.dynamicBvh;
821
791
  const node = bvh.allocate_node();
@@ -1693,12 +1663,7 @@ export class PhysicsSystem extends System {
1693
1663
  // the one a world angular velocity integrates (dq/dt = ½ ω ⊗ q). Its axis × angle over
1694
1664
  // dt is the angular velocity; the shorter of the two arcs a quaternion pair describes.
1695
1665
  // Both operands go in as arrays, the target straight from its slot.
1696
- scratch_target_conjugate[0] = -tr[TRANSFORM64_ROTATION_OFFSET];
1697
- scratch_target_conjugate[1] = -tr[TRANSFORM64_ROTATION_OFFSET + 1];
1698
- scratch_target_conjugate[2] = -tr[TRANSFORM64_ROTATION_OFFSET + 2];
1699
- scratch_target_conjugate[3] = tr[TRANSFORM64_ROTATION_OFFSET + 3];
1700
-
1701
- quat3_multiply_array(scratch_target_dq, 0, poses, base + 4, scratch_target_conjugate, 0);
1666
+ quat3_multiply_conjugate_right_array(scratch_target_dq, 0, poses, base + 4, tr, TRANSFORM64_ROTATION_OFFSET);
1702
1667
 
1703
1668
  let dx = scratch_target_dq[0];
1704
1669
  let dy = scratch_target_dq[1];
@@ -2544,13 +2509,7 @@ export class PhysicsSystem extends System {
2544
2509
  // their accessors, which this step does not inline either and which return their
2545
2510
  // numbers boxed.
2546
2511
  const pose = scratch_refit_pose;
2547
- pose[0] = collider_transform[TRANSFORM64_TRANSLATION_OFFSET];
2548
- pose[1] = collider_transform[TRANSFORM64_TRANSLATION_OFFSET + 1];
2549
- pose[2] = collider_transform[TRANSFORM64_TRANSLATION_OFFSET + 2];
2550
- pose[3] = collider_transform[TRANSFORM64_ROTATION_OFFSET];
2551
- pose[4] = collider_transform[TRANSFORM64_ROTATION_OFFSET + 1];
2552
- pose[5] = collider_transform[TRANSFORM64_ROTATION_OFFSET + 2];
2553
- pose[6] = collider_transform[TRANSFORM64_ROTATION_OFFSET + 3];
2512
+ t64_read_pose_array(pose, 0, collider_transform);
2554
2513
 
2555
2514
  aabb3_transform_oriented_array(scratch_world_aabb, 0, scratch_local_aabb, 0, pose, 0);
2556
2515
 
@@ -2600,7 +2559,7 @@ export class PhysicsSystem extends System {
2600
2559
  // Outward, so the stored leaf still contains this fat box: the
2601
2560
  // next step's skip test is then exact for a body that has not
2602
2561
  // moved, as well as conservative for every query in between.
2603
- aabb3_round_outward_f32(scratch_world_aabb);
2562
+ aabb3_array_round_outward_f32(scratch_world_aabb, 0, scratch_world_aabb, 0);
2604
2563
  this.dynamicBvh.node_move_aabb(node, scratch_world_aabb);
2605
2564
  }
2606
2565
 
@@ -1 +1 @@
1
- {"version":3,"file":"FluidField.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/FluidField.js"],"names":[],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AAM,CAajB;IAED;;;;;;;;;;OAUG;IACH,oCAgBC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,eAJW,MAAM,WACN,MAAM,WACN,MAAM,QA0ChB;IAED;;;;OAIG;IACH,cASC;;CACJ"}
1
+ {"version":3,"file":"FluidField.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/FluidField.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IA2bI;;;;;;;;;OASG;IACH,wCAHW;QAAC,MAAM,EAAE,iBAAiB,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,uBAAuB,EAAE,OAAO,CAAA;KAAC,GACpG,UAAU,CAkBtB;IA7cD;;;;;;;OAOG;IACH,YAFU,YAAY,GAAC,IAAI,CAET;IAElB;;;;OAIG;IACH,YAFU,YAAY,GAAC,IAAI,CAET;IAElB;;;;;OAKG;IACH,YAFU,YAAY,GAAC,IAAI,CAET;IAElB;;;;;;OAMG;IACH,OAFU,UAAU,GAAC,IAAI,CAEZ;IAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,sBAFU,UAAU,GAAC,IAAI,CAEG;IAE5B;;;;;;;OAOG;IACH,cAFU,UAAU,GAAC,IAAI,CAEL;IAEpB;;;OAGG;IACH,cAFU,UAAU,GAAC,IAAI,CAEL;IAEpB;;;OAGG;IACH,cAFU,UAAU,GAAC,IAAI,CAEL;IAEpB;;;;;;;;;;;;;;;;OAgBG;IACH,eAFU,UAAU,GAAC,IAAI,CAEJ;IAErB;;;;;;;;;;;;;OAaG;IACH,UAFU,YAAY,kBAAc,IAAI,CAExB;IAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,yBAFU,OAAO,CAEe;IAEhC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAFU,OAAO,CAEK;IAetB;;;;;;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AM,EAAE,KACrB,MAAM,KACN,MAAM,KACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAUhC;IAED;;;;;;;OAOG;IACH,mBANW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACL,MAAM,CAUjB;IAED;;;;;;;;;;OAUG;IACH,cAHW,UAAU,GACT,OAAO,CAqDlB;IAED;;;;;;;;;;;OAWG;IACH,QAFY,MAAM,CAejB;IAED;;;;;;;;;;OAUG;IACH,oCAgBC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,eAJW,MAAM,WACN,MAAM,WACN,MAAM,QA0ChB;IAED;;;;OAIG;IACH,cASC;;CACJ"}
@@ -1,5 +1,5 @@
1
1
  import { assert } from "../../../core/assert.js";
2
- import { combine_hash } from "../../../core/collection/array/combine_hash.js";
2
+ import { hash_mix3 } from "../../../core/math/hash/hash_mix3.js";
3
3
  import { is_typed_array_equals } from "../../../core/collection/array/typed/is_typed_array_equals.js";
4
4
  import { sparse_typed_array_hash } from "../../../core/collection/array/typed/sparse_typed_array_hash.js";
5
5
  import { scs3d_sample_linear } from "../../graphics/texture/3d/scs3d_sample_linear.js";
@@ -739,10 +739,12 @@ export class FluidField {
739
739
  const velocity_sample = this.#built
740
740
  ? sparse_typed_array_hash(this.velocity_x, 0, this.velocity_x.length)
741
741
  : 0;
742
- return combine_hash(
743
- this.#resolution[0],
744
- this.#resolution[1],
745
- this.#resolution[2],
742
+ return hash_mix3(
743
+ hash_mix3(
744
+ this.#resolution[0],
745
+ this.#resolution[1],
746
+ this.#resolution[2]
747
+ ),
746
748
  this.#scalar_attributes.length,
747
749
  velocity_sample
748
750
  );
@@ -1 +1 @@
1
- {"version":3,"file":"FluidComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/fluid/ecs/FluidComponent.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAEI;;OAEG;IACH,OAFU,UAAU,CAEK;IAEzB;;;;;;;OAOG;IACH,QAFU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEf;IAEnB;;;;;;;;OAQG;IACH,QAFU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEf;IAEnB;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAFU,MAAM,CAEC;IAEjB;;;;OAIG;IACH,SAFU,OAAO,CAEF;IAEf;;;;;OAKG;IACH,UAFU,OAAO,CAEA;IAEjB;;;;;;;OAOG;IACH,iBANW,YAAY,GAAC,MAAM,EAAE,MACrB,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAQhC;IAED;;;;;;;OAOG;IACH,iBANW,YAAY,GAAC,MAAM,EAAE,MACrB,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAOhC;IAED;;;;;;;;;;;;;;OAcG;IACH,2BANW,YAAY,GAAC,MAAM,EAAE,MACrB,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAQhC;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAQjB;IAED;;;OAGG;IACH,cAHW,cAAc,GACb,OAAO,CAoBlB;IAED;;OAEG;IACH,QAFY,MAAM,CAgBjB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iCAmBC;IAGL,0BAAyC;CAFxC;2BA/P0B,kBAAkB"}
1
+ {"version":3,"file":"FluidComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/fluid/ecs/FluidComponent.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAEI;;OAEG;IACH,OAFU,UAAU,CAEK;IAEzB;;;;;;;OAOG;IACH,QAFU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEf;IAEnB;;;;;;;;OAQG;IACH,QAFU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEf;IAEnB;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAFU,MAAM,CAEC;IAEjB;;;;OAIG;IACH,SAFU,OAAO,CAEF;IAEf;;;;;OAKG;IACH,UAFU,OAAO,CAEA;IAEjB;;;;;;;OAOG;IACH,iBANW,YAAY,GAAC,MAAM,EAAE,MACrB,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAQhC;IAED;;;;;;;OAOG;IACH,iBANW,YAAY,GAAC,MAAM,EAAE,MACrB,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAOhC;IAED;;;;;;;;;;;;;;OAcG;IACH,2BANW,YAAY,GAAC,MAAM,EAAE,MACrB,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,GAAC,MAAM,EAAE,CAQhC;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CAQjB;IAED;;;OAGG;IACH,cAHW,cAAc,GACb,OAAO,CAoBlB;IAED;;OAEG;IACH,QAFY,MAAM,CAwBjB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iCAmBC;IAGL,0BAAyC;CAFxC;2BAvQ0B,kBAAkB"}
@@ -1,4 +1,4 @@
1
- import { combine_hash } from "../../../../core/collection/array/combine_hash.js";
1
+ import { hash_mix3 } from "../../../../core/math/hash/hash_mix3.js";
2
2
  import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
3
3
  import { FluidField } from "../FluidField.js";
4
4
 
@@ -197,16 +197,24 @@ export class FluidComponent {
197
197
  * @return {number}
198
198
  */
199
199
  hash() {
200
- return combine_hash(
201
- this.enabled ? 1 : 0,
202
- this.anchored ? 1 : 0,
203
- computeHashFloat(this.cell_size),
204
- computeHashFloat(this.hysteresis),
205
- computeHashFloat(this.origin[0]),
206
- computeHashFloat(this.origin[1]),
207
- computeHashFloat(this.origin[2]),
208
- computeHashFloat(this.offset[0]),
209
- computeHashFloat(this.offset[1]),
200
+ return hash_mix3(
201
+ hash_mix3(
202
+ hash_mix3(
203
+ hash_mix3(
204
+ hash_mix3(
205
+ this.enabled ? 1 : 0,
206
+ this.anchored ? 1 : 0,
207
+ computeHashFloat(this.cell_size)
208
+ ),
209
+ computeHashFloat(this.hysteresis),
210
+ computeHashFloat(this.origin[0])
211
+ ),
212
+ computeHashFloat(this.origin[1]),
213
+ computeHashFloat(this.origin[2])
214
+ ),
215
+ computeHashFloat(this.offset[0]),
216
+ computeHashFloat(this.offset[1])
217
+ ),
210
218
  computeHashFloat(this.offset[2]),
211
219
  this.field.hash()
212
220
  );
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The world-space box a {@link FluidComponent}'s cells occupy, written as `[min_x, min_y, min_z, max_x,
3
+ * max_y, max_z]` into `out` at `out_offset`.
4
+ *
5
+ * Inside it, each velocity component is read from the simulation along its own axis; across the other
6
+ * two, and for the scalars, the outer half-cell shell already reads the clamped edge cell, since those
7
+ * live at the cell centres. The box is the cells, not the region free of clamping.
8
+ *
9
+ * `origin` is cell `(0,0,0)`'s CENTRE, so the cells run from `origin - cell_size/2` to
10
+ * `origin + (res - 1/2)·cell_size` on each axis. A point outside this box still gets an answer from
11
+ * {@link fluid_sample_velocity_world_mps} - the nearest edge's - and a consumer deciding whether a point
12
+ * is in the field or out in the world beyond it asks this box.
13
+ *
14
+ * Not {@link FluidComponent#getBoundingBox}: that box is the splat broad phase, deliberately one more
15
+ * cell wider on every side so a sub-cell effector near a face is not dropped. It answers "can a source
16
+ * here write into the field", this answers "does the field describe this point".
17
+ *
18
+ * @param {Float32Array|Float64Array|number[]} out
19
+ * @param {number} out_offset
20
+ * @param {FluidComponent} component
21
+ * @returns {void}
22
+ */
23
+ export function fluid_sample_domain_bounds(out: Float32Array | Float64Array | number[], out_offset: number, component: FluidComponent): void;
24
+ //# sourceMappingURL=fluid_sample_domain_bounds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluid_sample_domain_bounds.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,gDALW,YAAY,GAAC,YAAY,GAAC,MAAM,EAAE,cAClC,MAAM,8BAEJ,IAAI,CAqBhB"}