@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.
- package/package.json +1 -1
- package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts +118 -0
- package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts.map +1 -0
- package/src/core/geom/3d/hash-grid/PointHashGrid3.js +283 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/BoxShape3D.js +6 -17
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +3 -14
- package/src/core/geom/3d/shape/CylinderShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CylinderShape3D.js +3 -21
- package/src/core/geom/3d/shape/PlaneShape3D.d.ts +105 -0
- package/src/core/geom/3d/shape/PlaneShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/PlaneShape3D.js +251 -0
- package/src/core/geom/3d/shape/SphereShape3D.js +3 -3
- package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/shape_to_type.js +3 -0
- package/src/core/geom/3d/shape/json/type_adapters.d.ts +14 -0
- package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
- package/src/core/geom/3d/shape/json/type_adapters.js +15 -0
- package/src/core/geom/3d/shape/sdf/sdf3_box.d.ts +51 -0
- package/src/core/geom/3d/shape/sdf/sdf3_box.d.ts.map +1 -0
- package/src/core/geom/3d/shape/sdf/sdf3_box.js +113 -0
- package/src/core/geom/3d/shape/sdf/sdf3_capsule.d.ts +46 -0
- package/src/core/geom/3d/shape/sdf/sdf3_capsule.d.ts.map +1 -0
- package/src/core/geom/3d/shape/sdf/sdf3_capsule.js +82 -0
- package/src/core/geom/3d/shape/sdf/sdf3_cylinder.d.ts +60 -0
- package/src/core/geom/3d/shape/sdf/sdf3_cylinder.d.ts.map +1 -0
- package/src/core/geom/3d/shape/sdf/sdf3_cylinder.js +126 -0
- package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.d.ts +50 -0
- package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.d.ts.map +1 -0
- package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.js +53 -0
- package/src/core/geom/3d/shape/sdf/sdf3_plane.d.ts +52 -0
- package/src/core/geom/3d/shape/sdf/sdf3_plane.d.ts.map +1 -0
- package/src/core/geom/3d/shape/sdf/sdf3_plane.js +61 -0
- package/src/core/geom/3d/shape/sdf/sdf3_sphere.d.ts +41 -0
- package/src/core/geom/3d/shape/sdf/sdf3_sphere.d.ts.map +1 -0
- package/src/core/geom/3d/shape/sdf/sdf3_sphere.js +71 -0
- package/src/core/process/ConcurrencyGate.d.ts +103 -0
- package/src/core/process/ConcurrencyGate.d.ts.map +1 -0
- package/src/core/process/ConcurrencyGate.js +207 -0
- package/src/engine/asset/AssetManager.d.ts +10 -0
- package/src/engine/asset/AssetManager.d.ts.map +1 -1
- package/src/engine/asset/AssetManager.js +10 -0
- package/src/engine/graphics/CONTEXT_LOSS_RECOVERY_PLAN.md +30 -13
- package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts +26 -0
- package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts.map +1 -0
- package/src/engine/graphics3/pose/collect_entity_playbacks.js +40 -0
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
- package/src/engine/graphics3/pose/query_entity_node_world_pose.js +74 -101
- package/src/engine/physics/cloth/MEASUREMENTS.md +1287 -4
- package/src/engine/physics/cloth/PLAN.md +1967 -1581
- package/src/engine/physics/cloth/build/ClothProxy.d.ts +147 -0
- package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/ClothProxy.js +207 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +70 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +256 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +176 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.js +435 -0
- package/src/engine/physics/cloth/collider/ClothColliderKind.d.ts +12 -0
- package/src/engine/physics/cloth/collider/ClothColliderKind.d.ts.map +1 -0
- package/src/engine/physics/cloth/collider/ClothColliderKind.js +38 -0
- package/src/engine/physics/cloth/collider/ClothColliderRecord.d.ts +120 -0
- package/src/engine/physics/cloth/collider/ClothColliderRecord.d.ts.map +1 -0
- package/src/engine/physics/cloth/collider/ClothColliderRecord.js +137 -0
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts +25 -0
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -0
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +190 -0
- package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +44 -0
- package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -0
- package/src/engine/physics/cloth/collider/cloth_collider_pack.js +173 -0
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +94 -0
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -0
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +275 -0
- package/src/engine/physics/cloth/ecs/ClothCollider.d.ts +126 -0
- package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothCollider.js +199 -0
- package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +9 -0
- package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +32 -0
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +114 -0
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +243 -0
- package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +66 -57
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +109 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.js +479 -363
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts +95 -0
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothRig.js +140 -0
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +30 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.js +1021 -773
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +90 -0
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_build_rows.js +374 -0
- package/src/engine/physics/cloth/ecs/cloth_dynamics_library.d.ts +32 -3
- package/src/engine/physics/cloth/ecs/cloth_dynamics_library.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_dynamics_library.js +283 -254
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +59 -0
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +328 -0
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +13 -0
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +288 -0
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +58 -0
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +199 -0
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +8 -63
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +317 -645
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +61 -0
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back.js +212 -449
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts +49 -0
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +115 -0
- package/src/engine/physics/cloth/playground/README.md +155 -1
- package/src/engine/physics/cloth/playground/collide.html +178 -0
- package/src/engine/physics/cloth/playground/collide_build.d.ts +95 -0
- package/src/engine/physics/cloth/playground/collide_build.d.ts.map +1 -0
- package/src/engine/physics/cloth/playground/collide_build.js +315 -0
- package/src/engine/physics/cloth/playground/collide_main.d.ts +2 -0
- package/src/engine/physics/cloth/playground/collide_main.d.ts.map +1 -0
- package/src/engine/physics/cloth/playground/collide_main.js +720 -0
- package/src/engine/physics/cloth/playground/garment.html +182 -0
- package/src/engine/physics/cloth/playground/garment_build.d.ts +78 -0
- package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -0
- package/src/engine/physics/cloth/playground/garment_build.js +359 -0
- package/src/engine/physics/cloth/playground/garment_main.d.ts +2 -0
- package/src/engine/physics/cloth/playground/garment_main.d.ts.map +1 -0
- package/src/engine/physics/cloth/playground/garment_main.js +633 -0
- package/src/engine/physics/cloth/solver/ClothState.d.ts +208 -5
- package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/ClothState.js +302 -8
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +87 -0
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_contact_find.js +343 -0
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +112 -0
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_self_find.js +448 -0
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts +4 -1
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +16 -1
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +112 -5
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solver_constants.js +117 -6
- package/src/engine/physics/cloth/solver/cloth_step.d.ts +40 -9
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +122 -10
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +95 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +285 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +129 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +501 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +75 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +202 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/playground/vgeo_viewer/README.md +18 -0
- package/src/shade/playground/vgeo_viewer/main.js +87 -50
- package/src/shade/renderer/buffer/table/GPUDatabase.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/GPUDatabase.js +191 -62
- package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts +94 -2
- package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/GPUTypedTable.js +414 -2
- package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.d.ts +14 -0
- package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.js +13 -0
- package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.d.ts +17 -0
- package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.d.ts.map +1 -0
- package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.js +116 -0
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +9 -4
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +843 -734
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +12 -0
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +13 -0
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts +17 -0
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.js +185 -30
- package/src/shade/renderer/geometry/virtual/MICRON_COMPARISON_2026_08_20.md +17 -0
- package/src/shade/renderer/geometry/virtual/VGEO_FORMAT.md +141 -24
- package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_DESIGN.md +204 -64
- package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_PLAN.md +110 -10
- package/src/shade/renderer/geometry/virtual/VK_LOD_CLUSTERS_COMPARISON_2026_08_20.md +19 -0
- package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.d.ts +19 -6
- package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.js +26 -7
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +173 -14
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +458 -51
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +49 -13
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +52 -14
- package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.d.ts +20 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.js +19 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.d.ts +27 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.js +48 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.d.ts +29 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.js +60 -0
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.d.ts +8 -1
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.js +32 -2
- package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.d.ts +258 -0
- package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.js +723 -0
- package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.d.ts +49 -0
- package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.js +50 -0
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts +3 -0
- package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts.map +1 -1
- package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.js +121 -21
- package/src/shade/renderer/texture/virtual/README.md +6 -4
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.js +7 -0
- package/src/shade/renderer/texture/virtual/source/VTSourceTiled.d.ts +3 -3
- package/src/shade/renderer/texture/virtual/source/VTSourceTiled.js +3 -3
- package/src/engine/ecs/system/SystemExecutionPhase.d.ts +0 -9
- package/src/engine/ecs/system/SystemExecutionPhase.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/NOTES.md +0 -128
- package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.d.ts +0 -6
- package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.js +0 -5
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts +0 -49
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.js +0 -264
- package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts +0 -44
- package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsage.js +0 -228
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.d.ts +0 -3
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.js +0 -73
- package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.d.ts +0 -14
- package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.js +0 -85
- package/src/engine/graphics/texture/virtual/debug/UsageDebugView.d.ts +0 -12
- package/src/engine/graphics/texture/virtual/debug/UsageDebugView.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/debug/UsageDebugView.js +0 -63
- package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.d.ts +0 -12
- package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.js +0 -243
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts +0 -30
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js +0 -39
- package/src/engine/graphics/texture/virtual/tile/compose_finger_print.d.ts +0 -9
- package/src/engine/graphics/texture/virtual/tile/compose_finger_print.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/tile/compose_finger_print.js +0 -24
- package/src/engine/graphics/texture/virtual/tile/compose_tile_address.d.ts +0 -9
- package/src/engine/graphics/texture/virtual/tile/compose_tile_address.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/tile/compose_tile_address.js +0 -26
- package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.d.ts +0 -11
- package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.js +0 -12
- package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.d.ts +0 -7
- package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.d.ts.map +0 -1
- package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.js +0 -16
- package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.d.ts +0 -7
- package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.d.ts.map +0 -1
- 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
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* the
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* *Budget:* **
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @type {Readonly<ClothDynamics>}
|
|
118
|
-
*/
|
|
119
|
-
export const
|
|
120
|
-
stretch: 0.
|
|
121
|
-
bend: 0.
|
|
122
|
-
damping: 0.
|
|
123
|
-
slack: 0.
|
|
124
|
-
thickness: 0.
|
|
125
|
-
inertia: 1,
|
|
126
|
-
drag: 0.
|
|
127
|
-
substeps: 2,
|
|
128
|
-
iterations:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* @type {Readonly<ClothDynamics>}
|
|
164
|
-
*/
|
|
165
|
-
export const
|
|
166
|
-
stretch: 0.
|
|
167
|
-
bend:
|
|
168
|
-
damping: 0.
|
|
169
|
-
slack:
|
|
170
|
-
thickness: 0.
|
|
171
|
-
inertia: 1,
|
|
172
|
-
drag: 0.
|
|
173
|
-
substeps: 2,
|
|
174
|
-
iterations:
|
|
175
|
-
}));
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
* does.
|
|
205
|
-
*
|
|
206
|
-
* *Budget:* **
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}));
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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"}
|