@woosh/meep-engine 3.43.0 → 3.44.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 (287) hide show
  1. package/editor/prototypeEditorShell.d.ts.map +1 -1
  2. package/editor/prototypeEditorShell.js +4 -2
  3. package/package.json +1 -1
  4. package/src/engine/Clock.d.ts +15 -0
  5. package/src/engine/Clock.d.ts.map +1 -1
  6. package/src/engine/Clock.js +29 -5
  7. package/src/engine/Engine.d.ts.map +1 -1
  8. package/src/engine/Engine.js +11 -19
  9. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
  10. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
  11. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
  12. package/src/engine/graphics3/AnimationGraphSystem.d.ts +23 -13
  13. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  14. package/src/engine/graphics3/AnimationGraphSystem.js +61 -64
  15. package/src/engine/graphics3/AnimationSystem.d.ts +24 -15
  16. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  17. package/src/engine/graphics3/AnimationSystem.js +67 -61
  18. package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
  19. package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
  20. package/src/engine/graphics3/MeshSkinSystem.js +317 -0
  21. package/src/engine/graphics3/MeshSystem.d.ts +15 -35
  22. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  23. package/src/engine/graphics3/MeshSystem.js +21 -298
  24. package/src/engine/graphics3/RowChains.d.ts +76 -0
  25. package/src/engine/graphics3/RowChains.d.ts.map +1 -0
  26. package/src/engine/graphics3/RowChains.js +347 -0
  27. package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
  28. package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
  29. package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
  30. package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
  31. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
  32. package/src/engine/graphics3/animation/AnimationClips.js +79 -0
  33. package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
  34. package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
  35. package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
  36. package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
  37. package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
  38. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
  39. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  40. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
  41. package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
  42. package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
  43. package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
  44. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
  45. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
  46. package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
  47. package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
  48. package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
  49. package/src/engine/graphics3/prefab/prefab_place.js +175 -130
  50. package/src/engine/graphics3/register_clips.d.ts +64 -0
  51. package/src/engine/graphics3/register_clips.d.ts.map +1 -0
  52. package/src/engine/graphics3/register_clips.js +114 -0
  53. package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
  54. package/src/engine/physics/cloth/PLAN.md +339 -9
  55. package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
  56. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
  57. package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
  58. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +22 -0
  59. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
  60. package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +75 -0
  61. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
  62. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
  63. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +357 -284
  64. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
  65. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
  66. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +280 -0
  67. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
  68. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +1 -1
  69. package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
  70. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  71. package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
  72. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
  73. package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
  74. package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
  75. package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
  76. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
  77. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  78. package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
  79. package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
  80. package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
  81. package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
  82. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
  83. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
  84. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
  85. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
  86. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
  87. package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
  88. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
  89. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  90. package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
  91. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
  92. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  93. package/src/engine/physics/cloth/ecs/ClothWorld.js +816 -179
  94. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
  95. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
  96. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
  97. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
  98. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  99. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +321 -84
  100. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
  101. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  102. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +9 -7
  103. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
  104. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +30 -30
  105. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
  106. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
  107. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +142 -0
  108. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
  109. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
  110. package/src/engine/physics/cloth/ecs/cloth_holds.js +608 -0
  111. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
  112. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
  113. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +160 -9
  114. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
  115. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
  116. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
  117. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
  118. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  119. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +44 -15
  120. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
  121. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  122. package/src/engine/physics/cloth/ecs/cloth_write_back.js +60 -16
  123. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
  124. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
  125. package/src/engine/physics/cloth/playground/collide_main.js +1 -1
  126. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
  127. package/src/engine/physics/cloth/playground/garment_build.js +17 -5
  128. package/src/engine/physics/cloth/playground/garment_main.js +1 -1
  129. package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
  130. package/src/engine/physics/cloth/playground/rig_build.js +302 -296
  131. package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
  132. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  133. package/src/engine/physics/cloth/solver/ClothState.js +63 -7
  134. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
  135. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  136. package/src/engine/physics/cloth/solver/cloth_contact_find.js +7 -2
  137. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
  138. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
  139. package/src/engine/physics/cloth/solver/cloth_hold_line.js +362 -0
  140. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
  141. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  142. package/src/engine/physics/cloth/solver/cloth_self_find.js +13 -13
  143. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
  144. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  145. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
  146. package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
  147. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/solver/cloth_step.js +183 -20
  149. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
  150. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/solver/cloth_step_instance.js +10 -3
  152. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
  153. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
  154. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
  155. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
  156. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
  157. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
  158. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +9 -9
  159. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
  160. package/src/engine/physics/cloth/wind/cloth_sample_air.js +26 -26
  161. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  162. package/src/engine/simulation/Ticker.d.ts +13 -0
  163. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  164. package/src/engine/simulation/Ticker.js +43 -8
  165. package/src/shade/RENDERER_CONTRACT.md +8 -2
  166. package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
  167. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  168. package/src/shade/playground/skinned_blas_refit/main.js +11 -19
  169. package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
  170. package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
  171. package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
  172. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  173. package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
  174. package/src/shade/playground/texture_encode/README.md +129 -109
  175. package/src/shade/playground/texture_encode/main.js +1430 -1430
  176. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
  177. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  178. package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
  179. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
  180. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  181. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
  182. package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
  183. package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
  184. package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
  185. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
  186. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
  187. package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
  188. package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
  189. package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
  190. package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
  191. package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
  192. package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
  193. package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
  194. package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
  195. package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
  196. package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
  197. package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
  198. package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
  199. package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
  200. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
  201. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
  202. package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
  203. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
  204. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
  205. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
  206. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
  207. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
  208. package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
  209. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
  210. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
  211. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
  212. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
  213. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
  214. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
  215. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  216. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
  217. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
  218. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  219. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
  220. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
  221. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
  222. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
  223. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
  224. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
  225. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
  226. package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
  227. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
  228. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  229. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
  230. package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
  231. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
  232. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  233. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
  234. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  235. package/src/shade/renderer/particles/graph_particles.js +6 -2
  236. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  237. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
  238. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  239. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
  240. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  241. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
  242. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
  243. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  244. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
  245. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
  246. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  247. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
  248. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  249. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
  250. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
  251. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
  252. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
  253. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
  254. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  255. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
  256. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
  257. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
  258. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
  259. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
  260. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
  261. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
  262. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
  263. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
  264. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
  265. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
  266. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  267. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
  268. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  269. package/src/shade/renderer/water/chunk_water_transport.js +7 -5
  270. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  271. package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
  272. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
  273. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
  274. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
  275. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  276. package/src/shade/renderer/water/shader_water.js +3 -1
  277. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
  278. package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
  279. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  280. package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
  281. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  282. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +37 -20
  283. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  284. package/src/shade/wgsl/validate_wgsl_source.js +74 -3
  285. package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
  286. package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
  287. package/src/engine/graphics3/register_instance_animation.js +0 -201
@@ -1,5 +1,6 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
  import { cloth_collider_pose_at } from "../collider/cloth_collider_sdf.js";
3
+ import { CLOTH_HOLD_LINE_WORDS, cloth_hold_line_fit, cloth_hold_line_turn } from "./cloth_hold_line.js";
3
4
  import { cloth_solve_vertex } from "./cloth_solve_vertex.js";
4
5
  import {
5
6
  CLOTH_CONTACT_K_MIN_RATIO,
@@ -42,6 +43,7 @@ import { find_non_finite_cloth_state } from "./find_non_finite_cloth_state.js";
42
43
  * warm start λ ← λ·α·γ ; k ← clamp(k·γ, k_min, k_max) (hard rows only)
43
44
  * iterate × iterations:
44
45
  * for each colour: for each particle: vertex update
46
+ * last iteration, held particles on one line: turn about it
45
47
  * dual update: λ ← clamp(k·C + λ, f_min, f_max)
46
48
  * k ← min(k + β·|C|, min(k_max, stiffness))
47
49
  * integrate v = (x − x_prev)/h
@@ -85,6 +87,21 @@ import { find_non_finite_cloth_state } from "./find_non_finite_cloth_state.js";
85
87
  * which is what makes "no wind produces the bytes M5 measured" a fact about the
86
88
  * code rather than a claim about floating point.
87
89
  *
90
+ * ## One more block when the holds are a line
91
+ *
92
+ * Every vertex update is a 3×3 block of the descent, and a cloth held along one
93
+ * line has a motion no such block can make: turning about the line as a rigid
94
+ * body. About a vertical line nothing restores that turn, and the step stopped
95
+ * at a fabric's iteration count left a moment about it every substep — a flag
96
+ * turned on its pole for as long as it was run. So the turn is a block of its
97
+ * own, `cloth_hold_line.js`: one Newton step along it, in the last iteration,
98
+ * after the sweep and before the dual update.
99
+ *
100
+ * Whether the held particles are on a line is decided at every substep, from
101
+ * where the predict has just carried them. The predict lists them as it goes,
102
+ * so the question costs a pass over the held particles rather than over the
103
+ * cloth.
104
+ *
88
105
  * ## What each piece is for
89
106
  *
90
107
  * **Warm start** carries the multipliers into the next substep so a hard row
@@ -203,13 +220,37 @@ export function cloth_step(
203
220
 
204
221
  const contacts = collider_table !== null && collider_count > 0 ? collider_table : null;
205
222
 
223
+ if (HELD.length < state.particle_count) {
224
+ HELD = new Int32Array(state.particle_count);
225
+ }
226
+
227
+ const held = HELD;
228
+ const line = HOLD_LINE;
229
+
230
+ const last_iteration = iterations - 1;
231
+
206
232
  for (let substep = 0; substep < substeps; substep++) {
233
+ // How many substeps are left, this one included: a held particle covers
234
+ // an equal share of what remains of its way at each of them.
235
+ const remaining = substeps - substep;
236
+
237
+ let held_count;
238
+
207
239
  if (external === null) {
208
- cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z);
240
+ held_count = cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z, remaining, held);
209
241
  } else {
210
- cloth_predict_varying(state, h, external);
242
+ held_count = cloth_predict_varying(state, h, external, remaining, held);
211
243
  }
212
244
 
245
+ // Where the held particles are for the rest of the substep: nothing
246
+ // below moves one.
247
+ const turn = cloth_hold_line_fit(line, state.position, held, held_count);
248
+
249
+ // After the held particles have moved, so a centre measured from one
250
+ // sits where it is at this substep rather than where it was at the
251
+ // start of the step.
252
+ cloth_leash_follow(state);
253
+
213
254
  if (contacts !== null) {
214
255
  cloth_collider_pose_at(contacts, collider_count, (substep + 1) / substeps);
215
256
  }
@@ -239,6 +280,10 @@ export function cloth_step(
239
280
  }
240
281
  }
241
282
 
283
+ if (turn && iteration === last_iteration) {
284
+ cloth_hold_line_turn(state, line, inverse_h_squared, contacts);
285
+ }
286
+
242
287
  cloth_stretch_dual_update(state, beta, k_max_ratio, inverse_h_squared);
243
288
  cloth_bend_dual_update(state, beta, k_max_ratio, inverse_h_squared);
244
289
  cloth_leash_dual_update(state, beta, k_max_ratio, inverse_h_squared);
@@ -262,6 +307,91 @@ export function cloth_step(
262
307
  );
263
308
  }
264
309
 
310
+ /**
311
+ * Carry one held particle an equal share of the remaining way to its kinematic
312
+ * target, and make that its inertial target too.
313
+ *
314
+ * Equal shares of what *remains* rather than `(substep + 1)/substeps` of the
315
+ * whole: the particle is not moved by anything else in between, so the two put
316
+ * it in the same places, and this form needs no record of where the step began.
317
+ * It lands on the target exactly at the last substep, and a target equal to the
318
+ * position moves nothing by exactly nothing — which is what keeps a holder that
319
+ * rides the frame bit-identical to the fixed anchor it replaced.
320
+ *
321
+ * @param {ClothState} state
322
+ * @param {number} p particle index times three
323
+ * @param {number} remaining substeps left in the step, this one included
324
+ * @private
325
+ */
326
+ function cloth_carry_held(state, p, remaining) {
327
+ const position = state.position;
328
+ const inertial = state.inertial;
329
+ const target = state.kinematic_target;
330
+
331
+ const x = position[p] + (target[p] - position[p]) / remaining;
332
+ const y = position[p + 1] + (target[p + 1] - position[p + 1]) / remaining;
333
+ const z = position[p + 2] + (target[p + 2] - position[p + 2]) / remaining;
334
+
335
+ position[p] = x;
336
+ position[p + 1] = y;
337
+ position[p + 2] = z;
338
+
339
+ inertial[p] = x;
340
+ inertial[p + 1] = y;
341
+ inertial[p + 2] = z;
342
+ }
343
+
344
+ /**
345
+ * Re-centre every leash row that is measured from a particle: `position[source]
346
+ * + offset`, at the substep's own positions.
347
+ *
348
+ * @param {ClothState} state
349
+ * @private
350
+ */
351
+ function cloth_leash_follow(state) {
352
+ const count = state.leash_count;
353
+
354
+ const source = state.leash_source;
355
+ const offset = state.leash_offset;
356
+ const target = state.leash_target;
357
+ const position = state.position;
358
+
359
+ for (let row = 0; row < count; row++) {
360
+ const s = source[row];
361
+
362
+ if (s < 0) {
363
+ continue;
364
+ }
365
+
366
+ const r = row * 3;
367
+ const p = s * 3;
368
+
369
+ target[r] = position[p] + offset[r];
370
+ target[r + 1] = position[p + 1] + offset[r + 1];
371
+ target[r + 2] = position[p + 2] + offset[r + 2];
372
+ }
373
+ }
374
+
375
+ /**
376
+ * A held particle's velocity is the one its holder is moving it at. Nothing in
377
+ * the step reads it while the hold lasts — it has no inertia and no acceleration
378
+ * to seed — and it is exactly what the particle carries when it is let go.
379
+ *
380
+ * @param {ClothState} state
381
+ * @param {number} p particle index times three
382
+ * @param {number} inverse_h
383
+ * @private
384
+ */
385
+ function cloth_held_velocity(state, p, inverse_h) {
386
+ const position = state.position;
387
+ const position_previous = state.position_previous;
388
+ const velocity = state.velocity;
389
+
390
+ velocity[p] = (position[p] - position_previous[p]) * inverse_h;
391
+ velocity[p + 1] = (position[p + 1] - position_previous[p + 1]) * inverse_h;
392
+ velocity[p + 2] = (position[p + 2] - position_previous[p + 2]) * inverse_h;
393
+ }
394
+
265
395
  /**
266
396
  * The largest inverse mass in the cloth — the lightest particle, which is the
267
397
  * one a shared penalty has to be safe for.
@@ -297,18 +427,22 @@ function max_inverse_mass(state) {
297
427
  * Predict: record where the substep started, build the inertial target every
298
428
  * vertex update pulls towards, and seed the descent.
299
429
  *
300
- * A pinned particle (zero inverse mass) is held exactly: it does not fall, it
301
- * does not carry velocity, and its inertial target is its own position, so a
302
- * row that reaches it sees a fixed anchor rather than a very heavy particle.
430
+ * A held particle (zero inverse mass) is kinematic: it does not fall, it is
431
+ * carried towards its {@link ClothState#kinematic_target} by an equal share of
432
+ * the remaining way, and its inertial target is wherever that puts it, so a row
433
+ * that reaches it sees a fixed anchor rather than a very heavy particle.
303
434
  *
304
435
  * @param {ClothState} state
305
436
  * @param {number} h
306
437
  * @param {number} acceleration_x
307
438
  * @param {number} acceleration_y
308
439
  * @param {number} acceleration_z
440
+ * @param {number} remaining substeps left in the step, this one included
441
+ * @param {Int32Array} held out, every held particle's index, in order
442
+ * @returns {number} how many particles are held
309
443
  * @private
310
444
  */
311
- function cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z) {
445
+ function cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z, remaining, held) {
312
446
  const particle_count = state.particle_count;
313
447
 
314
448
  const position = state.position;
@@ -324,6 +458,8 @@ function cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z)
324
458
  const gravity_y = h_squared * acceleration_y;
325
459
  const gravity_z = h_squared * acceleration_z;
326
460
 
461
+ let held_count = 0;
462
+
327
463
  for (let i = 0; i < particle_count; i++) {
328
464
  const p = i * 3;
329
465
 
@@ -336,9 +472,9 @@ function cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z)
336
472
  position_previous[p + 2] = z;
337
473
 
338
474
  if (mass_inverse[i] === 0) {
339
- inertial[p] = x;
340
- inertial[p + 1] = y;
341
- inertial[p + 2] = z;
475
+ cloth_carry_held(state, p, remaining);
476
+
477
+ held[held_count++] = i;
342
478
 
343
479
  continue;
344
480
  }
@@ -357,22 +493,26 @@ function cloth_predict(state, h, acceleration_x, acceleration_y, acceleration_z)
357
493
  position[p + 1] = y + drift_y + blend * gravity_y;
358
494
  position[p + 2] = z + drift_z + blend * gravity_z;
359
495
  }
496
+
497
+ return held_count;
360
498
  }
361
499
 
362
500
  /**
363
501
  * {@link cloth_predict} with a per-particle external acceleration — §10's wind,
364
502
  * with gravity already folded in by `cloth_wind_accelerate`.
365
503
  *
366
- * Identical in every other respect, including the pinned-particle rule: a pin is
367
- * held exactly, so the air does not move it and its inertial target is its own
368
- * position.
504
+ * Identical in every other respect, including the held-particle rule: the air
505
+ * does not move a held particle, its holder does.
369
506
  *
370
507
  * @param {ClothState} state
371
508
  * @param {number} h
372
509
  * @param {Float32Array} external 3 per particle, cloth-local, m/s²
510
+ * @param {number} remaining substeps left in the step, this one included
511
+ * @param {Int32Array} held out, every held particle's index, in order
512
+ * @returns {number} how many particles are held
373
513
  * @private
374
514
  */
375
- function cloth_predict_varying(state, h, external) {
515
+ function cloth_predict_varying(state, h, external, remaining, held) {
376
516
  const particle_count = state.particle_count;
377
517
 
378
518
  const position = state.position;
@@ -384,6 +524,8 @@ function cloth_predict_varying(state, h, external) {
384
524
 
385
525
  const h_squared = h * h;
386
526
 
527
+ let held_count = 0;
528
+
387
529
  for (let i = 0; i < particle_count; i++) {
388
530
  const p = i * 3;
389
531
 
@@ -396,9 +538,9 @@ function cloth_predict_varying(state, h, external) {
396
538
  position_previous[p + 2] = z;
397
539
 
398
540
  if (mass_inverse[i] === 0) {
399
- inertial[p] = x;
400
- inertial[p + 1] = y;
401
- inertial[p + 2] = z;
541
+ cloth_carry_held(state, p, remaining);
542
+
543
+ held[held_count++] = i;
402
544
 
403
545
  continue;
404
546
  }
@@ -421,6 +563,8 @@ function cloth_predict_varying(state, h, external) {
421
563
  position[p + 1] = y + drift_y + blend * push_y;
422
564
  position[p + 2] = z + drift_z + blend * push_z;
423
565
  }
566
+
567
+ return held_count;
424
568
  }
425
569
 
426
570
  /**
@@ -461,12 +605,14 @@ function cloth_integrate(state, inverse_h, acceleration_x, acceleration_y, accel
461
605
  const inverse_acceleration_squared = acceleration_squared > 0 ? 1 / acceleration_squared : 0;
462
606
 
463
607
  for (let i = 0; i < particle_count; i++) {
608
+ const p = i * 3;
609
+
464
610
  if (mass_inverse[i] === 0) {
611
+ cloth_held_velocity(state, p, inverse_h);
612
+
465
613
  continue;
466
614
  }
467
615
 
468
- const p = i * 3;
469
-
470
616
  const next_x = (position[p] - position_previous[p]) * inverse_h;
471
617
  const next_y = (position[p + 1] - position_previous[p + 1]) * inverse_h;
472
618
  const next_z = (position[p + 2] - position_previous[p + 2]) * inverse_h;
@@ -517,12 +663,14 @@ function cloth_integrate_varying(state, inverse_h, external) {
517
663
  const inertia_blend = state.inertia_blend;
518
664
 
519
665
  for (let i = 0; i < particle_count; i++) {
666
+ const p = i * 3;
667
+
520
668
  if (mass_inverse[i] === 0) {
669
+ cloth_held_velocity(state, p, inverse_h);
670
+
521
671
  continue;
522
672
  }
523
673
 
524
- const p = i * 3;
525
-
526
674
  const acceleration_x = external[p];
527
675
  const acceleration_y = external[p + 1];
528
676
  const acceleration_z = external[p + 2];
@@ -568,3 +716,18 @@ function cloth_integrate_varying(state, inverse_h, external) {
568
716
  velocity[p + 2] = next_z;
569
717
  }
570
718
  }
719
+
720
+ /**
721
+ * The held particles' indices, as the predict carries them — grown to the
722
+ * largest cloth stepped, and only ever read up to the count the predict returns.
723
+ * @type {Int32Array}
724
+ * @private
725
+ */
726
+ let HELD = new Int32Array(0);
727
+
728
+ /**
729
+ * The hold line of the substep in progress, from `cloth_hold_line_fit`.
730
+ * @type {Float64Array}
731
+ * @private
732
+ */
733
+ const HOLD_LINE = new Float64Array(CLOTH_HOLD_LINE_WORDS);
@@ -31,6 +31,7 @@ export namespace ClothStepParam {
31
31
  let COLLIDER_COUNT: number;
32
32
  let SELF_COLLISION: number;
33
33
  let DRAG_RESPONSE: number;
34
+ let KINEMATIC_TRAVEL: number;
34
35
  }
35
36
  /**
36
37
  * `Float64` words one cloth's parameter block occupies.
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_step_instance.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_step_instance.js"],"names":[],"mappings":"AAsIA;;;;;;;;;GASG;AACH,wEANW;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,GAAC,IAAI,UAE9C,YAAY,UACZ,MAAM,GACJ,IAAI,CA4DhB;;;;6BA/IS,MAAM;;;;;;;;;;;;;;;;;AAqEhB;;;GAGG;AACH,sCAFU,MAAM,CAE0B"}
1
+ {"version":3,"file":"cloth_step_instance.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_step_instance.js"],"names":[],"mappings":"AA4IA;;;;;;;;;GASG;AACH,wEANW;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAC,GAAC,IAAI,UAE9C,YAAY,UACZ,MAAM,GACJ,IAAI,CA6DhB;;;;6BAtJS,MAAM;;;;;;;;;;;;;;;;;;AA2EhB;;;GAGG;AACH,sCAFU,MAAM,CAE0B"}
@@ -123,14 +123,20 @@ export const ClothStepParam = {
123
123
  * takes `cloth_step`'s uniform-gravity path, which is the path M0 through
124
124
  * M5 measured.
125
125
  */
126
- DRAG_RESPONSE: 13
126
+ DRAG_RESPONSE: 13,
127
+ /**
128
+ * The furthest any held particle is carried this step, metres — how far a
129
+ * cloth its holders are dragging moves without a velocity to show for it.
130
+ * Contact discovery reaches this much further for every free particle.
131
+ */
132
+ KINEMATIC_TRAVEL: 14
127
133
  };
128
134
 
129
135
  /**
130
136
  * `Float64` words one cloth's parameter block occupies.
131
137
  * @type {number}
132
138
  */
133
- export const CLOTH_STEP_PARAM_STRIDE = 14;
139
+ export const CLOTH_STEP_PARAM_STRIDE = 15;
134
140
 
135
141
  /**
136
142
  * Step one cloth.
@@ -159,7 +165,8 @@ export function cloth_step_instance(state, self_exclusions, params, offset) {
159
165
  damp(state, params[offset + ClothStepParam.RETENTION]);
160
166
 
161
167
  const contact_count = cloth_contact_find(
162
- state, state.collider_table, state.collider_key, collider_count, dt
168
+ state, state.collider_table, state.collider_key, collider_count, dt,
169
+ params[offset + ClothStepParam.KINEMATIC_TRAVEL]
163
170
  );
164
171
 
165
172
  let self_pairs = 0;
@@ -11,7 +11,7 @@
11
11
  * | | `s` | `r` |
12
12
  * |---|---|---|
13
13
  * | slack | the particle's **animated position** | `slack · d_geo,i` |
14
- * | tether (LRA) | the **anchor's** position | `d_geo,i` |
14
+ * | tether (LRA) | the nearest **held particle's** position | `d_geo,i` |
15
15
  *
16
16
  * So they are one module, parameterised by mode, exactly as
17
17
  * `physics/constraint/solve_constraints.js` does for its 6-DOF joints at the
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_leash_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_leash_row.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH;;;;;;;;;;;GAWG;AACH,+CANW,YAAY,GAAC,MAAM,EAAE,mBACrB,MAAM,0BAEN,MAAM,GACJ,MAAM,CA8BlB;AAED;;;;;;GAMG;AACH,oDAJW,YAAY,+BAEZ,MAAM,QA8GhB;AAED;;;;;;;;;;;;;;GAcG;AACH,iEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QA0ChB;AAED;;;;;;;;GAQG;AACH,iEAJW,MAAM,eACN,MAAM,qBACN,MAAM,QA2ChB"}
1
+ {"version":3,"file":"cloth_leash_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_leash_row.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH;;;;;;;;;;;GAWG;AACH,+CANW,YAAY,GAAC,MAAM,EAAE,mBACrB,MAAM,0BAEN,MAAM,GACJ,MAAM,CA8BlB;AAED;;;;;;GAMG;AACH,oDAJW,YAAY,+BAEZ,MAAM,QAqHhB;AAED;;;;;;;;;;;;;;GAcG;AACH,iEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QA0ChB;AAED;;;;;;;;GAQG;AACH,iEAJW,MAAM,eACN,MAAM,qBACN,MAAM,QA2ChB"}