@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
@@ -0,0 +1,285 @@
1
+ import {
2
+ CVA_F_X,
3
+ CVA_F_Y,
4
+ CVA_F_Z,
5
+ CVA_H_XX,
6
+ CVA_H_XY,
7
+ CVA_H_XZ,
8
+ CVA_H_YY,
9
+ CVA_H_YZ,
10
+ CVA_H_ZZ
11
+ } from "../cloth_vertex_accumulator.js";
12
+
13
+ /**
14
+ * # Backstop — the half-space row
15
+ *
16
+ * C(x) = r_b − (x_i − b_i)·n_i
17
+ * ∂C/∂x_i = −n_i
18
+ *
19
+ * §6's row, verbatim: a particle is held at least `r_b` along its own normal
20
+ * from a point `b` just inside the body. `[0, +∞)` admits only forces that
21
+ * *reduce* `C`, which for this `C` means increasing `(x − b)·n` — pushing the
22
+ * particle out along its normal, which is what "never inside the body" means.
23
+ *
24
+ * ## What it is for, and why it is not a collider
25
+ *
26
+ * A cape's collider set approximates a torso with a handful of capsules, and
27
+ * between them is a gap the cloth can settle into. A backstop closes that gap
28
+ * without adding geometry: the plane is anchored to the particle's own
29
+ * *animated* position and its own surface normal, both of which the garment
30
+ * already knows, so it is a bound the mesh carries with it rather than a shape
31
+ * somebody has to author. Chaos Cloth ships the same thing under the same name
32
+ * and for the same reason (§15), and §7 P3 leans on it as one of the three
33
+ * layers that stop a garment tunnelling through a character.
34
+ *
35
+ * It is deliberately **not** a substitute for collision. A backstop is a plane
36
+ * per particle: it knows which way is out and nothing about what is actually
37
+ * there, so it cannot resolve a limb crossing the garment. The two rows answer
38
+ * different halves and a cape wants both.
39
+ *
40
+ * ## Where the plane comes from
41
+ *
42
+ * The caller writes it, per step, into {@link ClothState#backstop_plane} — the
43
+ * same contract {@link ClothState#leash_target} carries, and for the same
44
+ * reason: `b` and `n` are anchored to the animated pose, which moves, and are
45
+ * not properties of the rest shape.
46
+ *
47
+ * **M2 builds the row and does not author it.** The natural source is the
48
+ * garment's own skinned surface — `b` a short way inside along the vertex
49
+ * normal, `r_b` that distance again — and a skinned garment is M3. M2's entity
50
+ * path has a chain rather than a surface, so it has no normal to offer: a rope
51
+ * has no inside. So the row ships with storage, a spec and a playground demo
52
+ * driving it directly, and `cloth_proxy_build` is what will fill it.
53
+ *
54
+ * ## No trust region, and no geometric stiffness
55
+ *
56
+ * `C` is **linear** in `x`, so its second derivative is exactly zero — there is
57
+ * no geometric term to keep or drop — and its gradient is a constant unit
58
+ * vector, so there is no distance beyond which the linearisation stops
59
+ * describing it. A backstop is the one row in the system whose model is not a
60
+ * model.
61
+ *
62
+ * @author Alex Goldring
63
+ * @copyright Company Named Limited (c) 2026
64
+ */
65
+
66
+ /**
67
+ * Evaluate one backstop row's constraint value and its gradient.
68
+ *
69
+ * The definition the accumulation below inlines, and the one the
70
+ * finite-difference spec checks — there is no second copy of the arithmetic.
71
+ *
72
+ * @param {Float64Array|number[]} gradient out, `∂C/∂x`
73
+ * @param {number} gradient_offset
74
+ * @param {ClothState} state
75
+ * @param {number} row
76
+ * @returns {number} `C`
77
+ */
78
+ export function cloth_backstop_evaluate(gradient, gradient_offset, state, row) {
79
+ const self = state.backstop_particle[row] * 3;
80
+
81
+ const plane = state.backstop_plane;
82
+ const position = state.position;
83
+
84
+ const p = row * 6;
85
+
86
+ const nx = plane[p + 3];
87
+ const ny = plane[p + 4];
88
+ const nz = plane[p + 5];
89
+
90
+ gradient[gradient_offset] = -nx;
91
+ gradient[gradient_offset + 1] = -ny;
92
+ gradient[gradient_offset + 2] = -nz;
93
+
94
+ const along = (position[self] - plane[p]) * nx
95
+ + (position[self + 1] - plane[p + 1]) * ny
96
+ + (position[self + 2] - plane[p + 2]) * nz;
97
+
98
+ return state.backstop_radius[row] - along;
99
+ }
100
+
101
+ /**
102
+ * Add every backstop row touching `particle` into the vertex accumulator.
103
+ *
104
+ * @param {Float64Array} accumulator
105
+ * @param {ClothState} state
106
+ * @param {number} particle
107
+ */
108
+ export function cloth_backstop_accumulate(accumulator, state, particle) {
109
+ const offset = state.backstop_adjacency_offset;
110
+
111
+ const start = offset[particle];
112
+ const end = offset[particle + 1];
113
+
114
+ if (start === end) {
115
+ return;
116
+ }
117
+
118
+ const adjacency = state.backstop_adjacency;
119
+ const plane = state.backstop_plane;
120
+ const radius = state.backstop_radius;
121
+ const lambda = state.backstop_lambda;
122
+ const penalty = state.backstop_penalty;
123
+ const position = state.position;
124
+
125
+ const self = particle * 3;
126
+
127
+ const x = position[self];
128
+ const y = position[self + 1];
129
+ const z = position[self + 2];
130
+
131
+ let f_x = accumulator[CVA_F_X];
132
+ let f_y = accumulator[CVA_F_Y];
133
+ let f_z = accumulator[CVA_F_Z];
134
+
135
+ let h_xx = accumulator[CVA_H_XX];
136
+ let h_yy = accumulator[CVA_H_YY];
137
+ let h_zz = accumulator[CVA_H_ZZ];
138
+ let h_xy = accumulator[CVA_H_XY];
139
+ let h_xz = accumulator[CVA_H_XZ];
140
+ let h_yz = accumulator[CVA_H_YZ];
141
+
142
+ for (let i = start; i < end; i++) {
143
+ const row = adjacency[i];
144
+
145
+ const p = row * 6;
146
+
147
+ const nx = plane[p + 3];
148
+ const ny = plane[p + 4];
149
+ const nz = plane[p + 5];
150
+
151
+ const along = (x - plane[p]) * nx + (y - plane[p + 1]) * ny + (z - plane[p + 2]) * nz;
152
+
153
+ const k = penalty[row];
154
+
155
+ const force = k * (radius[row] - along) + lambda[row];
156
+
157
+ if (force <= 0) {
158
+ continue;
159
+ }
160
+
161
+ // `g = −n`, so `f -= fc·g` is `f += fc·n`.
162
+ f_x += force * nx;
163
+ f_y += force * ny;
164
+ f_z += force * nz;
165
+
166
+ h_xx += k * nx * nx;
167
+ h_yy += k * ny * ny;
168
+ h_zz += k * nz * nz;
169
+ h_xy += k * nx * ny;
170
+ h_xz += k * nx * nz;
171
+ h_yz += k * ny * nz;
172
+ }
173
+
174
+ accumulator[CVA_F_X] = f_x;
175
+ accumulator[CVA_F_Y] = f_y;
176
+ accumulator[CVA_F_Z] = f_z;
177
+
178
+ accumulator[CVA_H_XX] = h_xx;
179
+ accumulator[CVA_H_YY] = h_yy;
180
+ accumulator[CVA_H_ZZ] = h_zz;
181
+ accumulator[CVA_H_XY] = h_xy;
182
+ accumulator[CVA_H_XZ] = h_xz;
183
+ accumulator[CVA_H_YZ] = h_yz;
184
+ }
185
+
186
+ /**
187
+ * Warm start every backstop row for a substep. Every one is hard, so — as with
188
+ * the leash table — there is no soft branch.
189
+ *
190
+ * @param {ClothState} state
191
+ * @param {number} alpha
192
+ * @param {number} gamma
193
+ * @param {number} k_min_ratio
194
+ * @param {number} k_max_ratio
195
+ * @param {number} inverse_h_squared
196
+ */
197
+ export function cloth_backstop_warm_start(state, alpha, gamma, k_min_ratio, k_max_ratio, inverse_h_squared) {
198
+ const count = state.backstop_count;
199
+
200
+ const row_particle = state.backstop_particle;
201
+ const mass_inverse = state.mass_inverse;
202
+ const lambda = state.backstop_lambda;
203
+ const penalty = state.backstop_penalty;
204
+
205
+ const decay = alpha * gamma;
206
+
207
+ for (let row = 0; row < count; row++) {
208
+ const compliance = mass_inverse[row_particle[row]];
209
+
210
+ if (compliance === 0) {
211
+ penalty[row] = 0;
212
+ lambda[row] = 0;
213
+
214
+ continue;
215
+ }
216
+
217
+ const scale = inverse_h_squared / compliance;
218
+
219
+ const lo = k_min_ratio * scale;
220
+ const hi = k_max_ratio * scale;
221
+
222
+ lambda[row] *= decay;
223
+
224
+ let k = penalty[row] * gamma;
225
+
226
+ if (k < lo) {
227
+ k = lo;
228
+ } else if (k > hi) {
229
+ k = hi;
230
+ }
231
+
232
+ penalty[row] = k;
233
+ }
234
+ }
235
+
236
+ /**
237
+ * Dual update for every backstop row.
238
+ *
239
+ * @param {ClothState} state
240
+ * @param {number} beta
241
+ * @param {number} k_max_ratio
242
+ * @param {number} inverse_h_squared
243
+ */
244
+ export function cloth_backstop_dual_update(state, beta, k_max_ratio, inverse_h_squared) {
245
+ const count = state.backstop_count;
246
+
247
+ const row_particle = state.backstop_particle;
248
+ const mass_inverse = state.mass_inverse;
249
+ const position = state.position;
250
+ const plane = state.backstop_plane;
251
+ const radius = state.backstop_radius;
252
+ const lambda = state.backstop_lambda;
253
+ const penalty = state.backstop_penalty;
254
+
255
+ for (let row = 0; row < count; row++) {
256
+ const particle = row_particle[row];
257
+
258
+ const compliance = mass_inverse[particle];
259
+
260
+ if (compliance === 0) {
261
+ continue;
262
+ }
263
+
264
+ const k_max = k_max_ratio * inverse_h_squared / compliance;
265
+
266
+ const self = particle * 3;
267
+ const p = row * 6;
268
+
269
+ const along = (position[self] - plane[p]) * plane[p + 3]
270
+ + (position[self + 1] - plane[p + 1]) * plane[p + 4]
271
+ + (position[self + 2] - plane[p + 2]) * plane[p + 5];
272
+
273
+ const c = radius[row] - along;
274
+
275
+ const k = penalty[row];
276
+
277
+ const next = k * c + lambda[row];
278
+
279
+ lambda[row] = next > 0 ? next : 0;
280
+
281
+ const ramped = k + beta * Math.abs(c);
282
+
283
+ penalty[row] = ramped < k_max ? ramped : k_max;
284
+ }
285
+ }
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Add every contact touching `particle` into the vertex accumulator.
3
+ *
4
+ * @param {Float64Array} accumulator
5
+ * @param {ClothState} state
6
+ * @param {number} particle
7
+ * @param {Float32Array|Float64Array} table packed colliders, cloth-local, posed
8
+ * at the substep in progress
9
+ */
10
+ export function cloth_contact_accumulate(accumulator: Float64Array, state: ClothState, particle: number, table: Float32Array | Float64Array): void;
11
+ /**
12
+ * Warm start every occupied contact slot for a substep.
13
+ *
14
+ * A contact is where `β` finally means something. M0 chose `k_min = k_max`,
15
+ * which disables the ramp, and measured that it was as good as any ramped
16
+ * alternative — for *persistent* rows, which is all M0 and M1 had. A contact
17
+ * arrives: on the first substep it exists, its penalty starts at `k_min` and
18
+ * climbs by `β·|C|` per iteration, so a cape meeting a shoulder is pushed out
19
+ * over a few iterations instead of being shot off it in one.
20
+ *
21
+ * @param {ClothState} state
22
+ * @param {number} alpha
23
+ * @param {number} gamma
24
+ * @param {number} k_min_ratio
25
+ * @param {number} k_max_ratio
26
+ * @param {number} inverse_h_squared
27
+ */
28
+ export function cloth_contact_warm_start(state: ClothState, alpha: number, gamma: number, k_min_ratio: number, k_max_ratio: number, inverse_h_squared: number): void;
29
+ /**
30
+ * Dual update for every occupied contact slot.
31
+ *
32
+ * The constraint is re-evaluated here rather than cached from the accumulation,
33
+ * for the same reason every other row kind re-evaluates: the accumulation's `C`
34
+ * is measured *before* the vertex update it feeds, and a multiplier absorbing a
35
+ * violation that has already been corrected is a multiplier that overshoots on
36
+ * the next iteration. It costs a second field evaluation per contact per
37
+ * iteration and it is what makes the multiplier converge within the step.
38
+ *
39
+ * @param {ClothState} state
40
+ * @param {Float32Array|Float64Array} table
41
+ * @param {number} beta
42
+ * @param {number} k_max_ratio
43
+ * @param {number} inverse_h_squared
44
+ */
45
+ export function cloth_contact_dual_update(state: ClothState, table: Float32Array | Float64Array, beta: number, k_max_ratio: number, inverse_h_squared: number): void;
46
+ /**
47
+ * # Contact — the collision row and its friction row, which are one contact
48
+ *
49
+ * §6's table has them as two rows and they are, but they are two rows of the
50
+ * *same thing*: friction's clamp is the collision row's own force, so a module
51
+ * that carried only one of them would have to reach into the other, and a
52
+ * contact that carried its normal multiplier in one table and its tangential
53
+ * one in another would have to keep two lifetimes in step. One module, one pair
54
+ * of slots, one lifetime.
55
+ *
56
+ * collision C = (r + inflation) − sdf_c(x) [0, +∞) hard
57
+ * g = −∇sdf_c(x)
58
+ *
59
+ * friction C = ‖P_t(x − a)‖ [0, μ·f_n) hard
60
+ * g = P_t(x − a)/‖P_t(x − a)‖
61
+ *
62
+ * where `a` is where the particle stuck to the collider, carried in the
63
+ * collider's own frame, and `P_t = I − n nᵀ` projects onto the contact's
64
+ * tangent plane.
65
+ *
66
+ * ## The collision row is hard, which §6's table does not say
67
+ *
68
+ * §6 gives it a stiffness `k_contact` and friction a `k_friction`, and M0's own
69
+ * rule — "a row is **hard** exactly when its stiffness is `Infinity`" — makes
70
+ * that a statement that both are soft penalties. They cannot be. A soft row
71
+ * above about `8·(m/h²)` makes the step *add* energy (`MEASUREMENTS.md` §6),
72
+ * and a contact soft enough to stay under that boundary is a contact cloth
73
+ * sinks through: measured at 2.3 cm of penetration into a 25 cm sphere for a
74
+ * cape that is 4 mm thick. Both rows are therefore hard, with the multiplier
75
+ * carrying the load and the penalty living in the measured band — and that is
76
+ * also what finally gives `β` something to do, because these are the first rows
77
+ * in the system that arrive and leave. `MEASUREMENTS.md` §17.
78
+ *
79
+ * ## The friction clamp is one-sided because `C` is a magnitude
80
+ *
81
+ * §6 writes friction's clamps as `±μ·f_n`, which is the *signed-slip*
82
+ * formulation — a row whose `C` is a displacement along a chosen tangent. This
83
+ * one measures the magnitude of the slip in the tangent plane and points its
84
+ * gradient along it, so `C ≥ 0` always and the negative half of that clamp
85
+ * names a force that pulls the particle further from where it stuck. The row is
86
+ * `[0, μ·f_n]`, which is the same physics: static friction while the force it
87
+ * needs is under the cap, sliding at exactly the cap once it is not.
88
+ *
89
+ * Writing it as a magnitude is what removes the tangent basis. A signed row
90
+ * needs two of them, chosen per contact, and any choice that is continuous
91
+ * frame to frame is a choice with state in it — which is exactly what §7 P4(a)
92
+ * exists to keep out of this system.
93
+ *
94
+ * ## Which force the friction cap reads
95
+ *
96
+ * The *current iteration's* normal force, not the previous iteration's
97
+ * multiplier. VBD uses the multiplier, which is one iteration stale and
98
+ * therefore exactly zero on a contact's first iteration — so at the one
99
+ * iteration per substep §5.1 says the solver must be usable at, friction would
100
+ * never act at all. The current force is already computed, already
101
+ * non-negative, and makes a cloth land on a slope and stay there at 1×1.
102
+ *
103
+ * @author Alex Goldring
104
+ * @copyright Company Named Limited (c) 2026
105
+ */
106
+ /**
107
+ * Contact rows per particle.
108
+ *
109
+ * Four, because a particle in a garment's worst corner — an armpit, between two
110
+ * fingers — is inside three or four collider bounds at once and inside more
111
+ * than that only when a rig has redundant colliders, where the fifth is a
112
+ * duplicate of one of the first four. Slots are filled nearest-first, so the
113
+ * ones dropped are the ones furthest from binding.
114
+ *
115
+ * It is a compile-time constant rather than a field because it is a stride: the
116
+ * accumulation is a counted loop over `CLOTH_CONTACT_SLOTS` adjacent entries,
117
+ * and a per-cloth capacity would put a load and a multiply in the inner loop to
118
+ * buy a garment nothing.
119
+ * @type {number}
120
+ */
121
+ export const CLOTH_CONTACT_SLOTS: number;
122
+ /**
123
+ * Below this a tangential slip is treated as zero and the friction row is
124
+ * skipped: `‖·‖` is not differentiable there, and a particle that has not moved
125
+ * relative to the surface has nothing for friction to resist.
126
+ * @type {number}
127
+ */
128
+ export const CLOTH_FRICTION_EPSILON: number;
129
+ //# sourceMappingURL=cloth_contact_row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloth_contact_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_contact_row.js"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,sDANW,YAAY,+BAEZ,MAAM,SACN,YAAY,GAAC,YAAY,QAwLnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,mEANW,MAAM,SACN,MAAM,eACN,MAAM,eACN,MAAM,qBACN,MAAM,QA0ChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,oEALW,YAAY,GAAC,YAAY,QACzB,MAAM,eACN,MAAM,qBACN,MAAM,QAkGhB;AAjcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;;;;;;;;;;;GAcG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;GAKG;AACH,qCAFU,MAAM,CAE2B"}