@woosh/meep-engine 3.22.0 → 3.23.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 (267) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts +118 -0
  3. package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts.map +1 -0
  4. package/src/core/geom/3d/hash-grid/PointHashGrid3.js +283 -0
  5. package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -1
  6. package/src/core/geom/3d/shape/BoxShape3D.js +6 -17
  7. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
  8. package/src/core/geom/3d/shape/CapsuleShape3D.js +3 -14
  9. package/src/core/geom/3d/shape/CylinderShape3D.d.ts.map +1 -1
  10. package/src/core/geom/3d/shape/CylinderShape3D.js +3 -21
  11. package/src/core/geom/3d/shape/PlaneShape3D.d.ts +105 -0
  12. package/src/core/geom/3d/shape/PlaneShape3D.d.ts.map +1 -0
  13. package/src/core/geom/3d/shape/PlaneShape3D.js +251 -0
  14. package/src/core/geom/3d/shape/SphereShape3D.js +3 -3
  15. package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
  16. package/src/core/geom/3d/shape/json/shape_to_type.js +3 -0
  17. package/src/core/geom/3d/shape/json/type_adapters.d.ts +14 -0
  18. package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
  19. package/src/core/geom/3d/shape/json/type_adapters.js +15 -0
  20. package/src/core/geom/3d/shape/sdf/sdf3_box.d.ts +51 -0
  21. package/src/core/geom/3d/shape/sdf/sdf3_box.d.ts.map +1 -0
  22. package/src/core/geom/3d/shape/sdf/sdf3_box.js +113 -0
  23. package/src/core/geom/3d/shape/sdf/sdf3_capsule.d.ts +46 -0
  24. package/src/core/geom/3d/shape/sdf/sdf3_capsule.d.ts.map +1 -0
  25. package/src/core/geom/3d/shape/sdf/sdf3_capsule.js +82 -0
  26. package/src/core/geom/3d/shape/sdf/sdf3_cylinder.d.ts +60 -0
  27. package/src/core/geom/3d/shape/sdf/sdf3_cylinder.d.ts.map +1 -0
  28. package/src/core/geom/3d/shape/sdf/sdf3_cylinder.js +126 -0
  29. package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.d.ts +50 -0
  30. package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.d.ts.map +1 -0
  31. package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.js +53 -0
  32. package/src/core/geom/3d/shape/sdf/sdf3_plane.d.ts +52 -0
  33. package/src/core/geom/3d/shape/sdf/sdf3_plane.d.ts.map +1 -0
  34. package/src/core/geom/3d/shape/sdf/sdf3_plane.js +61 -0
  35. package/src/core/geom/3d/shape/sdf/sdf3_sphere.d.ts +41 -0
  36. package/src/core/geom/3d/shape/sdf/sdf3_sphere.d.ts.map +1 -0
  37. package/src/core/geom/3d/shape/sdf/sdf3_sphere.js +71 -0
  38. package/src/core/process/ConcurrencyGate.d.ts +103 -0
  39. package/src/core/process/ConcurrencyGate.d.ts.map +1 -0
  40. package/src/core/process/ConcurrencyGate.js +207 -0
  41. package/src/engine/asset/AssetManager.d.ts +10 -0
  42. package/src/engine/asset/AssetManager.d.ts.map +1 -1
  43. package/src/engine/asset/AssetManager.js +10 -0
  44. package/src/engine/graphics/CONTEXT_LOSS_RECOVERY_PLAN.md +30 -13
  45. package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts +26 -0
  46. package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts.map +1 -0
  47. package/src/engine/graphics3/pose/collect_entity_playbacks.js +40 -0
  48. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  49. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +74 -101
  50. package/src/engine/physics/cloth/MEASUREMENTS.md +1287 -4
  51. package/src/engine/physics/cloth/PLAN.md +1967 -1581
  52. package/src/engine/physics/cloth/build/ClothProxy.d.ts +147 -0
  53. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -0
  54. package/src/engine/physics/cloth/build/ClothProxy.js +207 -0
  55. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +70 -0
  56. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -0
  57. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +256 -0
  58. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +176 -0
  59. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -0
  60. package/src/engine/physics/cloth/collider/ClothColliderIndex.js +435 -0
  61. package/src/engine/physics/cloth/collider/ClothColliderKind.d.ts +12 -0
  62. package/src/engine/physics/cloth/collider/ClothColliderKind.d.ts.map +1 -0
  63. package/src/engine/physics/cloth/collider/ClothColliderKind.js +38 -0
  64. package/src/engine/physics/cloth/collider/ClothColliderRecord.d.ts +120 -0
  65. package/src/engine/physics/cloth/collider/ClothColliderRecord.d.ts.map +1 -0
  66. package/src/engine/physics/cloth/collider/ClothColliderRecord.js +137 -0
  67. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts +25 -0
  68. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -0
  69. package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +190 -0
  70. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +44 -0
  71. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -0
  72. package/src/engine/physics/cloth/collider/cloth_collider_pack.js +173 -0
  73. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +94 -0
  74. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -0
  75. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +275 -0
  76. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts +126 -0
  77. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -0
  78. package/src/engine/physics/cloth/ecs/ClothCollider.js +199 -0
  79. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +9 -0
  80. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts.map +1 -0
  81. package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +32 -0
  82. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +114 -0
  83. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -0
  84. package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +243 -0
  85. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +66 -57
  86. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +109 -1
  87. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  88. package/src/engine/physics/cloth/ecs/ClothInstance.js +479 -363
  89. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +95 -0
  90. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -0
  91. package/src/engine/physics/cloth/ecs/ClothRig.js +140 -0
  92. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +30 -1
  93. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  94. package/src/engine/physics/cloth/ecs/ClothSystem.js +1021 -773
  95. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +90 -0
  96. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -0
  97. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +374 -0
  98. package/src/engine/physics/cloth/ecs/cloth_dynamics_library.d.ts +32 -3
  99. package/src/engine/physics/cloth/ecs/cloth_dynamics_library.d.ts.map +1 -1
  100. package/src/engine/physics/cloth/ecs/cloth_dynamics_library.js +283 -254
  101. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +59 -0
  102. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -0
  103. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +328 -0
  104. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +13 -0
  105. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -0
  106. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +288 -0
  107. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +58 -0
  108. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -0
  109. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +199 -0
  110. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +8 -63
  111. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  112. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +317 -645
  113. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +61 -0
  114. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  115. package/src/engine/physics/cloth/ecs/cloth_write_back.js +212 -449
  116. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts +49 -0
  117. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -0
  118. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +115 -0
  119. package/src/engine/physics/cloth/playground/README.md +155 -1
  120. package/src/engine/physics/cloth/playground/collide.html +178 -0
  121. package/src/engine/physics/cloth/playground/collide_build.d.ts +95 -0
  122. package/src/engine/physics/cloth/playground/collide_build.d.ts.map +1 -0
  123. package/src/engine/physics/cloth/playground/collide_build.js +315 -0
  124. package/src/engine/physics/cloth/playground/collide_main.d.ts +2 -0
  125. package/src/engine/physics/cloth/playground/collide_main.d.ts.map +1 -0
  126. package/src/engine/physics/cloth/playground/collide_main.js +720 -0
  127. package/src/engine/physics/cloth/playground/garment.html +182 -0
  128. package/src/engine/physics/cloth/playground/garment_build.d.ts +78 -0
  129. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -0
  130. package/src/engine/physics/cloth/playground/garment_build.js +359 -0
  131. package/src/engine/physics/cloth/playground/garment_main.d.ts +2 -0
  132. package/src/engine/physics/cloth/playground/garment_main.d.ts.map +1 -0
  133. package/src/engine/physics/cloth/playground/garment_main.js +633 -0
  134. package/src/engine/physics/cloth/solver/ClothState.d.ts +208 -5
  135. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  136. package/src/engine/physics/cloth/solver/ClothState.js +302 -8
  137. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +87 -0
  138. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -0
  139. package/src/engine/physics/cloth/solver/cloth_contact_find.js +343 -0
  140. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +112 -0
  141. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -0
  142. package/src/engine/physics/cloth/solver/cloth_self_find.js +448 -0
  143. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts +4 -1
  144. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
  145. package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +16 -1
  146. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +112 -5
  147. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +117 -6
  149. package/src/engine/physics/cloth/solver/cloth_step.d.ts +40 -9
  150. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/solver/cloth_step.js +122 -10
  152. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +95 -0
  153. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -0
  154. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +285 -0
  155. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +129 -0
  156. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -0
  157. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +501 -0
  158. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +75 -0
  159. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -0
  160. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +202 -0
  161. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  162. package/src/shade/playground/vgeo_viewer/README.md +18 -0
  163. package/src/shade/playground/vgeo_viewer/main.js +87 -50
  164. package/src/shade/renderer/buffer/table/GPUDatabase.d.ts.map +1 -1
  165. package/src/shade/renderer/buffer/table/GPUDatabase.js +191 -62
  166. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts +94 -2
  167. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
  168. package/src/shade/renderer/buffer/table/GPUTypedTable.js +414 -2
  169. package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.d.ts +14 -0
  170. package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.d.ts.map +1 -0
  171. package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.js +13 -0
  172. package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.d.ts +17 -0
  173. package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.d.ts.map +1 -0
  174. package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.js +116 -0
  175. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +9 -4
  176. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  177. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +843 -734
  178. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +12 -0
  179. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
  180. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +13 -0
  181. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts +17 -0
  182. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts.map +1 -1
  183. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.js +185 -30
  184. package/src/shade/renderer/geometry/virtual/MICRON_COMPARISON_2026_08_20.md +17 -0
  185. package/src/shade/renderer/geometry/virtual/VGEO_FORMAT.md +141 -24
  186. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_DESIGN.md +204 -64
  187. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_PLAN.md +110 -10
  188. package/src/shade/renderer/geometry/virtual/VK_LOD_CLUSTERS_COMPARISON_2026_08_20.md +19 -0
  189. package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.d.ts +19 -6
  190. package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.d.ts.map +1 -1
  191. package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.js +26 -7
  192. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +173 -14
  193. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  194. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +458 -51
  195. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +49 -13
  196. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
  197. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +52 -14
  198. package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.d.ts +20 -0
  199. package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.d.ts.map +1 -0
  200. package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.js +19 -0
  201. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.d.ts +27 -0
  202. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.d.ts.map +1 -0
  203. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.js +48 -0
  204. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.d.ts +29 -0
  205. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.d.ts.map +1 -0
  206. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.js +60 -0
  207. package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.d.ts +8 -1
  208. package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.d.ts.map +1 -1
  209. package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.js +32 -2
  210. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.d.ts +258 -0
  211. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.d.ts.map +1 -0
  212. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.js +723 -0
  213. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.d.ts +49 -0
  214. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.d.ts.map +1 -0
  215. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.js +50 -0
  216. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  217. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  218. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts +3 -0
  219. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts.map +1 -1
  220. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.js +121 -21
  221. package/src/shade/renderer/texture/virtual/README.md +6 -4
  222. package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts.map +1 -1
  223. package/src/shade/renderer/texture/virtual/VirtualTextureManager.js +7 -0
  224. package/src/shade/renderer/texture/virtual/source/VTSourceTiled.d.ts +3 -3
  225. package/src/shade/renderer/texture/virtual/source/VTSourceTiled.js +3 -3
  226. package/src/engine/ecs/system/SystemExecutionPhase.d.ts +0 -9
  227. package/src/engine/ecs/system/SystemExecutionPhase.d.ts.map +0 -1
  228. package/src/engine/graphics/texture/virtual/NOTES.md +0 -128
  229. package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.d.ts +0 -6
  230. package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.d.ts.map +0 -1
  231. package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.js +0 -5
  232. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts +0 -49
  233. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts.map +0 -1
  234. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.js +0 -264
  235. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts +0 -44
  236. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts.map +0 -1
  237. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.js +0 -228
  238. package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.d.ts +0 -3
  239. package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.d.ts.map +0 -1
  240. package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.js +0 -73
  241. package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.d.ts +0 -14
  242. package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.d.ts.map +0 -1
  243. package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.js +0 -85
  244. package/src/engine/graphics/texture/virtual/debug/UsageDebugView.d.ts +0 -12
  245. package/src/engine/graphics/texture/virtual/debug/UsageDebugView.d.ts.map +0 -1
  246. package/src/engine/graphics/texture/virtual/debug/UsageDebugView.js +0 -63
  247. package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.d.ts +0 -12
  248. package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.d.ts.map +0 -1
  249. package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.js +0 -243
  250. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts +0 -30
  251. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts.map +0 -1
  252. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js +0 -39
  253. package/src/engine/graphics/texture/virtual/tile/compose_finger_print.d.ts +0 -9
  254. package/src/engine/graphics/texture/virtual/tile/compose_finger_print.d.ts.map +0 -1
  255. package/src/engine/graphics/texture/virtual/tile/compose_finger_print.js +0 -24
  256. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.d.ts +0 -9
  257. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.d.ts.map +0 -1
  258. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.js +0 -26
  259. package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.d.ts +0 -11
  260. package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.d.ts.map +0 -1
  261. package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.js +0 -12
  262. package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.d.ts +0 -7
  263. package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.d.ts.map +0 -1
  264. package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.js +0 -16
  265. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.d.ts +0 -7
  266. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.d.ts.map +0 -1
  267. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.js +0 -35
@@ -1,254 +1,283 @@
1
- import { ClothDynamics } from "./ClothDynamics.js";
2
- import { ClothDynamicsFlags } from "./ClothDynamicsFlags.js";
3
-
4
- /**
5
- * # The library — points in the parameter space that are known to be good
6
- *
7
- * Seven frozen {@link ClothDynamics} instances. Assign one directly and it is
8
- * shared, immutable and free; `.clone()` it and you own a copy to edit. They
9
- * are a set of points rather than a mechanism: nothing here is computed, and
10
- * nothing here is a preset system that has to be re-applied when a field
11
- * changes.
12
- *
13
- * ```js
14
- * rope_top.add(Cloth.from(CLOTH_ROPE));
15
- *
16
- * const wet = CLOTH_ROPE.clone();
17
- * wet.damping = 0.4;
18
- * ```
19
- *
20
- * ## Every entry is sized to the measured frame budget
21
- *
22
- * M0 measured the §17 workload — 1,024 particles at 2 substeps × 4 iterations —
23
- * at 3.48 ms against a 2 ms target and priced three levers that each closed it
24
- * on their own. **M1 changed that arithmetic**, because M1 added rows: a
25
- * strain-limit row per link, a tether per particle, and a slack row per
26
- * particle for any fabric that follows an animated pose. The same 1,024
27
- * particles at 2×4 now cost **4.61 ms**, and no single lever reaches 2 ms from
28
- * there — 1,024 at 2×2 is 2.38 ms and 484 at 2×4 is 2.53 ms, both still over.
29
- * Every garment entry below therefore spends **two** levers, and the numbers
30
- * are from `__fixtures__/cloth_library_bench.mjs`, which builds precisely the
31
- * row set `cloth_seed_subtree` builds and runs precisely the budgets this file
32
- * ships. `MEASUREMENTS.md` §10.
33
- *
34
- * The chains are two orders of magnitude cheaper and can afford the full
35
- * budget and more; the garments are where the levers are spent.
36
- *
37
- * ## What `stretch` and `bend` mean here, and where `stretch` stops meaning it
38
- *
39
- * `stretch` is the strain the fabric may carry, log-mapped: `1` is a chain at a
40
- * tenth of a per cent, `0` is a knit at a quarter of its length. `bend` is a
41
- * ratio of the row's own inertial scale and **saturates at 1** — a soft row
42
- * stiffer than the top of the dissipative band stops coming to rest at all, so
43
- * leather is at the ceiling rather than above it. `cloth_dynamics_map.js`
44
- * carries both derivations.
45
- *
46
- * `stretch` is also the weakest field in the set, and the entries say so by
47
- * which of them set `ClothDynamicsFlags.StrainLimit`. Measured on a 24-link
48
- * rope dropped through ninety degrees, the strain-limit row removes about a
49
- * third of the peak over-stretch at every budget and **never reaches its own
50
- * allowance** — at `stretch = 1` it asks for 0.1% and delivers 5.9% at 1×1,
51
- * 2.2% at 2×2 and 0.9% at 2×4. It is a second hard row on an edge that already
52
- * has one, so it competes for the same trust region and the same penalty band
53
- * as the row it is backing up. That makes it worth its 13–15% of a garment
54
- * frame where the residual is visible — a low iteration count — and not worth
55
- * it where the residual is already around one per cent. The entries at 2×4
56
- * clear the flag; the ones at 2×2, and the chains where it is free, keep it.
57
- *
58
- * @author Alex Goldring
59
- * @copyright Company Named Limited (c) 2026
60
- */
61
-
62
- /**
63
- * Silk, chiffon, a light banner. Barely resists folding, extends almost not at
64
- * all, and follows the animation loosely enough to flow.
65
- *
66
- * *Budget:* **400 particles at 2×4 — 1.49 ms.** Two levers: fewer particles,
67
- * and no strain-limit row. A silk garment is the one that most wants substeps
68
- * and iterations, so it keeps both and pays for them everywhere else; at 2×4
69
- * the fabric row is inside 1.4% of strain unaided and the strain-limit row
70
- * would buy half a per cent of that for 15% of the frame.
71
- * @type {Readonly<ClothDynamics>}
72
- */
73
- export const CLOTH_SILK = Object.freeze(ClothDynamics.from({
74
- stretch: 0.85,
75
- bend: 0.04,
76
- damping: 0.06,
77
- slack: 0.75,
78
- thickness: 0.004,
79
- inertia: 1,
80
- drag: 0.45,
81
- substeps: 2,
82
- iterations: 4,
83
- flags: ClothDynamicsFlags.None
84
- }));
85
-
86
- /**
87
- * Cotton, linen, a shirt. The default fabric, and the one every other entry is
88
- * a deviation from.
89
- *
90
- * *Budget:* **400 particles at 2×4 — 1.49 ms.** Fewer particles, and no
91
- * strain-limit row, for the same reason silk drops it.
92
- * @type {Readonly<ClothDynamics>}
93
- */
94
- export const CLOTH_COTTON = Object.freeze(ClothDynamics.from({
95
- stretch: 0.8,
96
- bend: 0.25,
97
- damping: 0.12,
98
- slack: 0.6,
99
- thickness: 0.008,
100
- inertia: 1,
101
- drag: 0.2,
102
- substeps: 2,
103
- iterations: 4,
104
- flags: ClothDynamicsFlags.None
105
- }));
106
-
107
- /**
108
- * Denim, canvas, a heavy coat. Stiff, quiet, and inclined to hold a fold.
109
- *
110
- * *Budget:* **576 particles at 2×2 — 1.28 ms.** Two levers: half the
111
- * iterations, and fewer particles. A heavy garment is large, so it spends more
112
- * of its allowance on particles than silk does and takes it back from the
113
- * iteration count; §5.1's whole claim is that a lower iteration count converges
114
- * less far towards the *same* answer rather than towards a different one, and a
115
- * stiff fabric is where that is least visible. It keeps the strain-limit row,
116
- * because at 2×2 the residual is 3.5% and the row takes a third of it.
117
- * @type {Readonly<ClothDynamics>}
118
- */
119
- export const CLOTH_DENIM = Object.freeze(ClothDynamics.from({
120
- stretch: 0.93,
121
- bend: 0.62,
122
- damping: 0.25,
123
- slack: 0.4,
124
- thickness: 0.014,
125
- inertia: 1,
126
- drag: 0.08,
127
- substeps: 2,
128
- iterations: 2
129
- }));
130
-
131
- /**
132
- * Leather, oilcloth, armour skirting. The stiffest fabric this solver can hold
133
- * and still come to rest — `bend` is at the ceiling of the dissipative band,
134
- * not merely high.
135
- *
136
- * *Budget:* **576 particles at 2×2 — 1.28 ms**, as denim, and for the same
137
- * reasons.
138
- * @type {Readonly<ClothDynamics>}
139
- */
140
- export const CLOTH_LEATHER = Object.freeze(ClothDynamics.from({
141
- stretch: 0.97,
142
- bend: 1,
143
- damping: 0.35,
144
- slack: 0.3,
145
- thickness: 0.02,
146
- inertia: 1,
147
- drag: 0.05,
148
- substeps: 2,
149
- iterations: 2
150
- }));
151
-
152
- /**
153
- * Rope, cable, a mooring line. No meaningful animated pose to follow — a rope
154
- * hangs where physics puts it — so `slack` is at 1, which by the derivation in
155
- * `cloth_seed_subtree.js` means the leash row is provably inactive and is not
156
- * built at all. The tether carries the inextensibility on its own.
157
- *
158
- * *Budget:* **40 links at the full 2×4 — 0.04 ms.** No lever at all: a chain
159
- * wants more of both than a sheet does and can simply afford it, because the
160
- * cost is close to linear in particles and a rope has two orders fewer. The
161
- * strain-limit row is free at this size and `stretch` is a rope's most
162
- * characteristic property, so it stays.
163
- * @type {Readonly<ClothDynamics>}
164
- */
165
- export const CLOTH_ROPE = Object.freeze(ClothDynamics.from({
166
- stretch: 0.98,
167
- bend: 0.06,
168
- damping: 0.1,
169
- slack: 1,
170
- thickness: 0.015,
171
- inertia: 1,
172
- drag: 0.12,
173
- substeps: 2,
174
- iterations: 4
175
- }));
176
-
177
- /**
178
- * Chain, beads, a pull cord — links that barely extend and barely bend, but do
179
- * not flow the way a rope does.
180
- *
181
- * *Budget:* **40 links at 2×6 — 0.06 ms.** Depth is how far a constraint force
182
- * travels in one sweep, and a chain is the deepest thing this system simulates,
183
- * so this is the one entry that spends *more* than the nominal budget rather
184
- * than less. It can: at forty particles the whole step is a rounding error
185
- * against the frame.
186
- * @type {Readonly<ClothDynamics>}
187
- */
188
- export const CLOTH_CHAIN = Object.freeze(ClothDynamics.from({
189
- stretch: 1,
190
- bend: 0.15,
191
- damping: 0.2,
192
- slack: 1,
193
- thickness: 0.012,
194
- inertia: 1,
195
- drag: 0.05,
196
- substeps: 2,
197
- iterations: 6
198
- }));
199
-
200
- /**
201
- * Hair, a ponytail, a horse's tail. Many shallow strands rather than one deep
202
- * one, which is why it is the only entry that asks for self-collision: strands
203
- * that pass through each other read as wrong in a way a single chain never
204
- * does.
205
- *
206
- * *Budget:* **400 particles across all strands at 2×4 — 1.49 ms**, the same
207
- * two levers silk takes. `ClothDynamicsFlags.SelfCollision` is a claim about
208
- * the fabric that M4 will have to re-price when it can honour it, and it is
209
- * the reason this entry has the least headroom in the library.
210
- * @type {Readonly<ClothDynamics>}
211
- */
212
- export const CLOTH_HAIR = Object.freeze(ClothDynamics.from({
213
- stretch: 0.95,
214
- bend: 0.2,
215
- damping: 0.18,
216
- slack: 0.55,
217
- thickness: 0.006,
218
- inertia: 1,
219
- drag: 0.3,
220
- substeps: 2,
221
- iterations: 4,
222
- flags: ClothDynamicsFlags.SelfCollision
223
- }));
224
-
225
- /**
226
- * Every entry, in one frozen array — for a tool that wants to show them all,
227
- * and for the spec that holds the whole library to the value semantics and the
228
- * budget.
229
- * @type {ReadonlyArray<Readonly<ClothDynamics>>}
230
- */
231
- export const CLOTH_DYNAMICS_LIBRARY = Object.freeze([
232
- CLOTH_SILK,
233
- CLOTH_COTTON,
234
- CLOTH_DENIM,
235
- CLOTH_LEATHER,
236
- CLOTH_ROPE,
237
- CLOTH_CHAIN,
238
- CLOTH_HAIR
239
- ]);
240
-
241
- /**
242
- * The library entries by name, for a tool, a serialiser or a playground that
243
- * has a string and wants the entry.
244
- * @type {Readonly<Object<string, Readonly<ClothDynamics>>>}
245
- */
246
- export const CLOTH_DYNAMICS_BY_NAME = Object.freeze({
247
- SILK: CLOTH_SILK,
248
- COTTON: CLOTH_COTTON,
249
- DENIM: CLOTH_DENIM,
250
- LEATHER: CLOTH_LEATHER,
251
- ROPE: CLOTH_ROPE,
252
- CHAIN: CLOTH_CHAIN,
253
- HAIR: CLOTH_HAIR
254
- });
1
+ import { ClothDynamics } from "./ClothDynamics.js";
2
+ import { ClothDynamicsFlags } from "./ClothDynamicsFlags.js";
3
+
4
+ /**
5
+ * # The library — points in the parameter space that are known to be good
6
+ *
7
+ * Seven frozen {@link ClothDynamics} instances. Assign one directly and it is
8
+ * shared, immutable and free; `.clone()` it and you own a copy to edit. They
9
+ * are a set of points rather than a mechanism: nothing here is computed, and
10
+ * nothing here is a preset system that has to be re-applied when a field
11
+ * changes.
12
+ *
13
+ * ```js
14
+ * rope_top.add(Cloth.from(CLOTH_ROPE));
15
+ *
16
+ * const wet = CLOTH_ROPE.clone();
17
+ * wet.damping = 0.4;
18
+ * ```
19
+ *
20
+ * ## Every entry is sized to the measured frame budget
21
+ *
22
+ * M0 measured the §17 workload — 1,024 particles at 2 substeps × 4 iterations —
23
+ * at 3.48 ms against a 2 ms target and priced three levers that each closed it
24
+ * on their own. **M1 changed that arithmetic**, because M1 added rows: a
25
+ * strain-limit row per link, a tether per particle, and a slack row per
26
+ * particle for any fabric that follows an animated pose. The same 1,024
27
+ * particles at 2×4 now cost **4.61 ms**, and no single lever reaches 2 ms from
28
+ * there — 1,024 at 2×2 is 2.38 ms and 484 at 2×4 is 2.53 ms, both still over.
29
+ * Every garment entry below therefore spends **two** levers, and the numbers
30
+ * are from `__fixtures__/cloth_library_bench.mjs`, which builds precisely the
31
+ * row set `cloth_seed_subtree` builds and runs precisely the budgets this file
32
+ * ships. `MEASUREMENTS.md` §10.
33
+ *
34
+ * The chains are two orders of magnitude cheaper and can afford the full
35
+ * budget and more; the garments are where the levers are spent.
36
+ *
37
+ * ## What `stretch` and `bend` mean here, and where `stretch` stops meaning it
38
+ *
39
+ * `stretch` is the strain the fabric may carry, log-mapped: `1` is a chain at a
40
+ * tenth of a per cent, `0` is a knit at a quarter of its length. `bend` is a
41
+ * ratio of the row's own inertial scale and **saturates at 1** — a soft row
42
+ * stiffer than the top of the dissipative band stops coming to rest at all, so
43
+ * leather is at the ceiling rather than above it. `cloth_dynamics_map.js`
44
+ * carries both derivations.
45
+ *
46
+ * ## Which entries collide with themselves, and why the list moved
47
+ *
48
+ * §9 said the flag belongs on "skirts, long coats, hair" — a list of what the
49
+ * garment *is*. **M4 measured that what decides is `bend`.** On a folding sheet
50
+ * at each entry's own bending: silk, hair and cotton pass through themselves 8
51
+ * to 11 times a sample unaided and the row removes 71% to 81% of it; denim
52
+ * tangles a third as much; leather does not tangle at all — 0.18 crossings a
53
+ * sample — and the row makes it marginally worse, because the handful of pairs
54
+ * it finds on a fabric that will not fold are noise it is adding.
55
+ *
56
+ * So `CLOTH_SILK`, `CLOTH_COTTON` and `CLOTH_HAIR` set it and nothing else
57
+ * does. It costs each of them about a fifth of their frame and all three stay
58
+ * inside 2 ms. The chains have no surface to pass through and a coiling rope is
59
+ * a case that measurement does not cover. `MEASUREMENTS.md` §33.
60
+ *
61
+ * `stretch` is also the weakest field in the set, and the entries say so by
62
+ * which of them set `ClothDynamicsFlags.StrainLimit`. Measured on a 24-link
63
+ * rope dropped through ninety degrees, the strain-limit row removes about a
64
+ * third of the peak over-stretch at every budget and **never reaches its own
65
+ * allowance** — at `stretch = 1` it asks for 0.1% and delivers 5.9% at 1×1,
66
+ * 2.2% at 2×2 and 0.9% at 2×4. It is a second hard row on an edge that already
67
+ * has one, so it competes for the same trust region and the same penalty band
68
+ * as the row it is backing up. That makes it worth its 13–15% of a garment
69
+ * frame where the residual is visible — a low iteration count — and not worth
70
+ * it where the residual is already around one per cent. The entries at 2×4
71
+ * clear the flag; the ones at 2×2, and the chains where it is free, keep it.
72
+ *
73
+ * @author Alex Goldring
74
+ * @copyright Company Named Limited (c) 2026
75
+ */
76
+
77
+ /**
78
+ * Silk, chiffon, a light banner. Barely resists folding, extends almost not at
79
+ * all, and follows the animation loosely enough to flow.
80
+ *
81
+ * *Budget:* **400 particles at 2×4 — 1.49 ms.** Two levers: fewer particles,
82
+ * and no strain-limit row. A silk garment is the one that most wants substeps
83
+ * and iterations, so it keeps both and pays for them everywhere else; at 2×4
84
+ * the fabric row is inside 1.4% of strain unaided and the strain-limit row
85
+ * would buy half a per cent of that for 15% of the frame.
86
+ *
87
+ * *Self-collision:* **on, and it is the third lever's worth.** 1.46 ms to
88
+ * 1.78 ms, +22%, still inside. Silk is the floppiest fabric in the set and a
89
+ * folding sheet of it passes through itself 8 times a sample without the row;
90
+ * with it, 2.4. `MEASUREMENTS.md` §33.
91
+ * @type {Readonly<ClothDynamics>}
92
+ */
93
+ export const CLOTH_SILK = Object.freeze(ClothDynamics.from({
94
+ stretch: 0.85,
95
+ bend: 0.04,
96
+ damping: 0.06,
97
+ slack: 0.75,
98
+ thickness: 0.004,
99
+ inertia: 1,
100
+ drag: 0.45,
101
+ substeps: 2,
102
+ iterations: 4,
103
+ flags: ClothDynamicsFlags.SelfCollision
104
+ }));
105
+
106
+ /**
107
+ * Cotton, linen, a shirt. The default fabric, and the one every other entry is
108
+ * a deviation from.
109
+ *
110
+ * *Budget:* **400 particles at 2×4 — 1.49 ms.** Fewer particles, and no
111
+ * strain-limit row, for the same reason silk drops it.
112
+ *
113
+ * *Self-collision:* **on.** 1.51 ms to 1.82 ms, +21%, still inside. This is
114
+ * the entry every other one is a deviation from, and a default that passes
115
+ * through itself nine times a sample while it moves is a bad default.
116
+ * `MEASUREMENTS.md` §33.
117
+ * @type {Readonly<ClothDynamics>}
118
+ */
119
+ export const CLOTH_COTTON = Object.freeze(ClothDynamics.from({
120
+ stretch: 0.8,
121
+ bend: 0.25,
122
+ damping: 0.12,
123
+ slack: 0.6,
124
+ thickness: 0.008,
125
+ inertia: 1,
126
+ drag: 0.2,
127
+ substeps: 2,
128
+ iterations: 4,
129
+ flags: ClothDynamicsFlags.SelfCollision
130
+ }));
131
+
132
+ /**
133
+ * Denim, canvas, a heavy coat. Stiff, quiet, and inclined to hold a fold.
134
+ *
135
+ * *Budget:* **576 particles at 2×2 — 1.28 ms.** Two levers: half the
136
+ * iterations, and fewer particles. A heavy garment is large, so it spends more
137
+ * of its allowance on particles than silk does and takes it back from the
138
+ * iteration count; §5.1's whole claim is that a lower iteration count converges
139
+ * less far towards the *same* answer rather than towards a different one, and a
140
+ * stiff fabric is where that is least visible. It keeps the strain-limit row,
141
+ * because at 2×2 the residual is 3.5% and the row takes a third of it.
142
+ * @type {Readonly<ClothDynamics>}
143
+ */
144
+ export const CLOTH_DENIM = Object.freeze(ClothDynamics.from({
145
+ stretch: 0.93,
146
+ bend: 0.62,
147
+ damping: 0.25,
148
+ slack: 0.4,
149
+ thickness: 0.014,
150
+ inertia: 1,
151
+ drag: 0.08,
152
+ substeps: 2,
153
+ iterations: 2
154
+ }));
155
+
156
+ /**
157
+ * Leather, oilcloth, armour skirting. The stiffest fabric this solver can hold
158
+ * and still come to rest — `bend` is at the ceiling of the dissipative band,
159
+ * not merely high.
160
+ *
161
+ * *Budget:* **576 particles at 2×2 — 1.28 ms**, as denim, and for the same
162
+ * reasons.
163
+ * @type {Readonly<ClothDynamics>}
164
+ */
165
+ export const CLOTH_LEATHER = Object.freeze(ClothDynamics.from({
166
+ stretch: 0.97,
167
+ bend: 1,
168
+ damping: 0.35,
169
+ slack: 0.3,
170
+ thickness: 0.02,
171
+ inertia: 1,
172
+ drag: 0.05,
173
+ substeps: 2,
174
+ iterations: 2
175
+ }));
176
+
177
+ /**
178
+ * Rope, cable, a mooring line. No meaningful animated pose to follow — a rope
179
+ * hangs where physics puts it — so `slack` is at 1, which by the derivation in
180
+ * `cloth_seed_subtree.js` means the leash row is provably inactive and is not
181
+ * built at all. The tether carries the inextensibility on its own.
182
+ *
183
+ * *Budget:* **40 links at the full 2×4 — 0.04 ms.** No lever at all: a chain
184
+ * wants more of both than a sheet does and can simply afford it, because the
185
+ * cost is close to linear in particles and a rope has two orders fewer. The
186
+ * strain-limit row is free at this size and `stretch` is a rope's most
187
+ * characteristic property, so it stays.
188
+ * @type {Readonly<ClothDynamics>}
189
+ */
190
+ export const CLOTH_ROPE = Object.freeze(ClothDynamics.from({
191
+ stretch: 0.98,
192
+ bend: 0.06,
193
+ damping: 0.1,
194
+ slack: 1,
195
+ thickness: 0.015,
196
+ inertia: 1,
197
+ drag: 0.12,
198
+ substeps: 2,
199
+ iterations: 4
200
+ }));
201
+
202
+ /**
203
+ * Chain, beads, a pull cord — links that barely extend and barely bend, but do
204
+ * not flow the way a rope does.
205
+ *
206
+ * *Budget:* **40 links at 2×6 — 0.06 ms.** Depth is how far a constraint force
207
+ * travels in one sweep, and a chain is the deepest thing this system simulates,
208
+ * so this is the one entry that spends *more* than the nominal budget rather
209
+ * than less. It can: at forty particles the whole step is a rounding error
210
+ * against the frame.
211
+ * @type {Readonly<ClothDynamics>}
212
+ */
213
+ export const CLOTH_CHAIN = Object.freeze(ClothDynamics.from({
214
+ stretch: 1,
215
+ bend: 0.15,
216
+ damping: 0.2,
217
+ slack: 1,
218
+ thickness: 0.012,
219
+ inertia: 1,
220
+ drag: 0.05,
221
+ substeps: 2,
222
+ iterations: 6
223
+ }));
224
+
225
+ /**
226
+ * Hair, a ponytail, a horse's tail. Many shallow strands rather than one deep
227
+ * one, which is why it is the only entry that asks for self-collision: strands
228
+ * that pass through each other read as wrong in a way a single chain never
229
+ * does.
230
+ *
231
+ * *Budget:* **400 particles across all strands at 2×4 — 1.49 ms**, the same
232
+ * two levers silk takes.
233
+ *
234
+ * *Self-collision:* **on, and M4 priced it.** 1.53 ms to 1.81 ms, +19%, still
235
+ * inside. This was the only entry that set the flag before there was anything
236
+ * to honour it, and the measurement agrees with the claim: hair passes through
237
+ * itself 10.6 times a sample unaided, the most of any entry, and the row
238
+ * removes 81% of that. `MEASUREMENTS.md` §33.
239
+ * @type {Readonly<ClothDynamics>}
240
+ */
241
+ export const CLOTH_HAIR = Object.freeze(ClothDynamics.from({
242
+ stretch: 0.95,
243
+ bend: 0.2,
244
+ damping: 0.18,
245
+ slack: 0.55,
246
+ thickness: 0.006,
247
+ inertia: 1,
248
+ drag: 0.3,
249
+ substeps: 2,
250
+ iterations: 4,
251
+ flags: ClothDynamicsFlags.SelfCollision
252
+ }));
253
+
254
+ /**
255
+ * Every entry, in one frozen array — for a tool that wants to show them all,
256
+ * and for the spec that holds the whole library to the value semantics and the
257
+ * budget.
258
+ * @type {ReadonlyArray<Readonly<ClothDynamics>>}
259
+ */
260
+ export const CLOTH_DYNAMICS_LIBRARY = Object.freeze([
261
+ CLOTH_SILK,
262
+ CLOTH_COTTON,
263
+ CLOTH_DENIM,
264
+ CLOTH_LEATHER,
265
+ CLOTH_ROPE,
266
+ CLOTH_CHAIN,
267
+ CLOTH_HAIR
268
+ ]);
269
+
270
+ /**
271
+ * The library entries by name, for a tool, a serialiser or a playground that
272
+ * has a string and wants the entry.
273
+ * @type {Readonly<Object<string, Readonly<ClothDynamics>>>}
274
+ */
275
+ export const CLOTH_DYNAMICS_BY_NAME = Object.freeze({
276
+ SILK: CLOTH_SILK,
277
+ COTTON: CLOTH_COTTON,
278
+ DENIM: CLOTH_DENIM,
279
+ LEATHER: CLOTH_LEATHER,
280
+ ROPE: CLOTH_ROPE,
281
+ CHAIN: CLOTH_CHAIN,
282
+ HAIR: CLOTH_HAIR
283
+ });
@@ -0,0 +1,59 @@
1
+ /**
2
+ * # Bringing the world's colliders into a cloth's frame
3
+ *
4
+ * The index holds every live cloth collider in **world** coordinates; the
5
+ * solver works in the cloth's own **local** frame (§12 — garment-sized
6
+ * coordinates are what makes `Float32` particle state ample, and the local
7
+ * frame is what makes §7 P7's inertia model natural). So once per cloth per
8
+ * step, the colliders that could touch it are queried out of the index and
9
+ * rewritten into its frame.
10
+ *
11
+ * ## Both poses go into the *current* anchor frame
12
+ *
13
+ * A record carries where the collider was and where it is. Both are converted
14
+ * using the anchor's pose **now**, not each with the anchor pose of its own
15
+ * step, so what the sweep interpolates is the collider's motion *relative to
16
+ * the cloth's frame*. That is the motion the particles actually see: the frame
17
+ * change has already been applied to them by `move_local_frame`, scaled by
18
+ * `ClothDynamics#inertia`, before the step begins.
19
+ *
20
+ * The alternative — converting each pose in its own frame — would make a
21
+ * collider appear to move whenever the anchor did, so a character running past
22
+ * a static wall would sweep the wall through their own cape.
23
+ *
24
+ * ## The query box
25
+ *
26
+ * The cloth's own particle bounds, fattened by how far a contact reaches, and
27
+ * then by how far the solver will let a particle travel in one step. The second
28
+ * term is what stops a fast cloth outrunning its own broadphase within the step
29
+ * it was gathered for; it is the velocity clamp of §7 P1 read as a distance,
30
+ * which is the quantity it was built out of.
31
+ *
32
+ * @author Alex Goldring
33
+ * @copyright Company Named Limited (c) 2026
34
+ */
35
+ /**
36
+ * Query the index and rewrite the overlapping colliders into the cloth's frame.
37
+ *
38
+ * @param {ClothInstance} instance filled in place — `collider_table`,
39
+ * `collider_key` and `collider_count`
40
+ * @param {ClothColliderIndex} index
41
+ * @param {number} reach how far a particle may travel this step, metres
42
+ * @returns {number} how many colliders were gathered
43
+ */
44
+ export function cloth_gather_colliders(instance: ClothInstance, index: ClothColliderIndex, reach: number): number;
45
+ /**
46
+ * Whether any collider overlapping this cloth moved between the previous step
47
+ * and this one — §7 P5's "wake on collider motion", asked without waking.
48
+ *
49
+ * A sleeping cloth is not stepped and not written back, so something has to
50
+ * notice when the world it was resting against moves. This is that something,
51
+ * and it is a broadphase query plus a pose comparison: cheaper than a step by
52
+ * three orders of magnitude, which is what makes sleep worth having at all.
53
+ *
54
+ * @param {ClothInstance} instance
55
+ * @param {ClothColliderIndex} index
56
+ * @returns {boolean}
57
+ */
58
+ export function cloth_colliders_moved(instance: ClothInstance, index: ClothColliderIndex): boolean;
59
+ //# sourceMappingURL=cloth_gather_colliders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloth_gather_colliders.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/cloth_gather_colliders.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;GAQG;AACH,kGAHW,MAAM,GACJ,MAAM,CAsJlB;AAgDD;;;;;;;;;;;;GAYG;AACH,2FAFa,OAAO,CAsBnB"}