@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,315 @@
1
+ import { BoxShape3D } from "../../../../core/geom/3d/shape/BoxShape3D.js";
2
+ import { CapsuleShape3D } from "../../../../core/geom/3d/shape/CapsuleShape3D.js";
3
+ import { CylinderShape3D } from "../../../../core/geom/3d/shape/CylinderShape3D.js";
4
+ import { PlaneShape3D } from "../../../../core/geom/3d/shape/PlaneShape3D.js";
5
+ import { SphereShape3D } from "../../../../core/geom/3d/shape/SphereShape3D.js";
6
+ import {
7
+ CCR_FRICTION,
8
+ CCR_INFLATION,
9
+ CCR_PREV_QW,
10
+ CCR_PREV_QX,
11
+ CCR_PREV_QY,
12
+ CCR_PREV_QZ,
13
+ CCR_PREV_TX,
14
+ CCR_PREV_TY,
15
+ CCR_PREV_TZ,
16
+ CCR_QW,
17
+ CCR_QX,
18
+ CCR_QY,
19
+ CCR_QZ,
20
+ CCR_STRIDE,
21
+ CCR_TX,
22
+ CCR_TY,
23
+ CCR_TZ
24
+ } from "../collider/ClothColliderRecord.js";
25
+ import { cloth_collider_refit_bounds } from "../collider/cloth_collider_bounds.js";
26
+ import { cloth_collider_pack } from "../collider/cloth_collider_pack.js";
27
+
28
+ /**
29
+ * # The collider scenes the M2 page collides against
30
+ *
31
+ * Packed tables built straight from shapes, already in the cloth's own frame —
32
+ * there is no `EntityManager` on this page, so `ClothColliderIndex` and
33
+ * `ClothColliderSystem` are not in the loop and everything below the gather is.
34
+ *
35
+ * Kept beside the page rather than in `__fixtures__` for the reason
36
+ * `cloth_playground_build.js` gives: `__fixtures__` is excluded from the
37
+ * published package and the playground is not, so importing across that line
38
+ * would ship a broken module.
39
+ *
40
+ * @author Alex Goldring
41
+ * @copyright Company Named Limited (c) 2026
42
+ */
43
+
44
+ /**
45
+ * @typedef {object} ColliderScene
46
+ * @property {string} label
47
+ * @property {string} blurb what the scene is for
48
+ * @property {Float32Array} table packed records, cloth-local
49
+ * @property {Int32Array} keys
50
+ * @property {number} count
51
+ * @property {AbstractShape3D[]} shape the shape behind each record, for drawing
52
+ * @property {function(number, number): void} [animate] `(record, time) => void`
53
+ */
54
+
55
+ /**
56
+ * Every scene, by name.
57
+ * @type {Readonly<Object<string, {label: string, blurb: string, build: function}>>}
58
+ */
59
+ export const COLLIDER_SCENES = Object.freeze({
60
+ sphere: {
61
+ label: 'sphere under a cape',
62
+ blurb: 'The simplest thing a contact row can be right about.',
63
+ build: () => scene([
64
+ { shape: SphereShape3D.from(0.18), at: [0, -0.4, -0.14] }
65
+ ])
66
+ },
67
+ primitives: {
68
+ label: 'every primitive',
69
+ blurb: 'Sphere, capsule, box, cylinder — the four analytic kinds §8.2 supports, '
70
+ + 'all evaluated by the same packed dispatch and the same free functions the shape classes now call.',
71
+ build: () => scene([
72
+ // Each sits behind the sheet and protrudes 25 mm through it, so what
73
+ // is on screen is four different fields answering the same question.
74
+ { shape: SphereShape3D.from(0.09), at: [-0.23, -0.2, -0.065] },
75
+ { shape: CapsuleShape3D.from(0.06, 0.16), at: [-0.08, -0.36, -0.035], rotation: axis_angle(0, 0, 1, Math.PI / 2) },
76
+ { shape: BoxShape3D.from(0.07, 0.07, 0.08), at: [0.09, -0.2, -0.055] },
77
+ { shape: CylinderShape3D.from(0.07, 0.16), at: [0.24, -0.36, -0.045], rotation: axis_angle(0, 0, 1, Math.PI / 2) }
78
+ ])
79
+ },
80
+ ground: {
81
+ label: 'the ground',
82
+ blurb: 'A PlaneShape3D, which §14.3 asked for and did not exist. A cape folding onto a floor '
83
+ + 'is what an infinite half-space is for, and it costs one dot product a particle.',
84
+ build: () => scene([
85
+ { shape: PlaneShape3D.GROUND, at: [0, -0.46, 0], friction: 0.4 }
86
+ ])
87
+ },
88
+ shoulder: {
89
+ label: 'a shoulder, animated',
90
+ blurb: 'Three capsules as an arm, swinging. §8.2\'s swept collision: the pose is interpolated '
91
+ + 'across the substeps, so a bone that crosses the cloth within a step is caught on the way.',
92
+ build: () => {
93
+ const built = scene([
94
+ { shape: CapsuleShape3D.from(0.1, 0.34), at: [0, -0.22, -0.08], rotation: axis_angle(0, 0, 1, Math.PI / 2) },
95
+ { shape: CapsuleShape3D.from(0.06, 0.22), at: [0.24, -0.36, -0.04] },
96
+ { shape: SphereShape3D.from(0.06), at: [0.24, -0.5, -0.04] }
97
+ ]);
98
+
99
+ built.animate = (record, time) => {
100
+ if (record === 0) {
101
+ return;
102
+ }
103
+
104
+ const swing = Math.sin(time * 2.2) * 0.34;
105
+
106
+ const reach = record === 1 ? 0.17 : 0.33;
107
+
108
+ move(
109
+ built, record,
110
+ 0.2 * Math.cos(swing),
111
+ -0.22 - reach * Math.cos(swing * 0.6),
112
+ -0.08 + reach * Math.sin(swing) * 0.9
113
+ );
114
+ };
115
+
116
+ return built;
117
+ }
118
+ },
119
+ sweep: {
120
+ label: 'a capsule swept through',
121
+ blurb: 'A capsule driven straight through the sheet at speed. Turn the sweep off and watch it '
122
+ + 'stop being noticed at all — the failure was never tunnelling so much as the discovery '
123
+ + 'pass evaluating at the end-of-step pose, where the collider has already gone past.',
124
+ build: () => {
125
+ const built = scene([
126
+ { shape: CapsuleShape3D.from(0.05, 0.3), at: [0, -0.3, -0.9] }
127
+ ]);
128
+
129
+ built.animate = (record, time) => {
130
+ // 0.6 s to cross 1.8 m — 3 m/s, which at 60 Hz is 5 cm a step
131
+ // against a 5 cm capsule. Fast enough that the discovery pass
132
+ // has to know the collider moved.
133
+ const period = 0.6;
134
+
135
+ const t = (time % period) / period;
136
+
137
+ move(built, record, 0, -0.3, -0.9 + t * 1.8);
138
+ };
139
+
140
+ return built;
141
+ }
142
+ },
143
+ spinner: {
144
+ label: 'a spinning bar',
145
+ blurb: 'A bar turning behind the cape and through its plane. The interpolated pose is a '
146
+ + 'translation and a quaternion rather than a lerp of two matrices, which at half a '
147
+ + 'radian a step would shrink the bar by twice a garment\'s thickness halfway through '
148
+ + 'every step. It is also the one scene that does not resolve: a rigid bar driven '
149
+ + 'through cloth that is pinned above it wraps rather than parts, and the readout\'s '
150
+ + '18 mm of resting penetration is the contact row bounding a case it cannot prevent.',
151
+ build: () => {
152
+ const built = scene([
153
+ { shape: BoxShape3D.from(0.025, 0.025, 0.17), at: [0, -0.4, -0.14], friction: 0.2 }
154
+ ]);
155
+
156
+ built.animate = (record, time) => {
157
+ const angle = time * 1.6;
158
+
159
+ turn(built, record, 0, -0.4, -0.14, axis_angle(0, 1, 0, angle));
160
+ };
161
+
162
+ return built;
163
+ }
164
+ }
165
+ });
166
+
167
+ /**
168
+ * @param {number} x
169
+ * @param {number} y
170
+ * @param {number} z
171
+ * @param {number} angle radians
172
+ * @returns {number[]} `[x, y, z, w]`
173
+ */
174
+ export function axis_angle(x, y, z, angle) {
175
+ const half = angle * 0.5;
176
+ const s = Math.sin(half);
177
+
178
+ return [x * s, y * s, z * s, Math.cos(half)];
179
+ }
180
+
181
+ /**
182
+ * @param {{shape: AbstractShape3D, at?: number[], rotation?: number[], friction?: number, inflation?: number}[]} specs
183
+ * @returns {ColliderScene}
184
+ */
185
+ function scene(specs) {
186
+ const count = specs.length;
187
+
188
+ const table = new Float32Array(count * CCR_STRIDE);
189
+ const keys = new Int32Array(count);
190
+
191
+ const shape = [];
192
+
193
+ for (let i = 0; i < count; i++) {
194
+ const spec = specs[i];
195
+
196
+ if (!cloth_collider_pack(table, i, spec.shape, CCR_STRIDE)) {
197
+ throw new Error(`cloth does not collide against ${spec.shape.constructor.name}`);
198
+ }
199
+
200
+ shape.push(spec.shape);
201
+
202
+ const at = spec.at ?? [0, 0, 0];
203
+ const rotation = spec.rotation ?? [0, 0, 0, 1];
204
+
205
+ const r = i * CCR_STRIDE;
206
+
207
+ table[r + CCR_TX] = at[0];
208
+ table[r + CCR_TY] = at[1];
209
+ table[r + CCR_TZ] = at[2];
210
+
211
+ table[r + CCR_QX] = rotation[0];
212
+ table[r + CCR_QY] = rotation[1];
213
+ table[r + CCR_QZ] = rotation[2];
214
+ table[r + CCR_QW] = rotation[3];
215
+
216
+ table[r + CCR_PREV_TX] = at[0];
217
+ table[r + CCR_PREV_TY] = at[1];
218
+ table[r + CCR_PREV_TZ] = at[2];
219
+
220
+ table[r + CCR_PREV_QX] = rotation[0];
221
+ table[r + CCR_PREV_QY] = rotation[1];
222
+ table[r + CCR_PREV_QZ] = rotation[2];
223
+ table[r + CCR_PREV_QW] = rotation[3];
224
+
225
+ table[r + CCR_FRICTION] = spec.friction ?? 0.3;
226
+ table[r + CCR_INFLATION] = spec.inflation ?? 0;
227
+
228
+ cloth_collider_refit_bounds(table, i, CCR_STRIDE);
229
+
230
+ keys[i] = i;
231
+ }
232
+
233
+ return { table, keys, count, shape, animate: undefined };
234
+ }
235
+
236
+ /**
237
+ * Move a record, carrying its current pose into its previous one — what a fixed
238
+ * step does to the index.
239
+ *
240
+ * @param {ColliderScene} built
241
+ * @param {number} record
242
+ * @param {number} x
243
+ * @param {number} y
244
+ * @param {number} z
245
+ */
246
+ export function move(built, record, x, y, z) {
247
+ const table = built.table;
248
+
249
+ const r = record * CCR_STRIDE;
250
+
251
+ carry(table, r);
252
+
253
+ table[r + CCR_TX] = x;
254
+ table[r + CCR_TY] = y;
255
+ table[r + CCR_TZ] = z;
256
+
257
+ cloth_collider_refit_bounds(table, record, CCR_STRIDE);
258
+ }
259
+
260
+ /**
261
+ * @param {ColliderScene} built
262
+ * @param {number} record
263
+ * @param {number} x
264
+ * @param {number} y
265
+ * @param {number} z
266
+ * @param {number[]} rotation
267
+ */
268
+ export function turn(built, record, x, y, z, rotation) {
269
+ const table = built.table;
270
+
271
+ const r = record * CCR_STRIDE;
272
+
273
+ carry(table, r);
274
+
275
+ table[r + CCR_TX] = x;
276
+ table[r + CCR_TY] = y;
277
+ table[r + CCR_TZ] = z;
278
+
279
+ table[r + CCR_QX] = rotation[0];
280
+ table[r + CCR_QY] = rotation[1];
281
+ table[r + CCR_QZ] = rotation[2];
282
+ table[r + CCR_QW] = rotation[3];
283
+
284
+ cloth_collider_refit_bounds(table, record, CCR_STRIDE);
285
+ }
286
+
287
+ /**
288
+ * Freeze a record's previous pose onto its current one, so the sweep has nothing
289
+ * to interpolate. This is the "sweep off" switch, and it is exactly what the
290
+ * design would be without §8.2.
291
+ *
292
+ * @param {ColliderScene} built
293
+ * @param {number} record
294
+ */
295
+ export function unsweep(built, record) {
296
+ carry(built.table, record * CCR_STRIDE);
297
+
298
+ cloth_collider_refit_bounds(built.table, record, CCR_STRIDE);
299
+ }
300
+
301
+ /**
302
+ * @param {Float32Array} table
303
+ * @param {number} r
304
+ * @private
305
+ */
306
+ function carry(table, r) {
307
+ table[r + CCR_PREV_TX] = table[r + CCR_TX];
308
+ table[r + CCR_PREV_TY] = table[r + CCR_TY];
309
+ table[r + CCR_PREV_TZ] = table[r + CCR_TZ];
310
+
311
+ table[r + CCR_PREV_QX] = table[r + CCR_QX];
312
+ table[r + CCR_PREV_QY] = table[r + CCR_QY];
313
+ table[r + CCR_PREV_QZ] = table[r + CCR_QZ];
314
+ table[r + CCR_PREV_QW] = table[r + CCR_QW];
315
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=collide_main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collide_main.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/playground/collide_main.js"],"names":[],"mappings":""}