@woosh/meep-engine 3.42.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 (345) hide show
  1. package/editor/prototypeEditorShell.d.ts.map +1 -1
  2. package/editor/prototypeEditorShell.js +4 -2
  3. package/package.json +91 -96
  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/playground/vgeo_runtime/README.md +5 -4
  177. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  178. package/src/shade/renderer/Renderer.js +6 -5
  179. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
  180. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  181. package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
  182. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
  183. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  184. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
  185. package/src/shade/renderer/atmosphere/GPUSky.d.ts +12 -0
  186. package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
  187. package/src/shade/renderer/atmosphere/GPUSky.js +162 -147
  188. package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
  189. package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
  190. package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
  191. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
  192. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
  193. package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
  194. package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
  195. package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
  196. package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
  197. package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
  198. package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
  199. package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
  200. package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
  201. package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
  202. package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
  203. package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
  204. package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
  205. package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
  206. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
  207. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
  208. package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
  209. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
  210. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
  211. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
  212. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
  213. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
  214. package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
  215. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
  216. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
  217. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
  218. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
  219. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
  220. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
  221. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  222. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
  223. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
  224. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  225. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
  226. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
  227. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
  228. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
  229. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
  230. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
  231. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
  232. package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
  233. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
  234. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  235. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
  236. package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.d.ts.map +1 -1
  237. package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.js +10 -3
  238. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  239. package/src/shade/renderer/particles/DESIGN.md +13 -9
  240. package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
  241. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
  242. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  243. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
  244. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  245. package/src/shade/renderer/particles/graph_particles.js +6 -2
  246. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +1 -1
  247. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +1 -1
  248. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  249. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
  250. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  251. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  252. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
  253. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  254. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
  255. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +3 -2
  256. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  257. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +3 -2
  258. package/src/shade/renderer/scene/GPUSceneContext.d.ts +9 -1
  259. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  260. package/src/shade/renderer/scene/GPUSceneContext.js +23 -1
  261. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
  262. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  263. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
  264. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
  265. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  266. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
  267. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  268. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
  269. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
  270. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
  271. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
  272. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
  273. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  274. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
  275. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
  276. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
  277. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
  278. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
  279. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
  280. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
  281. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
  282. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
  283. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
  284. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
  285. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  286. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
  287. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +4 -1
  288. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  289. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +74 -3
  290. package/src/shade/renderer/volumetrics/NOTES.md +1023 -957
  291. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +5 -4
  292. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts.map +1 -1
  293. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +5 -4
  294. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts +1 -1
  295. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +1 -1
  296. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts +1 -1
  297. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +1 -1
  298. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts +41 -0
  299. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts.map +1 -0
  300. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +112 -0
  301. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +9 -23
  302. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
  303. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +18 -126
  304. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts +22 -0
  305. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts.map +1 -0
  306. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.js +228 -0
  307. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
  308. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +0 -53
  309. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  310. package/src/shade/renderer/water/chunk_water_transport.js +7 -5
  311. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  312. package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
  313. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
  314. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
  315. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
  316. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  317. package/src/shade/renderer/water/shader_water.js +3 -1
  318. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
  319. package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
  320. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -3
  321. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -1
  322. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +17 -7
  323. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  324. package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
  325. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  326. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +93 -30
  327. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
  328. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +13 -5
  329. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +29 -8
  330. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  331. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +155 -30
  332. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +6 -1
  333. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  334. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +157 -39
  335. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +91 -21
  336. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
  337. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +442 -70
  338. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +11 -3
  339. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  340. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +3 -0
  341. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  342. package/src/shade/wgsl/validate_wgsl_source.js +74 -3
  343. package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
  344. package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
  345. package/src/engine/graphics3/register_instance_animation.js +0 -201
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @typedef {import("../../../graphics3/prefab/Prefab.js").Prefab} Prefab
3
+ * @typedef {import("../../../../shade/renderer/animation/Skin.js").Skin} Skin
4
+ * @typedef {import("./cloth_proxy_from_joints.js").ClothProxyBuildResult} ClothProxyBuildResult
5
+ */
6
+ /**
7
+ * # Building a proxy for a sheet: one joint per vertex, and the triangles between them
8
+ *
9
+ * A sheet — a flag, a banner, a curtain, a cloth dropped on a sphere — is a
10
+ * triangle mesh, and what drives its render mesh is a skin with **one joint per
11
+ * vertex**: each vertex weighted wholly to its own joint, every joint hanging
12
+ * straight off one root joint. That skin is ordinary; the engine draws it the way
13
+ * it draws any skinned model, and cloth moves its joints the way it moves a
14
+ * cape's. This builds the proxy for it — §11.3's steps 4, 6 and 10 over a mesh
15
+ * that is already welded and already a particle set:
16
+ *
17
+ * - **a hard stretch row per edge**, every edge of every triangle once;
18
+ * - **a hinge per interior edge** — the shared edge, then the wing opposite it in
19
+ * each triangle, which is `cloth_bend_row`'s stencil order. The stencil is built
20
+ * here rather than read through `bt_edge_read_diamond`, whose quad puts the
21
+ * shared edge in the middle;
22
+ * - the bind pose of every joint in the root joint's, and the root joint as the
23
+ * frame the sheet is simulated in.
24
+ *
25
+ * **Nothing is pinned.** Which vertices are held is the scene's business — a pole
26
+ * holding a flag's hoist, a hook holding a ribbon's top — and a `ClothPin` names
27
+ * them by particle, which is their position in `joint_names`.
28
+ *
29
+ * ## What is refused, and why at build
30
+ *
31
+ * §7 P8: a triangle with no area (no normal, no stencil), an edge three triangles
32
+ * share (no single hinge across it), joints that do not all hang from the same
33
+ * root, and a name the skin does not have. Each is an authoring mistake, and each
34
+ * comes back as a message naming it rather than as a sheet that misbehaves.
35
+ *
36
+ * ## The rest shape is assumed flat where it bends
37
+ *
38
+ * The hinge is §6's quadratic stencil, which annihilates a planar rest shape and
39
+ * every affine image of it and reads a curved rest as already bent (§18). A flag,
40
+ * a sheet and a circle skirt cut flat are what this serves; a tube is not.
41
+ *
42
+ * @author Alex Goldring
43
+ * @copyright Company Named Limited (c) 2026
44
+ */
45
+ /**
46
+ * Build a proxy from the joints of a sheet's skin and the triangles over them.
47
+ *
48
+ * @param {Prefab} prefab the compiled model the joints are nodes of
49
+ * @param {Skin} skin one of the prefab's skins — joints as node indices
50
+ * @param {string[]} joint_names one joint per vertex; particle `i` is `joint_names[i]`
51
+ * @param {Int32Array|number[]} triangles indices into `joint_names`, 3 per triangle
52
+ * @param {object} [options]
53
+ * @param {string} [options.name]
54
+ * @returns {ClothProxyBuildResult}
55
+ */
56
+ export function cloth_proxy_from_mesh(prefab: Prefab, skin: Skin, joint_names: string[], triangles: Int32Array | number[], { name }?: {
57
+ name?: string;
58
+ }): ClothProxyBuildResult;
59
+ export type Prefab = import("../../../graphics3/prefab/Prefab.js").Prefab;
60
+ export type Skin = import("../../../../shade/renderer/animation/Skin.js").Skin;
61
+ export type ClothProxyBuildResult = import("./cloth_proxy_from_joints.js").ClothProxyBuildResult;
62
+ //# sourceMappingURL=cloth_proxy_from_mesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloth_proxy_from_mesh.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/cloth_proxy_from_mesh.js"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;GAUG;AACH,8CARW,MAAM,QACN,IAAI,eACJ,MAAM,EAAE,aACR,UAAU,GAAC,MAAM,EAAE;IAEF,IAAI,GAArB,MAAM;IACJ,qBAAqB,CA8LjC;qBApPY,OAAO,qCAAqC,EAAE,MAAM;mBACpD,OAAO,8CAA8C,EAAE,IAAI;oCAC3D,OAAO,8BAA8B,EAAE,qBAAqB"}
@@ -0,0 +1,280 @@
1
+ import { ClothProxy } from "./ClothProxy.js";
2
+ import { cloth_bind_in_frame } from "./cloth_bind_in_frame.js";
3
+
4
+ /**
5
+ * @typedef {import("../../../graphics3/prefab/Prefab.js").Prefab} Prefab
6
+ * @typedef {import("../../../../shade/renderer/animation/Skin.js").Skin} Skin
7
+ * @typedef {import("./cloth_proxy_from_joints.js").ClothProxyBuildResult} ClothProxyBuildResult
8
+ */
9
+
10
+ /**
11
+ * # Building a proxy for a sheet: one joint per vertex, and the triangles between them
12
+ *
13
+ * A sheet — a flag, a banner, a curtain, a cloth dropped on a sphere — is a
14
+ * triangle mesh, and what drives its render mesh is a skin with **one joint per
15
+ * vertex**: each vertex weighted wholly to its own joint, every joint hanging
16
+ * straight off one root joint. That skin is ordinary; the engine draws it the way
17
+ * it draws any skinned model, and cloth moves its joints the way it moves a
18
+ * cape's. This builds the proxy for it — §11.3's steps 4, 6 and 10 over a mesh
19
+ * that is already welded and already a particle set:
20
+ *
21
+ * - **a hard stretch row per edge**, every edge of every triangle once;
22
+ * - **a hinge per interior edge** — the shared edge, then the wing opposite it in
23
+ * each triangle, which is `cloth_bend_row`'s stencil order. The stencil is built
24
+ * here rather than read through `bt_edge_read_diamond`, whose quad puts the
25
+ * shared edge in the middle;
26
+ * - the bind pose of every joint in the root joint's, and the root joint as the
27
+ * frame the sheet is simulated in.
28
+ *
29
+ * **Nothing is pinned.** Which vertices are held is the scene's business — a pole
30
+ * holding a flag's hoist, a hook holding a ribbon's top — and a `ClothPin` names
31
+ * them by particle, which is their position in `joint_names`.
32
+ *
33
+ * ## What is refused, and why at build
34
+ *
35
+ * §7 P8: a triangle with no area (no normal, no stencil), an edge three triangles
36
+ * share (no single hinge across it), joints that do not all hang from the same
37
+ * root, and a name the skin does not have. Each is an authoring mistake, and each
38
+ * comes back as a message naming it rather than as a sheet that misbehaves.
39
+ *
40
+ * ## The rest shape is assumed flat where it bends
41
+ *
42
+ * The hinge is §6's quadratic stencil, which annihilates a planar rest shape and
43
+ * every affine image of it and reads a curved rest as already bent (§18). A flag,
44
+ * a sheet and a circle skirt cut flat are what this serves; a tube is not.
45
+ *
46
+ * @author Alex Goldring
47
+ * @copyright Company Named Limited (c) 2026
48
+ */
49
+
50
+ /**
51
+ * Build a proxy from the joints of a sheet's skin and the triangles over them.
52
+ *
53
+ * @param {Prefab} prefab the compiled model the joints are nodes of
54
+ * @param {Skin} skin one of the prefab's skins — joints as node indices
55
+ * @param {string[]} joint_names one joint per vertex; particle `i` is `joint_names[i]`
56
+ * @param {Int32Array|number[]} triangles indices into `joint_names`, 3 per triangle
57
+ * @param {object} [options]
58
+ * @param {string} [options.name]
59
+ * @returns {ClothProxyBuildResult}
60
+ */
61
+ export function cloth_proxy_from_mesh(prefab, skin, joint_names, triangles, { name = "" } = {}) {
62
+ if (prefab === undefined || prefab === null || prefab.isPrefab !== true) {
63
+ return refuse(`${name}: no prefab`);
64
+ }
65
+
66
+ if (skin === undefined || skin === null) {
67
+ return refuse(`${name}: no skin`);
68
+ }
69
+
70
+ const joints = skin.joints;
71
+ const parent_of = prefab.parent;
72
+ const name_of = prefab.name;
73
+
74
+ /**
75
+ * @type {Map<number, number>} node index → position in the skin's joints
76
+ */
77
+ const index_of = new Map();
78
+
79
+ /**
80
+ * @type {Map<string, number>}
81
+ */
82
+ const by_name = new Map();
83
+
84
+ for (let i = 0; i < joints.length; i++) {
85
+ index_of.set(joints[i], i);
86
+
87
+ const joint_name = name_of[joints[i]];
88
+
89
+ if (joint_name !== "" && !by_name.has(joint_name)) {
90
+ by_name.set(joint_name, joints[i]);
91
+ }
92
+ }
93
+
94
+ const particle_count = joint_names.length;
95
+
96
+ if (particle_count === 0) {
97
+ return refuse(`${name}: no joints`);
98
+ }
99
+
100
+ const node = new Int32Array(particle_count);
101
+
102
+ const seen = new Set();
103
+
104
+ for (let i = 0; i < particle_count; i++) {
105
+ const found = by_name.get(joint_names[i]);
106
+
107
+ if (found === undefined) {
108
+ return refuse(`${name}: the skin has no joint named "${joint_names[i]}"`);
109
+ }
110
+
111
+ if (seen.has(found)) {
112
+ return refuse(`${name}: "${joint_names[i]}" is named twice`);
113
+ }
114
+
115
+ seen.add(found);
116
+
117
+ node[i] = found;
118
+ }
119
+
120
+ // One root for every vertex joint: the frame, and what the write-back
121
+ // expresses each joint against.
122
+ const frame_node = parent_of[node[0]];
123
+
124
+ for (let i = 1; i < particle_count; i++) {
125
+ if (parent_of[node[i]] !== frame_node) {
126
+ return refuse(
127
+ `${name}: "${joint_names[0]}" hangs from "${name_of[frame_node] ?? 'nothing'}" and "${joint_names[i]}"`
128
+ + ` from "${name_of[parent_of[node[i]]] ?? 'nothing'}" — a sheet's joints hang from one root joint`
129
+ );
130
+ }
131
+ }
132
+
133
+ if (frame_node < 0 || !index_of.has(frame_node)) {
134
+ return refuse(`${name}: the sheet's joints hang from "${name_of[frame_node] ?? 'nothing'}", which is not a joint of this skin`);
135
+ }
136
+
137
+ const triangle_count = Math.floor(triangles.length / 3);
138
+
139
+ if (triangle_count * 3 !== triangles.length) {
140
+ return refuse(`${name}: ${triangles.length} triangle indices is not a whole number of triangles`);
141
+ }
142
+
143
+ const pose = cloth_bind_in_frame(prefab, frame_node);
144
+
145
+ const rest_position = new Float32Array(particle_count * 3);
146
+ const rest_rotation = new Float32Array(particle_count * 4);
147
+
148
+ for (let i = 0; i < particle_count; i++) {
149
+ const p = pose(node[i]);
150
+
151
+ rest_position[i * 3] = p[0];
152
+ rest_position[i * 3 + 1] = p[1];
153
+ rest_position[i * 3 + 2] = p[2];
154
+
155
+ rest_rotation[i * 4] = p[3];
156
+ rest_rotation[i * 4 + 1] = p[4];
157
+ rest_rotation[i * 4 + 2] = p[5];
158
+ rest_rotation[i * 4 + 3] = p[6];
159
+ }
160
+
161
+ /**
162
+ * Every edge once, keyed by its two particles, with the wing opposite it in
163
+ * each triangle that has it.
164
+ * @type {Map<number, {a: number, b: number, wings: number[]}>}
165
+ */
166
+ const edges = new Map();
167
+
168
+ for (let t = 0; t < triangle_count; t++) {
169
+ const i0 = triangles[t * 3];
170
+ const i1 = triangles[t * 3 + 1];
171
+ const i2 = triangles[t * 3 + 2];
172
+
173
+ for (const index of [i0, i1, i2]) {
174
+ if (!(index >= 0 && index < particle_count)) {
175
+ return refuse(`${name}: triangle ${t} names particle ${index} of ${particle_count}`);
176
+ }
177
+ }
178
+
179
+ if (twice_area(rest_position, i0, i1, i2) <= 0) {
180
+ return refuse(
181
+ `${name}: triangle ${t} ("${joint_names[i0]}", "${joint_names[i1]}", "${joint_names[i2]}") has no area,`
182
+ + ` so no normal and no hinge across it`
183
+ );
184
+ }
185
+
186
+ const corners = [i0, i1, i2];
187
+
188
+ for (let k = 0; k < 3; k++) {
189
+ const a = corners[k];
190
+ const b = corners[(k + 1) % 3];
191
+ const wing = corners[(k + 2) % 3];
192
+
193
+ const lo = a < b ? a : b;
194
+ const hi = a < b ? b : a;
195
+
196
+ const key = lo * particle_count + hi;
197
+
198
+ let edge = edges.get(key);
199
+
200
+ if (edge === undefined) {
201
+ edge = { a: lo, b: hi, wings: [] };
202
+
203
+ edges.set(key, edge);
204
+ }
205
+
206
+ edge.wings.push(wing);
207
+
208
+ if (edge.wings.length > 2) {
209
+ return refuse(
210
+ `${name}: the edge "${joint_names[lo]}"–"${joint_names[hi]}" is shared by more than two triangles,`
211
+ + ` so there is no one hinge across it`
212
+ );
213
+ }
214
+ }
215
+ }
216
+
217
+ const edge = [];
218
+ const hinge = [];
219
+
220
+ for (const { a, b, wings } of edges.values()) {
221
+ edge.push(a, b);
222
+
223
+ if (wings.length === 2) {
224
+ hinge.push(a, b, wings[0], wings[1]);
225
+ }
226
+ }
227
+
228
+ const particle_name = joint_names.slice();
229
+
230
+ return {
231
+ proxy: ClothProxy.from({
232
+ name,
233
+ joint: Array.from(node, n => index_of.get(n)),
234
+ output: new Uint8Array(particle_count).fill(1),
235
+ // every joint hangs straight off the frame
236
+ parent: new Int32Array(particle_count).fill(-1),
237
+ edge,
238
+ skip: [],
239
+ hinge,
240
+ triangle: Int32Array.from(triangles),
241
+ frame: index_of.get(frame_node),
242
+ rest_position,
243
+ rest_rotation,
244
+ particle_name
245
+ }),
246
+ groups: [],
247
+ error: ""
248
+ };
249
+ }
250
+
251
+ /**
252
+ * Twice the area of a triangle of the rest pose.
253
+ *
254
+ * @param {Float32Array} position
255
+ * @param {number} a
256
+ * @param {number} b
257
+ * @param {number} c
258
+ * @returns {number}
259
+ * @private
260
+ */
261
+ function twice_area(position, a, b, c) {
262
+ const ux = position[b * 3] - position[a * 3];
263
+ const uy = position[b * 3 + 1] - position[a * 3 + 1];
264
+ const uz = position[b * 3 + 2] - position[a * 3 + 2];
265
+
266
+ const vx = position[c * 3] - position[a * 3];
267
+ const vy = position[c * 3 + 1] - position[a * 3 + 1];
268
+ const vz = position[c * 3 + 2] - position[a * 3 + 2];
269
+
270
+ return Math.hypot(uy * vz - uz * vy, uz * vx - ux * vz, ux * vy - uy * vx);
271
+ }
272
+
273
+ /**
274
+ * @param {string} error
275
+ * @returns {ClothProxyBuildResult}
276
+ * @private
277
+ */
278
+ function refuse(error) {
279
+ return { proxy: null, groups: [], error };
280
+ }
@@ -36,7 +36,7 @@
36
36
  * The rotation is an `nlerp` rather than a `slerp`: it is not constant angular
37
37
  * velocity, and over the fraction of a fixed step it is indistinguishable from
38
38
  * one — the two differ by under a thousandth of a degree at the half-radian per
39
- * step `CLOTH_ANCHOR_ROTATION_LIMIT` already treats as a spin.
39
+ * step `CLOTH_FRAME_ROTATION_LIMIT` already treats as a spin.
40
40
  *
41
41
  * @param {Float32Array|Float64Array} table
42
42
  * @param {number} count records in `table`
@@ -72,7 +72,7 @@ import { ClothColliderKind } from "./ClothColliderKind.js";
72
72
  * The rotation is an `nlerp` rather than a `slerp`: it is not constant angular
73
73
  * velocity, and over the fraction of a fixed step it is indistinguishable from
74
74
  * one — the two differ by under a thousandth of a degree at the half-radian per
75
- * step `CLOTH_ANCHOR_ROTATION_LIMIT` already treats as a spin.
75
+ * step `CLOTH_FRAME_ROTATION_LIMIT` already treats as a spin.
76
76
  *
77
77
  * @param {Float32Array|Float64Array} table
78
78
  * @param {number} count records in `table`
@@ -6,22 +6,30 @@
6
6
  *
7
7
  * ```js
8
8
  * rope_top.add(Cloth.from(ClothDynamics.ROPE));
9
+ * rope_top.add(ClothPin.from({ cloth: rope_top, particles: [0] }));
9
10
  * ```
10
11
  *
11
- * **The anchor is the entity the component is on**, and nothing names anything.
12
- * The particle set is that entity's own transform subtree, walked through
13
- * `TransformAttachmentSystem#findChildrenOf` — the parent-to-children index the
14
- * engine already maintains. Put `Cloth` on the top link of a rope and you get
15
- * the rope; put it on a node with several chains under it and you get all of
16
- * them in **one coupled solve**, which is what makes self-collision between
17
- * them work when it arrives.
12
+ * **The entity the component is on is the cloth's frame**, and nothing names
13
+ * anything. The particle set is that entity and its transform subtree, walked
14
+ * through `TransformAttachmentSystem#findChildrenOf` — the parent-to-children
15
+ * index the engine already maintains — with the entity itself as particle 0.
16
+ * Put `Cloth` on the top link of a rope and you get the rope; put it on a node
17
+ * with several chains under it and you get all of them in **one coupled
18
+ * solve**, which is what makes self-collision between them work.
19
+ *
20
+ * **What holds it is a separate question**, answered by {@link ClothPin}s: any
21
+ * number of them, on any entities, holding any particles, added and removed
22
+ * while it runs. The rope above is held at its top by its own entity; a rope
23
+ * bridge is that plus a post holding its last link; a rope nothing holds falls.
24
+ * The frame is only what the cloth is simulated in and what §7 P7's inertia is
25
+ * measured against — the entity the cloth rides, which cloth reads and never
26
+ * writes.
18
27
  *
19
28
  * Two rules keep the walk unambiguous:
20
29
  *
21
30
  * - **A nested `Cloth` claims its own subtree.** The walk stops when it meets
22
31
  * another `Cloth`, so independent hanging parts of one prop partition
23
- * naturally. The two solves are ordered by hierarchy depth, so the outer one
24
- * has written the inner one's anchor before the inner one reads it.
32
+ * naturally, each read one fixed step after the cloth above it wrote it.
25
33
  * - **{@link ClothExclude}** prunes a subtree from the walk, for the rig with a
26
34
  * non-simulated attachment point in the middle of a chain.
27
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Cloth.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/Cloth.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH;IAkDI;;;;;;;;;OASG;IACH,uBATW,aAAa;QAGC,KAAK,GAAnB,MAAM;QACQ,KAAK,GAAnB,MAAM;QACQ,IAAI,GAAlB,MAAM;QACQ,KAAK,GAAnB,MAAM;QACJ,KAAK,CA6BjB;IArFD;;;;;;;OAOG;IACH,UAFU,aAAa,CAEQ;IAE/B;;;;;;;;OAQG;IACH,OAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,OAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,cAHW,MAAM,GAAC,UAAU,GACf,OAAO,CAInB;IAyCD;;;OAGG;IACH,cAHW,KAAK,GACH,OAAO,CAgBnB;IAED;;OAEG;IACH,QAFa,MAAM,CAUlB;IAED;;;;;;;;;;;;;;;;;MAQC;IAED;;OAEG;IACH,kDAFW,MAAM,QAehB;IAED,mBAEC;IAGL;;;OAGG;IACH,kBAFU,OAAO,CAEM;CANtB;;;;8BAxM6B,oBAAoB;2BACvB,iBAAiB"}
1
+ {"version":3,"file":"Cloth.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/Cloth.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH;IAkDI;;;;;;;;;OASG;IACH,uBATW,aAAa;QAGC,KAAK,GAAnB,MAAM;QACQ,KAAK,GAAnB,MAAM;QACQ,IAAI,GAAlB,MAAM;QACQ,KAAK,GAAnB,MAAM;QACJ,KAAK,CA6BjB;IArFD;;;;;;;OAOG;IACH,UAFU,aAAa,CAEQ;IAE/B;;;;;;;;OAQG;IACH,OAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,OAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,cAHW,MAAM,GAAC,UAAU,GACf,OAAO,CAInB;IAyCD;;;OAGG;IACH,cAHW,KAAK,GACH,OAAO,CAgBnB;IAED;;OAEG;IACH,QAFa,MAAM,CAUlB;IAED;;;;;;;;;;;;;;;;;MAQC;IAED;;OAEG;IACH,kDAFW,MAAM,QAehB;IAED,mBAEC;IAGL;;;OAGG;IACH,kBAFU,OAAO,CAEM;CANtB;;;;8BAhN6B,oBAAoB;2BACvB,iBAAiB"}