@woosh/meep-engine 3.43.0 → 3.45.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 (466) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/editor/prototypeEditorShell.d.ts.map +1 -1
  3. package/editor/prototypeEditorShell.js +4 -2
  4. package/package.json +1 -1
  5. package/src/core/collection/array/array_sort_insertion_ascending.d.ts +19 -0
  6. package/src/core/collection/array/array_sort_insertion_ascending.d.ts.map +1 -0
  7. package/src/core/collection/array/array_sort_insertion_ascending.js +31 -0
  8. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts +27 -0
  9. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts.map +1 -0
  10. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.js +39 -0
  11. package/src/core/geom/3d/aabb/aabb3_from_v3_array.d.ts.map +1 -1
  12. package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +4 -1
  13. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +2 -2
  14. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -1
  15. package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +1 -1
  16. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts +21 -0
  17. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts.map +1 -0
  18. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.js +36 -0
  19. package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts +25 -0
  20. package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts.map +1 -0
  21. package/src/core/geom/3d/pose/pose3_apply_point_array.js +40 -0
  22. package/src/core/geom/3d/pose/pose3_compose_array.d.ts +28 -0
  23. package/src/core/geom/3d/pose/pose3_compose_array.d.ts.map +1 -0
  24. package/src/core/geom/3d/pose/pose3_compose_array.js +41 -0
  25. package/src/core/geom/3d/pose/pose3_to_local_array.d.ts +29 -0
  26. package/src/core/geom/3d/pose/pose3_to_local_array.d.ts.map +1 -0
  27. package/src/core/geom/3d/pose/pose3_to_local_array.js +42 -0
  28. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts +28 -0
  29. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts.map +1 -0
  30. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.js +66 -0
  31. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts +22 -0
  32. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts.map +1 -0
  33. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.js +30 -0
  34. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts +23 -0
  35. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts.map +1 -0
  36. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.js +31 -0
  37. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts +26 -0
  38. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts.map +1 -0
  39. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js +46 -0
  40. package/src/core/geom/vec3/v3_distance_array.d.ts +11 -0
  41. package/src/core/geom/vec3/v3_distance_array.d.ts.map +1 -0
  42. package/src/core/geom/vec3/v3_distance_array.js +19 -0
  43. package/src/core/geom/vec3/v3_normalize_array_checked.d.ts +23 -0
  44. package/src/core/geom/vec3/v3_normalize_array_checked.d.ts.map +1 -0
  45. package/src/core/geom/vec3/v3_normalize_array_checked.js +49 -0
  46. package/src/core/geom/vec3/v3_reject_array.d.ts +15 -0
  47. package/src/core/geom/vec3/v3_reject_array.d.ts.map +1 -0
  48. package/src/core/geom/vec3/v3_reject_array.js +32 -0
  49. package/src/core/graph/csr/csr_build_incidence.d.ts +26 -0
  50. package/src/core/graph/csr/csr_build_incidence.d.ts.map +1 -0
  51. package/src/core/graph/csr/csr_build_incidence.js +71 -0
  52. package/src/core/graph/csr/csr_graph_color_greedy.d.ts +25 -0
  53. package/src/core/graph/csr/csr_graph_color_greedy.d.ts.map +1 -0
  54. package/src/core/graph/csr/csr_graph_color_greedy.js +83 -0
  55. package/src/core/graph/csr/csr_graph_validate_coloring.d.ts +15 -0
  56. package/src/core/graph/csr/csr_graph_validate_coloring.d.ts.map +1 -0
  57. package/src/core/graph/csr/csr_graph_validate_coloring.js +33 -0
  58. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts +26 -0
  59. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts.map +1 -0
  60. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.js +71 -0
  61. package/src/core/math/max2_exact.d.ts +15 -0
  62. package/src/core/math/max2_exact.d.ts.map +1 -0
  63. package/src/core/math/max2_exact.js +30 -0
  64. package/src/core/math/min2_exact.d.ts +20 -0
  65. package/src/core/math/min2_exact.d.ts.map +1 -0
  66. package/src/core/math/min2_exact.js +35 -0
  67. package/src/engine/Clock.d.ts +15 -0
  68. package/src/engine/Clock.d.ts.map +1 -1
  69. package/src/engine/Clock.js +29 -5
  70. package/src/engine/Engine.d.ts.map +1 -1
  71. package/src/engine/Engine.js +11 -19
  72. package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -1
  73. package/src/engine/ecs/ik/IKGoalSystem.js +3 -19
  74. package/src/engine/ecs/parent/parent_entity_model_of.d.ts +17 -0
  75. package/src/engine/ecs/parent/parent_entity_model_of.d.ts.map +1 -0
  76. package/src/engine/ecs/parent/parent_entity_model_of.js +26 -0
  77. package/src/engine/ecs/transform/t64_read_pose_array.d.ts +15 -0
  78. package/src/engine/ecs/transform/t64_read_pose_array.d.ts.map +1 -0
  79. package/src/engine/ecs/transform/t64_read_pose_array.js +24 -0
  80. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
  81. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
  82. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
  83. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts +2 -0
  84. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map +1 -1
  85. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js +10 -21
  86. package/src/engine/graphics3/AnimationGraphSystem.d.ts +28 -13
  87. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  88. package/src/engine/graphics3/AnimationGraphSystem.js +107 -64
  89. package/src/engine/graphics3/AnimationSystem.d.ts +29 -15
  90. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  91. package/src/engine/graphics3/AnimationSystem.js +112 -61
  92. package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
  93. package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
  94. package/src/engine/graphics3/MeshSkinSystem.js +317 -0
  95. package/src/engine/graphics3/MeshSystem.d.ts +15 -35
  96. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  97. package/src/engine/graphics3/MeshSystem.js +21 -298
  98. package/src/engine/graphics3/RowChains.d.ts +76 -0
  99. package/src/engine/graphics3/RowChains.d.ts.map +1 -0
  100. package/src/engine/graphics3/RowChains.js +347 -0
  101. package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
  102. package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
  103. package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
  104. package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
  105. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
  106. package/src/engine/graphics3/animation/AnimationClips.js +79 -0
  107. package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
  108. package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
  109. package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
  110. package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
  111. package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
  112. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
  113. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  114. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
  115. package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
  116. package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
  117. package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
  118. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
  119. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
  120. package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
  121. package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
  122. package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
  123. package/src/engine/graphics3/prefab/prefab_place.js +175 -130
  124. package/src/engine/graphics3/register_clips.d.ts +93 -0
  125. package/src/engine/graphics3/register_clips.d.ts.map +1 -0
  126. package/src/engine/graphics3/register_clips.js +166 -0
  127. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +9 -0
  128. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
  129. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +3 -1
  130. package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
  131. package/src/engine/physics/cloth/PLAN.md +349 -17
  132. package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
  133. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
  134. package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
  135. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +44 -0
  136. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
  137. package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +107 -0
  138. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
  139. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
  140. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +371 -284
  141. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
  142. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
  143. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +275 -0
  144. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +7 -0
  145. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -1
  146. package/src/engine/physics/cloth/collider/ClothColliderIndex.js +85 -67
  147. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +19 -101
  149. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +2 -5
  150. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/collider/cloth_collider_pack.js +7 -15
  152. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
  153. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -1
  154. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +17 -62
  155. package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
  156. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  157. package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
  158. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +0 -1
  159. package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +6 -19
  160. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +1 -2
  161. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
  162. package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +3 -12
  163. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
  164. package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
  165. package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
  166. package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
  167. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
  168. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  169. package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
  170. package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
  171. package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
  172. package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
  173. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
  174. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
  175. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
  176. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
  177. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
  178. package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
  179. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
  180. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  181. package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
  182. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
  183. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  184. package/src/engine/physics/cloth/ecs/ClothWorld.js +754 -207
  185. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
  186. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
  187. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
  188. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
  189. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  190. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +297 -101
  191. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
  192. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  193. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +12 -10
  194. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
  195. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
  196. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +60 -120
  197. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
  198. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
  199. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +135 -0
  200. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
  201. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
  202. package/src/engine/physics/cloth/ecs/cloth_holds.js +583 -0
  203. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
  204. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
  205. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +168 -51
  206. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
  207. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
  208. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
  209. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
  210. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  211. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +51 -42
  212. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
  213. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  214. package/src/engine/physics/cloth/ecs/cloth_write_back.js +62 -50
  215. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
  216. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
  217. package/src/engine/physics/cloth/playground/cloth_playground_build.d.ts.map +1 -1
  218. package/src/engine/physics/cloth/playground/cloth_playground_build.js +2 -3
  219. package/src/engine/physics/cloth/playground/collide_main.js +3 -29
  220. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
  221. package/src/engine/physics/cloth/playground/garment_build.js +17 -5
  222. package/src/engine/physics/cloth/playground/garment_main.js +5 -20
  223. package/src/engine/physics/cloth/playground/main.js +6 -48
  224. package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
  225. package/src/engine/physics/cloth/playground/rig_build.js +302 -296
  226. package/src/engine/physics/cloth/playground/rig_main.js +947 -955
  227. package/src/engine/physics/cloth/playground/wind_main.js +8 -7
  228. package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
  229. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  230. package/src/engine/physics/cloth/solver/ClothState.js +79 -83
  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 +6 -1
  235. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  236. package/src/engine/physics/cloth/solver/cloth_contact_find.js +9 -3
  237. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
  238. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
  239. package/src/engine/physics/cloth/solver/cloth_hold_line.js +350 -0
  240. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts +21 -0
  241. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts.map +1 -0
  242. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.js +45 -0
  243. package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts +32 -0
  244. package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts.map +1 -0
  245. package/src/engine/physics/cloth/solver/cloth_particle_coupling.js +133 -0
  246. package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts +16 -0
  247. package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts.map +1 -0
  248. package/src/engine/physics/cloth/solver/cloth_particle_of_source.js +19 -0
  249. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
  250. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  251. package/src/engine/physics/cloth/solver/cloth_self_find.js +19 -68
  252. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
  253. package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +30 -65
  254. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
  255. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  256. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
  257. package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
  258. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  259. package/src/engine/physics/cloth/solver/cloth_step.js +189 -48
  260. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
  261. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  262. package/src/engine/physics/cloth/solver/cloth_step_instance.js +12 -6
  263. package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts +21 -0
  264. package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts.map +1 -0
  265. package/src/engine/physics/cloth/solver/cloth_stretch_residual.js +54 -0
  266. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts +15 -0
  267. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts.map +1 -1
  268. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.js +28 -0
  269. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts +30 -0
  270. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts.map +1 -0
  271. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.js +56 -0
  272. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  273. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +3 -17
  274. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
  275. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
  276. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
  277. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
  278. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
  279. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
  280. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +2 -1
  281. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
  282. package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -25
  283. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +12 -10
  284. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
  285. package/src/engine/physics/cloth/wind/cloth_sample_air.js +60 -82
  286. package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -1
  287. package/src/engine/physics/ecs/ContactProbeSystem.js +2 -18
  288. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  289. package/src/engine/physics/ecs/PhysicsSystem.js +9 -50
  290. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  291. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts +24 -0
  292. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts.map +1 -0
  293. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.js +42 -0
  294. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts +25 -0
  295. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts.map +1 -0
  296. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.js +40 -0
  297. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -1
  298. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +40 -90
  299. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
  300. package/src/engine/physics/narrowphase/capsule_contacts.js +3 -5
  301. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
  302. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +2 -14
  303. package/src/engine/physics/narrowphase/hull_sphere_contact.d.ts.map +1 -1
  304. package/src/engine/physics/narrowphase/hull_sphere_contact.js +2 -5
  305. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  306. package/src/engine/physics/narrowphase/narrowphase_step.js +13 -32
  307. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
  308. package/src/engine/physics/narrowphase/sphere_box_contact.js +2 -5
  309. package/src/engine/simulation/Ticker.d.ts +13 -0
  310. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  311. package/src/engine/simulation/Ticker.js +43 -8
  312. package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -1
  313. package/src/format/texture/basis/transcode/etc1s_to_astc.js +2 -1
  314. package/src/shade/RENDERER_CONTRACT.md +8 -2
  315. package/src/shade/playground/image_decode_bench/main.js +2 -1
  316. package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
  317. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  318. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +2 -1
  319. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  320. package/src/shade/playground/skinned_blas_refit/main.js +11 -19
  321. package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
  322. package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
  323. package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
  324. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  325. package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
  326. package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.d.ts.map +1 -1
  327. package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +2 -1
  328. package/src/shade/playground/ssr_variance/statistics.d.ts.map +1 -1
  329. package/src/shade/playground/ssr_variance/statistics.js +2 -1
  330. package/src/shade/playground/texture_encode/README.md +129 -109
  331. package/src/shade/playground/texture_encode/main.d.ts.map +1 -1
  332. package/src/shade/playground/texture_encode/main.js +1431 -1430
  333. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  334. package/src/shade/playground/volumetrics_froxel/measure.js +2 -1
  335. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
  336. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  337. package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
  338. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
  339. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  340. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
  341. package/src/shade/renderer/buffer/table/gpu_database_check_links.d.ts.map +1 -1
  342. package/src/shade/renderer/buffer/table/gpu_database_check_links.js +2 -1
  343. package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
  344. package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
  345. package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
  346. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
  347. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
  348. package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
  349. package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
  350. package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
  351. package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
  352. package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
  353. package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
  354. package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
  355. package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
  356. package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
  357. package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
  358. package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
  359. package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
  360. package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
  361. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
  362. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
  363. package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
  364. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
  365. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
  366. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
  367. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
  368. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
  369. package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
  370. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
  371. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
  372. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
  373. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
  374. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
  375. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
  376. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  377. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +3 -2
  378. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.d.ts.map +1 -1
  379. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.js +2 -1
  380. package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.d.ts.map +1 -1
  381. package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.js +2 -1
  382. package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.d.ts.map +1 -1
  383. package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.js +2 -1
  384. package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.d.ts.map +1 -1
  385. package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js +3 -2
  386. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.d.ts.map +1 -1
  387. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js +2 -1
  388. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.d.ts.map +1 -1
  389. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js +2 -1
  390. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
  391. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +3 -2
  392. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  393. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
  394. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
  395. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  396. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
  397. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
  398. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
  399. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
  400. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
  401. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
  402. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
  403. package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
  404. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
  405. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  406. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
  407. package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
  408. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
  409. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  410. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
  411. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  412. package/src/shade/renderer/particles/graph_particles.js +6 -2
  413. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.d.ts.map +1 -1
  414. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.js +3 -2
  415. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  416. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
  417. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  418. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
  419. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  420. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
  421. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
  422. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  423. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
  424. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
  425. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  426. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
  427. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  428. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
  429. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
  430. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
  431. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
  432. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
  433. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  434. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
  435. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
  436. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
  437. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
  438. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
  439. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
  440. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
  441. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
  442. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
  443. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
  444. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
  445. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  446. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
  447. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  448. package/src/shade/renderer/water/chunk_water_transport.js +7 -5
  449. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  450. package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
  451. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
  452. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
  453. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
  454. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  455. package/src/shade/renderer/water/shader_water.js +3 -1
  456. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
  457. package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
  458. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  459. package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
  460. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  461. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +37 -20
  462. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  463. package/src/shade/wgsl/validate_wgsl_source.js +74 -3
  464. package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
  465. package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
  466. package/src/engine/graphics3/register_instance_animation.js +0 -201
@@ -56,11 +56,13 @@ export function cloth_self_accumulate(accumulator: Float64Array, state: ClothSta
56
56
  *
57
57
  * A self-collision row carries nothing of the kind. What it holds apart is cloth
58
58
  * against cloth — grams, moving at the speed cloth moves relative to itself — and
59
- * a penalty at the top of the band produces newtons per millimetre against a
60
- * load of fractions of a newton. So it is a plain penalty with no multiplier, no
61
- * warm start and no identity across steps, which is also what makes a pair list
62
- * that is rebuilt from scratch every step affordable: there is nothing on a pair
63
- * worth carrying. `MEASUREMENTS.md` §33.
59
+ * at a quarter of the way up the band the penalty still produces 0.29 N per
60
+ * millimetre against a particle's weight of 0.2 N: a fold resting on a fold
61
+ * sinks into it by under a millimetre per particle it carries. So it is a plain
62
+ * penalty with no multiplier, no warm start and no identity across steps, which
63
+ * is also what makes a pair list that is rebuilt from scratch every step
64
+ * affordable: there is nothing on a pair worth carrying. `MEASUREMENTS.md` §33,
65
+ * and §65 for the stiffness.
64
66
  *
65
67
  * @author Alex Goldring
66
68
  * @copyright Company Named Limited (c) 2026
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_self_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_self_row.js"],"names":[],"mappings":"AAoEA;;;;;;;;;;GAUG;AACH,4EAJW,MAAM,GAEJ,MAAM,CA4FlB;AAED;;;;;;GAMG;AACH,mDAJW,YAAY,+BAEZ,MAAM,QAyBhB;AA7LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH;;;;;GAKG;AACH,iCAFU,MAAM,CAEuB"}
1
+ {"version":3,"file":"cloth_self_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_self_row.js"],"names":[],"mappings":"AAsEA;;;;;;;;;;GAUG;AACH,4EAJW,MAAM,GAEJ,MAAM,CA4FlB;AAED;;;;;;GAMG;AACH,mDAJW,YAAY,+BAEZ,MAAM,QAyBhB;AA/LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH;;;;;GAKG;AACH,iCAFU,MAAM,CAEuB"}
@@ -48,11 +48,13 @@ import {
48
48
  *
49
49
  * A self-collision row carries nothing of the kind. What it holds apart is cloth
50
50
  * against cloth — grams, moving at the speed cloth moves relative to itself — and
51
- * a penalty at the top of the band produces newtons per millimetre against a
52
- * load of fractions of a newton. So it is a plain penalty with no multiplier, no
53
- * warm start and no identity across steps, which is also what makes a pair list
54
- * that is rebuilt from scratch every step affordable: there is nothing on a pair
55
- * worth carrying. `MEASUREMENTS.md` §33.
51
+ * at a quarter of the way up the band the penalty still produces 0.29 N per
52
+ * millimetre against a particle's weight of 0.2 N: a fold resting on a fold
53
+ * sinks into it by under a millimetre per particle it carries. So it is a plain
54
+ * penalty with no multiplier, no warm start and no identity across steps, which
55
+ * is also what makes a pair list that is rebuilt from scratch every step
56
+ * affordable: there is nothing on a pair worth carrying. `MEASUREMENTS.md` §33,
57
+ * and §65 for the stiffness.
56
58
  *
57
59
  * @author Alex Goldring
58
60
  * @copyright Company Named Limited (c) 2026
@@ -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
  }
@@ -43,15 +43,15 @@
43
43
  *
44
44
  * @param {ClothState} state
45
45
  * @param {AbstractClothWind} wind
46
- * @param {Float64Array} anchor_translation the cloth frame's world origin
47
- * @param {Float64Array} anchor_rotation the cloth frame's world rotation, xyzw
46
+ * @param {Float64Array} frame_translation the cloth frame's world origin
47
+ * @param {Float64Array} frame_rotation the cloth frame's world rotation, xyzw
48
48
  * @param {Float64Array} [centre] written with the world-space air at the cloth's
49
49
  * own centre — what the sleep test compares against next step
50
50
  * @param {number} [time] seconds this cloth has stepped, the clock its gust is a
51
51
  * function of — see {@link AbstractClothWind}
52
52
  * @returns {boolean} whether the source was sampled per particle
53
53
  */
54
- export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, anchor_translation: Float64Array, anchor_rotation: Float64Array, centre?: Float64Array, time?: number): boolean;
54
+ export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, frame_translation: Float64Array, frame_rotation: Float64Array, centre?: Float64Array, time?: number): boolean;
55
55
  /**
56
56
  * Whether the air at the cloth's centre has moved far enough since the last step
57
57
  * that actually applied it to be worth waking for — §10's "sleep wakes on a wind
@@ -78,8 +78,8 @@ export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, anc
78
78
  *
79
79
  * @param {ClothState} state
80
80
  * @param {AbstractClothWind} wind
81
- * @param {Float64Array} anchor_translation
82
- * @param {Float64Array} anchor_rotation
81
+ * @param {Float64Array} frame_translation
82
+ * @param {Float64Array} frame_rotation
83
83
  * @param {Float64Array} previous the air last applied to this cloth, world-space
84
84
  * @param {number} threshold m/s
85
85
  * @param {number} time seconds the cloth has stepped — the clock its gust is a
@@ -87,20 +87,22 @@ export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, anc
87
87
  * have, because it has to be asking about the air that step would feel
88
88
  * @returns {boolean}
89
89
  */
90
- export function cloth_air_changed(state: ClothState, wind: AbstractClothWind, anchor_translation: Float64Array, anchor_rotation: Float64Array, previous: Float64Array, threshold: number, time: number): boolean;
90
+ export function cloth_air_changed(state: ClothState, wind: AbstractClothWind, frame_translation: Float64Array, frame_rotation: Float64Array, previous: Float64Array, threshold: number, time: number): boolean;
91
91
  /**
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
- * @param {Float64Array} anchor_translation
101
- * @param {Float64Array} anchor_rotation
102
+ * @param {Float64Array} frame_translation
103
+ * @param {Float64Array} frame_rotation
102
104
  * @param {Float64Array} out six words, min then max
103
105
  * @returns {void}
104
106
  */
105
- export function cloth_air_bounds(state: ClothState, anchor_translation: Float64Array, anchor_rotation: Float64Array, out: Float64Array): void;
107
+ export function cloth_air_bounds(state: ClothState, frame_translation: Float64Array, frame_rotation: Float64Array, out: Float64Array): void;
106
108
  //# sourceMappingURL=cloth_sample_air.d.ts.map
@@ -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,iGARW,YAAY,mBACZ,YAAY,WACZ,YAAY,SAEZ,MAAM,GAEJ,OAAO,CA8EnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,kGATW,YAAY,mBACZ,YAAY,YACZ,YAAY,aACZ,MAAM,QACN,MAAM,GAGJ,OAAO,CAsBnB;AAED;;;;;;;;;;;;;GAaG;AACH,wEALW,YAAY,mBACZ,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
 
@@ -47,15 +49,15 @@ import { v3_quaternion_apply_inverse } from "../../../../core/geom/vec3/v3_quate
47
49
  *
48
50
  * @param {ClothState} state
49
51
  * @param {AbstractClothWind} wind
50
- * @param {Float64Array} anchor_translation the cloth frame's world origin
51
- * @param {Float64Array} anchor_rotation the cloth frame's world rotation, xyzw
52
+ * @param {Float64Array} frame_translation the cloth frame's world origin
53
+ * @param {Float64Array} frame_rotation the cloth frame's world rotation, xyzw
52
54
  * @param {Float64Array} [centre] written with the world-space air at the cloth's
53
55
  * own centre — what the sleep test compares against next step
54
56
  * @param {number} [time] seconds this cloth has stepped, the clock its gust is a
55
57
  * function of — see {@link AbstractClothWind}
56
58
  * @returns {boolean} whether the source was sampled per particle
57
59
  */
58
- export function cloth_sample_air(state, wind, anchor_translation, anchor_rotation, centre = undefined, time = 0) {
60
+ export function cloth_sample_air(state, wind, frame_translation, frame_rotation, centre = undefined, time = 0) {
59
61
  const particle_count = state.particle_count;
60
62
 
61
63
  const air = state.air_velocity;
@@ -66,16 +68,16 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
66
68
 
67
69
  const position = state.position;
68
70
 
69
- const anchor_x = anchor_translation[0];
70
- const anchor_y = anchor_translation[1];
71
- const anchor_z = anchor_translation[2];
71
+ const frame_x = frame_translation[0];
72
+ const frame_y = frame_translation[1];
73
+ const frame_z = frame_translation[2];
72
74
 
73
- const qx = anchor_rotation[0];
74
- const qy = anchor_rotation[1];
75
- const qz = anchor_rotation[2];
76
- const qw = anchor_rotation[3];
75
+ const qx = frame_rotation[0];
76
+ const qy = frame_rotation[1];
77
+ const qz = frame_rotation[2];
78
+ const qw = frame_rotation[3];
77
79
 
78
- cloth_air_bounds(state, anchor_translation, anchor_rotation, BOUNDS);
80
+ cloth_air_bounds(state, frame_translation, frame_rotation, BOUNDS);
79
81
 
80
82
  const varies = wind.varies(BOUNDS[0], BOUNDS[1], BOUNDS[2], BOUNDS[3], BOUNDS[4], BOUNDS[5]);
81
83
 
@@ -121,7 +123,7 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
121
123
 
122
124
  v3_quaternion_apply(WORLD, 0, position[p], position[p + 1], position[p + 2], qx, qy, qz, qw);
123
125
 
124
- wind.sample(SAMPLE, WORLD[0] + anchor_x, WORLD[1] + anchor_y, WORLD[2] + anchor_z, time);
126
+ wind.sample(SAMPLE, WORLD[0] + frame_x, WORLD[1] + frame_y, WORLD[2] + frame_z, time);
125
127
 
126
128
  v3_quaternion_apply_inverse(LOCAL, 0, SAMPLE[0], SAMPLE[1], SAMPLE[2], qx, qy, qz, qw);
127
129
 
@@ -159,8 +161,8 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
159
161
  *
160
162
  * @param {ClothState} state
161
163
  * @param {AbstractClothWind} wind
162
- * @param {Float64Array} anchor_translation
163
- * @param {Float64Array} anchor_rotation
164
+ * @param {Float64Array} frame_translation
165
+ * @param {Float64Array} frame_rotation
164
166
  * @param {Float64Array} previous the air last applied to this cloth, world-space
165
167
  * @param {number} threshold m/s
166
168
  * @param {number} time seconds the cloth has stepped — the clock its gust is a
@@ -168,12 +170,12 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
168
170
  * have, because it has to be asking about the air that step would feel
169
171
  * @returns {boolean}
170
172
  */
171
- export function cloth_air_changed(state, wind, anchor_translation, anchor_rotation, previous, threshold, time) {
173
+ export function cloth_air_changed(state, wind, frame_translation, frame_rotation, previous, threshold, time) {
172
174
  if (state.particle_count === 0) {
173
175
  return false;
174
176
  }
175
177
 
176
- cloth_air_bounds(state, anchor_translation, anchor_rotation, BOUNDS);
178
+ cloth_air_bounds(state, frame_translation, frame_rotation, BOUNDS);
177
179
 
178
180
  wind.sample(
179
181
  SAMPLE,
@@ -194,82 +196,44 @@ export function cloth_air_changed(state, wind, anchor_translation, anchor_rotati
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
- * @param {Float64Array} anchor_translation
203
- * @param {Float64Array} anchor_rotation
206
+ * @param {Float64Array} frame_translation
207
+ * @param {Float64Array} frame_rotation
204
208
  * @param {Float64Array} out six words, min then max
205
209
  * @returns {void}
206
210
  */
207
- export function cloth_air_bounds(state, anchor_translation, anchor_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; }
211
+ export function cloth_air_bounds(state, frame_translation, frame_rotation, out) {
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 = anchor_rotation[0];
235
- const qy = anchor_rotation[1];
236
- const qz = anchor_rotation[2];
237
- const qw = anchor_rotation[3];
238
-
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] + anchor_translation[0];
256
- const y = WORLD[1] + anchor_translation[1];
257
- const z = WORLD[2] + anchor_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
- }
224
+ aabb3_from_v3_array(LOCAL_BOX, state.position, state.particle_count * 3);
266
225
 
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;
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];
235
+
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, anchor_translation, anchor_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;;;;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d,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
 
@@ -66,11 +66,11 @@ export class FluidObstacleSystem extends System<any> {
66
66
  /**
67
67
  * @param {FluidComponent} fluid
68
68
  */
69
- static "__#430@#refresh_masks"(fluid: FluidComponent): void;
69
+ static "__#432@#refresh_masks"(fluid: FluidComponent): void;
70
70
  /**
71
71
  * @param {FluidComponent} fluid
72
72
  */
73
- static "__#430@#clear_field"(fluid: FluidComponent): void;
73
+ static "__#432@#clear_field"(fluid: FluidComponent): void;
74
74
  /**
75
75
  * Mark every cell of `fluid` whose centre lies within `inflation` of the
76
76
  * posed shape as solid. Iteration is clipped to the shape's world AABB
@@ -82,7 +82,7 @@ export class FluidObstacleSystem extends System<any> {
82
82
  * @param {number} inflation world-units SDF threshold
83
83
  * @param {Float64Array} point length-3 scratch
84
84
  */
85
- static "__#430@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
85
+ static "__#432@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
86
86
  /**
87
87
  * Write the obstacle's translation velocity onto every face of every cell
88
88
  * it voxelized — the moving-wall boundary condition. Runs AFTER the mask
@@ -102,7 +102,7 @@ export class FluidObstacleSystem extends System<any> {
102
102
  * @param {number} wvy
103
103
  * @param {number} wvz
104
104
  */
105
- static "__#430@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
105
+ static "__#432@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
106
106
  constructor();
107
107
  dependencies: (typeof FluidObstacle)[];
108
108
  components_used: (ResourceAccessSpecification<typeof Transform64> | ResourceAccessSpecification<typeof RigidBody> | ResourceAccessSpecification<typeof Collider> | ResourceAccessSpecification<typeof FluidComponent> | ResourceAccessSpecification<typeof FluidObstacle>)[];