@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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # One packed collider — the layout, and nothing else
|
|
3
|
+
*
|
|
4
|
+
* §8.1 asks for "a flat array of packed records, each holding the shape kind
|
|
5
|
+
* and its parameters, the world matrix, its cached inverse, the previous step's
|
|
6
|
+
* matrix, the world AABB, friction and inflation". This is that record, as slot
|
|
7
|
+
* offsets into a strided typed array rather than as a class, because the same
|
|
8
|
+
* layout is written twice into two different frames and two different
|
|
9
|
+
* precisions:
|
|
10
|
+
*
|
|
11
|
+
* - {@link ClothColliderIndex} holds every live collider in **world**
|
|
12
|
+
* coordinates, in a `Float64Array`, because a world coordinate can be
|
|
13
|
+
* kilometres from the origin and `Float32` gives up a millimetre there.
|
|
14
|
+
* - each {@link ClothInstance} holds the subset overlapping *it*, in the
|
|
15
|
+
* **cloth's own local frame**, in a `Float32Array`, because that is what the
|
|
16
|
+
* step reads and §12 puts the step's state in `Float32` for the bandwidth.
|
|
17
|
+
*
|
|
18
|
+
* One layout, so the conversion between them is a loop over slots rather than
|
|
19
|
+
* two structures that have to be kept in agreement.
|
|
20
|
+
*
|
|
21
|
+
* ## The pose is a translation and a quaternion, not a matrix
|
|
22
|
+
*
|
|
23
|
+
* §8.2 says swept collision comes from "interpolating the collider's pose
|
|
24
|
+
* between the previous and current **matrices** at the substep's fraction",
|
|
25
|
+
* and that is the one part of it that does not work. A component-wise lerp of
|
|
26
|
+
* two rotation matrices is not a rotation matrix: halfway through a 90° turn it
|
|
27
|
+
* is a matrix whose columns are neither unit length nor orthogonal, so the
|
|
28
|
+
* shape it poses is *shrunk and sheared* — and a collider that shrinks halfway
|
|
29
|
+
* through every step lets cloth through. `MEASUREMENTS.md` §16 measures the
|
|
30
|
+
* size of it. A rigid pose interpolates as a translation and a quaternion, and
|
|
31
|
+
* that is what these slots hold.
|
|
32
|
+
*
|
|
33
|
+
* The interpolated pose is written back into slots {@link CCR_INTERP_TX}
|
|
34
|
+
* onwards once per substep per collider, so the per-particle inner loop reads a
|
|
35
|
+
* pose rather than computing one.
|
|
36
|
+
*
|
|
37
|
+
* @author Alex Goldring
|
|
38
|
+
* @copyright Company Named Limited (c) 2026
|
|
39
|
+
*/
|
|
40
|
+
/** Shape kind — a {@link ClothColliderKind}. */
|
|
41
|
+
export const CCR_KIND: 0;
|
|
42
|
+
/** Shape parameter 0: radius, or half-extent x, or plane normal x. */
|
|
43
|
+
export const CCR_PARAM_0: 1;
|
|
44
|
+
/** Shape parameter 1: height, or half-extent y, or plane normal y. */
|
|
45
|
+
export const CCR_PARAM_1: 2;
|
|
46
|
+
/** Shape parameter 2: half-extent z, or plane normal z. */
|
|
47
|
+
export const CCR_PARAM_2: 3;
|
|
48
|
+
/** Shape parameter 3: the plane's offset. Unused by every other kind. */
|
|
49
|
+
export const CCR_PARAM_3: 4;
|
|
50
|
+
/**
|
|
51
|
+
* The shape's smallest curvature radius, metres — `Infinity` for a plane.
|
|
52
|
+
*
|
|
53
|
+
* The vertex update's trust region (§5.3) caps a step at the distance over
|
|
54
|
+
* which the model it was built from still resembles the energy, and for a
|
|
55
|
+
* contact row the model's gradient is a surface normal. A normal is a good
|
|
56
|
+
* description of a surface over the surface's own curvature radius and a poor
|
|
57
|
+
* one beyond it, so this is that distance, measured from the shape rather than
|
|
58
|
+
* tuned.
|
|
59
|
+
*/
|
|
60
|
+
export const CCR_FEATURE: 5;
|
|
61
|
+
/** Combined Coulomb friction coefficient for this collider against cloth. */
|
|
62
|
+
export const CCR_FRICTION: 6;
|
|
63
|
+
/** Extra thickness in metres, on top of `ClothDynamics#thickness`. */
|
|
64
|
+
export const CCR_INFLATION: 7;
|
|
65
|
+
/** Current pose, translation. */
|
|
66
|
+
export const CCR_TX: 8;
|
|
67
|
+
export const CCR_TY: 9;
|
|
68
|
+
export const CCR_TZ: 10;
|
|
69
|
+
/** Current pose, rotation (x, y, z, w). */
|
|
70
|
+
export const CCR_QX: 11;
|
|
71
|
+
export const CCR_QY: 12;
|
|
72
|
+
export const CCR_QZ: 13;
|
|
73
|
+
export const CCR_QW: 14;
|
|
74
|
+
/** Previous step's pose, translation. */
|
|
75
|
+
export const CCR_PREV_TX: 15;
|
|
76
|
+
export const CCR_PREV_TY: 16;
|
|
77
|
+
export const CCR_PREV_TZ: 17;
|
|
78
|
+
/** Previous step's pose, rotation (x, y, z, w). */
|
|
79
|
+
export const CCR_PREV_QX: 18;
|
|
80
|
+
export const CCR_PREV_QY: 19;
|
|
81
|
+
export const CCR_PREV_QZ: 20;
|
|
82
|
+
export const CCR_PREV_QW: 21;
|
|
83
|
+
/**
|
|
84
|
+
* Axis-aligned bounds of the swept shape — the union of its bounds under both
|
|
85
|
+
* poses — in whichever frame this table is expressed in. The broadphase, and
|
|
86
|
+
* the reason a cloth only converts the colliders that could touch it.
|
|
87
|
+
*/
|
|
88
|
+
export const CCR_AABB_MIN_X: 22;
|
|
89
|
+
export const CCR_AABB_MIN_Y: 23;
|
|
90
|
+
export const CCR_AABB_MIN_Z: 24;
|
|
91
|
+
export const CCR_AABB_MAX_X: 25;
|
|
92
|
+
export const CCR_AABB_MAX_Y: 26;
|
|
93
|
+
export const CCR_AABB_MAX_Z: 27;
|
|
94
|
+
/**
|
|
95
|
+
* The pose interpolated to the substep in progress, translation. Written once
|
|
96
|
+
* per substep per collider by `cloth_collider_pose_at`; read per particle per
|
|
97
|
+
* iteration.
|
|
98
|
+
*/
|
|
99
|
+
export const CCR_INTERP_TX: 28;
|
|
100
|
+
export const CCR_INTERP_TY: 29;
|
|
101
|
+
export const CCR_INTERP_TZ: 30;
|
|
102
|
+
/** The pose interpolated to the substep in progress, rotation (x, y, z, w). */
|
|
103
|
+
export const CCR_INTERP_QX: 31;
|
|
104
|
+
export const CCR_INTERP_QY: 32;
|
|
105
|
+
export const CCR_INTERP_QZ: 33;
|
|
106
|
+
export const CCR_INTERP_QW: 34;
|
|
107
|
+
/** Floats in one record. */
|
|
108
|
+
export const CCR_STRIDE: 35;
|
|
109
|
+
/**
|
|
110
|
+
* Slots in the parallel `Int32Array` the index keeps beside the float table:
|
|
111
|
+
* the layer bit, the mask, and the entity. None of them is a float — a mask of
|
|
112
|
+
* `0xFFFFFFFF` needs 32 bits of mantissa and `Float32` has 24, so packing them
|
|
113
|
+
* in beside the geometry would silently round the highest layers together.
|
|
114
|
+
*/
|
|
115
|
+
export const CCR_META_LAYER: 0;
|
|
116
|
+
export const CCR_META_MASK: 1;
|
|
117
|
+
export const CCR_META_ENTITY: 2;
|
|
118
|
+
/** Ints in one record's metadata. */
|
|
119
|
+
export const CCR_META_STRIDE: 3;
|
|
120
|
+
//# sourceMappingURL=ClothColliderRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClothColliderRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/collider/ClothColliderRecord.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,gDAAgD;AAChD,yBAA0B;AAE1B,sEAAsE;AACtE,4BAA6B;AAE7B,sEAAsE;AACtE,4BAA6B;AAE7B,2DAA2D;AAC3D,4BAA6B;AAE7B,yEAAyE;AACzE,4BAA6B;AAE7B;;;;;;;;;GASG;AACH,4BAA6B;AAE7B,6EAA6E;AAC7E,6BAA8B;AAE9B,sEAAsE;AACtE,8BAA+B;AAE/B,iCAAiC;AACjC,uBAAwB;AACxB,uBAAwB;AACxB,wBAAyB;AAEzB,2CAA2C;AAC3C,wBAAyB;AACzB,wBAAyB;AACzB,wBAAyB;AACzB,wBAAyB;AAEzB,yCAAyC;AACzC,6BAA8B;AAC9B,6BAA8B;AAC9B,6BAA8B;AAE9B,mDAAmD;AACnD,6BAA8B;AAC9B,6BAA8B;AAC9B,6BAA8B;AAC9B,6BAA8B;AAE9B;;;;GAIG;AACH,gCAAiC;AACjC,gCAAiC;AACjC,gCAAiC;AACjC,gCAAiC;AACjC,gCAAiC;AACjC,gCAAiC;AAEjC;;;;GAIG;AACH,+BAAgC;AAChC,+BAAgC;AAChC,+BAAgC;AAEhC,+EAA+E;AAC/E,+BAAgC;AAChC,+BAAgC;AAChC,+BAAgC;AAChC,+BAAgC;AAEhC,4BAA4B;AAC5B,4BAA6B;AAE7B;;;;;GAKG;AACH,+BAAgC;AAChC,8BAA+B;AAC/B,gCAAiC;AAEjC,qCAAqC;AACrC,gCAAiC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # One packed collider — the layout, and nothing else
|
|
3
|
+
*
|
|
4
|
+
* §8.1 asks for "a flat array of packed records, each holding the shape kind
|
|
5
|
+
* and its parameters, the world matrix, its cached inverse, the previous step's
|
|
6
|
+
* matrix, the world AABB, friction and inflation". This is that record, as slot
|
|
7
|
+
* offsets into a strided typed array rather than as a class, because the same
|
|
8
|
+
* layout is written twice into two different frames and two different
|
|
9
|
+
* precisions:
|
|
10
|
+
*
|
|
11
|
+
* - {@link ClothColliderIndex} holds every live collider in **world**
|
|
12
|
+
* coordinates, in a `Float64Array`, because a world coordinate can be
|
|
13
|
+
* kilometres from the origin and `Float32` gives up a millimetre there.
|
|
14
|
+
* - each {@link ClothInstance} holds the subset overlapping *it*, in the
|
|
15
|
+
* **cloth's own local frame**, in a `Float32Array`, because that is what the
|
|
16
|
+
* step reads and §12 puts the step's state in `Float32` for the bandwidth.
|
|
17
|
+
*
|
|
18
|
+
* One layout, so the conversion between them is a loop over slots rather than
|
|
19
|
+
* two structures that have to be kept in agreement.
|
|
20
|
+
*
|
|
21
|
+
* ## The pose is a translation and a quaternion, not a matrix
|
|
22
|
+
*
|
|
23
|
+
* §8.2 says swept collision comes from "interpolating the collider's pose
|
|
24
|
+
* between the previous and current **matrices** at the substep's fraction",
|
|
25
|
+
* and that is the one part of it that does not work. A component-wise lerp of
|
|
26
|
+
* two rotation matrices is not a rotation matrix: halfway through a 90° turn it
|
|
27
|
+
* is a matrix whose columns are neither unit length nor orthogonal, so the
|
|
28
|
+
* shape it poses is *shrunk and sheared* — and a collider that shrinks halfway
|
|
29
|
+
* through every step lets cloth through. `MEASUREMENTS.md` §16 measures the
|
|
30
|
+
* size of it. A rigid pose interpolates as a translation and a quaternion, and
|
|
31
|
+
* that is what these slots hold.
|
|
32
|
+
*
|
|
33
|
+
* The interpolated pose is written back into slots {@link CCR_INTERP_TX}
|
|
34
|
+
* onwards once per substep per collider, so the per-particle inner loop reads a
|
|
35
|
+
* pose rather than computing one.
|
|
36
|
+
*
|
|
37
|
+
* @author Alex Goldring
|
|
38
|
+
* @copyright Company Named Limited (c) 2026
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/** Shape kind — a {@link ClothColliderKind}. */
|
|
42
|
+
export const CCR_KIND = 0;
|
|
43
|
+
|
|
44
|
+
/** Shape parameter 0: radius, or half-extent x, or plane normal x. */
|
|
45
|
+
export const CCR_PARAM_0 = 1;
|
|
46
|
+
|
|
47
|
+
/** Shape parameter 1: height, or half-extent y, or plane normal y. */
|
|
48
|
+
export const CCR_PARAM_1 = 2;
|
|
49
|
+
|
|
50
|
+
/** Shape parameter 2: half-extent z, or plane normal z. */
|
|
51
|
+
export const CCR_PARAM_2 = 3;
|
|
52
|
+
|
|
53
|
+
/** Shape parameter 3: the plane's offset. Unused by every other kind. */
|
|
54
|
+
export const CCR_PARAM_3 = 4;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The shape's smallest curvature radius, metres — `Infinity` for a plane.
|
|
58
|
+
*
|
|
59
|
+
* The vertex update's trust region (§5.3) caps a step at the distance over
|
|
60
|
+
* which the model it was built from still resembles the energy, and for a
|
|
61
|
+
* contact row the model's gradient is a surface normal. A normal is a good
|
|
62
|
+
* description of a surface over the surface's own curvature radius and a poor
|
|
63
|
+
* one beyond it, so this is that distance, measured from the shape rather than
|
|
64
|
+
* tuned.
|
|
65
|
+
*/
|
|
66
|
+
export const CCR_FEATURE = 5;
|
|
67
|
+
|
|
68
|
+
/** Combined Coulomb friction coefficient for this collider against cloth. */
|
|
69
|
+
export const CCR_FRICTION = 6;
|
|
70
|
+
|
|
71
|
+
/** Extra thickness in metres, on top of `ClothDynamics#thickness`. */
|
|
72
|
+
export const CCR_INFLATION = 7;
|
|
73
|
+
|
|
74
|
+
/** Current pose, translation. */
|
|
75
|
+
export const CCR_TX = 8;
|
|
76
|
+
export const CCR_TY = 9;
|
|
77
|
+
export const CCR_TZ = 10;
|
|
78
|
+
|
|
79
|
+
/** Current pose, rotation (x, y, z, w). */
|
|
80
|
+
export const CCR_QX = 11;
|
|
81
|
+
export const CCR_QY = 12;
|
|
82
|
+
export const CCR_QZ = 13;
|
|
83
|
+
export const CCR_QW = 14;
|
|
84
|
+
|
|
85
|
+
/** Previous step's pose, translation. */
|
|
86
|
+
export const CCR_PREV_TX = 15;
|
|
87
|
+
export const CCR_PREV_TY = 16;
|
|
88
|
+
export const CCR_PREV_TZ = 17;
|
|
89
|
+
|
|
90
|
+
/** Previous step's pose, rotation (x, y, z, w). */
|
|
91
|
+
export const CCR_PREV_QX = 18;
|
|
92
|
+
export const CCR_PREV_QY = 19;
|
|
93
|
+
export const CCR_PREV_QZ = 20;
|
|
94
|
+
export const CCR_PREV_QW = 21;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Axis-aligned bounds of the swept shape — the union of its bounds under both
|
|
98
|
+
* poses — in whichever frame this table is expressed in. The broadphase, and
|
|
99
|
+
* the reason a cloth only converts the colliders that could touch it.
|
|
100
|
+
*/
|
|
101
|
+
export const CCR_AABB_MIN_X = 22;
|
|
102
|
+
export const CCR_AABB_MIN_Y = 23;
|
|
103
|
+
export const CCR_AABB_MIN_Z = 24;
|
|
104
|
+
export const CCR_AABB_MAX_X = 25;
|
|
105
|
+
export const CCR_AABB_MAX_Y = 26;
|
|
106
|
+
export const CCR_AABB_MAX_Z = 27;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The pose interpolated to the substep in progress, translation. Written once
|
|
110
|
+
* per substep per collider by `cloth_collider_pose_at`; read per particle per
|
|
111
|
+
* iteration.
|
|
112
|
+
*/
|
|
113
|
+
export const CCR_INTERP_TX = 28;
|
|
114
|
+
export const CCR_INTERP_TY = 29;
|
|
115
|
+
export const CCR_INTERP_TZ = 30;
|
|
116
|
+
|
|
117
|
+
/** The pose interpolated to the substep in progress, rotation (x, y, z, w). */
|
|
118
|
+
export const CCR_INTERP_QX = 31;
|
|
119
|
+
export const CCR_INTERP_QY = 32;
|
|
120
|
+
export const CCR_INTERP_QZ = 33;
|
|
121
|
+
export const CCR_INTERP_QW = 34;
|
|
122
|
+
|
|
123
|
+
/** Floats in one record. */
|
|
124
|
+
export const CCR_STRIDE = 35;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Slots in the parallel `Int32Array` the index keeps beside the float table:
|
|
128
|
+
* the layer bit, the mask, and the entity. None of them is a float — a mask of
|
|
129
|
+
* `0xFFFFFFFF` needs 32 bits of mantissa and `Float32` has 24, so packing them
|
|
130
|
+
* in beside the geometry would silently round the highest layers together.
|
|
131
|
+
*/
|
|
132
|
+
export const CCR_META_LAYER = 0;
|
|
133
|
+
export const CCR_META_MASK = 1;
|
|
134
|
+
export const CCR_META_ENTITY = 2;
|
|
135
|
+
|
|
136
|
+
/** Ints in one record's metadata. */
|
|
137
|
+
export const CCR_META_STRIDE = 3;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # The swept bounds of a packed collider
|
|
3
|
+
*
|
|
4
|
+
* The union of the shape's bounds under the previous pose and the current one —
|
|
5
|
+
* the volume the collider moved through this step, which is the set a particle
|
|
6
|
+
* has to be in for the sweep to be able to catch it.
|
|
7
|
+
*
|
|
8
|
+
* A free function rather than a method on {@link ClothColliderIndex} because
|
|
9
|
+
* two tables need it and they are in different frames: the index's, in world
|
|
10
|
+
* coordinates, and each cloth's, in its own. Both are the same layout, so both
|
|
11
|
+
* are the same arithmetic.
|
|
12
|
+
*
|
|
13
|
+
* @author Alex Goldring
|
|
14
|
+
* @copyright Company Named Limited (c) 2026
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Refit one record's bounds from its two poses.
|
|
18
|
+
*
|
|
19
|
+
* @param {Float32Array|Float64Array} table
|
|
20
|
+
* @param {number} record
|
|
21
|
+
* @param {number} stride
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
export function cloth_collider_refit_bounds(table: Float32Array | Float64Array, record: number, stride: number): void;
|
|
25
|
+
//# sourceMappingURL=cloth_collider_bounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloth_collider_bounds.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/collider/cloth_collider_bounds.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AACH,mDALW,YAAY,GAAC,YAAY,UACzB,MAAM,UACN,MAAM,GACJ,IAAI,CAoBhB"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { aabb3_matrix4_project } from "../../../../core/geom/3d/aabb/aabb3_matrix4_project.js";
|
|
2
|
+
import {
|
|
3
|
+
m4_from_rotation_translation_scale_scalar
|
|
4
|
+
} from "../../../../core/geom/3d/mat4/m4_from_rotation_translation_scale_scalar.js";
|
|
5
|
+
import { v3_quaternion_apply } from "../../../../core/geom/vec3/v3_quaternion_apply.js";
|
|
6
|
+
import { ClothColliderKind } from "./ClothColliderKind.js";
|
|
7
|
+
import {
|
|
8
|
+
CCR_AABB_MAX_X,
|
|
9
|
+
CCR_AABB_MIN_X,
|
|
10
|
+
CCR_KIND,
|
|
11
|
+
CCR_PARAM_0,
|
|
12
|
+
CCR_PARAM_1,
|
|
13
|
+
CCR_PARAM_2,
|
|
14
|
+
CCR_PARAM_3,
|
|
15
|
+
CCR_PREV_QX,
|
|
16
|
+
CCR_PREV_TX,
|
|
17
|
+
CCR_QX,
|
|
18
|
+
CCR_TX
|
|
19
|
+
} from "./ClothColliderRecord.js";
|
|
20
|
+
import { cloth_collider_local_bounds } from "./cloth_collider_pack.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* # The swept bounds of a packed collider
|
|
24
|
+
*
|
|
25
|
+
* The union of the shape's bounds under the previous pose and the current one —
|
|
26
|
+
* the volume the collider moved through this step, which is the set a particle
|
|
27
|
+
* has to be in for the sweep to be able to catch it.
|
|
28
|
+
*
|
|
29
|
+
* A free function rather than a method on {@link ClothColliderIndex} because
|
|
30
|
+
* two tables need it and they are in different frames: the index's, in world
|
|
31
|
+
* coordinates, and each cloth's, in its own. Both are the same layout, so both
|
|
32
|
+
* are the same arithmetic.
|
|
33
|
+
*
|
|
34
|
+
* @author Alex Goldring
|
|
35
|
+
* @copyright Company Named Limited (c) 2026
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Refit one record's bounds from its two poses.
|
|
40
|
+
*
|
|
41
|
+
* @param {Float32Array|Float64Array} table
|
|
42
|
+
* @param {number} record
|
|
43
|
+
* @param {number} stride
|
|
44
|
+
* @returns {void}
|
|
45
|
+
*/
|
|
46
|
+
export function cloth_collider_refit_bounds(table, record, stride) {
|
|
47
|
+
const r = record * stride;
|
|
48
|
+
|
|
49
|
+
if (table[r + CCR_KIND] === ClothColliderKind.Plane) {
|
|
50
|
+
refit_plane(table, r);
|
|
51
|
+
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
cloth_collider_local_bounds(LOCAL_BOUNDS, table, record, stride);
|
|
56
|
+
|
|
57
|
+
project(CURRENT_BOUNDS, table, r + CCR_QX, r + CCR_TX);
|
|
58
|
+
project(PREVIOUS_BOUNDS, table, r + CCR_PREV_QX, r + CCR_PREV_TX);
|
|
59
|
+
|
|
60
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
61
|
+
table[r + CCR_AABB_MIN_X + axis] = Math.min(CURRENT_BOUNDS[axis], PREVIOUS_BOUNDS[axis]);
|
|
62
|
+
table[r + CCR_AABB_MAX_X + axis] = Math.max(CURRENT_BOUNDS[axis + 3], PREVIOUS_BOUNDS[axis + 3]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @param {Float64Array} out
|
|
68
|
+
* @param {Float32Array|Float64Array} table
|
|
69
|
+
* @param {number} rotation slot of the pose's rotation
|
|
70
|
+
* @param {number} translation slot of the pose's translation
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
function project(out, table, rotation, translation) {
|
|
74
|
+
m4_from_rotation_translation_scale_scalar(
|
|
75
|
+
POSE,
|
|
76
|
+
table[rotation], table[rotation + 1], table[rotation + 2], table[rotation + 3],
|
|
77
|
+
table[translation], table[translation + 1], table[translation + 2],
|
|
78
|
+
1, 1, 1
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
aabb3_matrix4_project(out, LOCAL_BOUNDS, POSE);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A half-space's bounds, which cannot go through {@link aabb3_matrix4_project}
|
|
86
|
+
* — an infinite extent multiplied by a zero matrix element is `NaN`. The
|
|
87
|
+
* plane's world normal is its local normal rotated by the pose, and the bound
|
|
88
|
+
* exists on an axis exactly when that normal is aligned with it.
|
|
89
|
+
*
|
|
90
|
+
* @param {Float32Array|Float64Array} table
|
|
91
|
+
* @param {number} r the record's slot offset
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
function refit_plane(table, r) {
|
|
95
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
96
|
+
table[r + CCR_AABB_MIN_X + axis] = Infinity;
|
|
97
|
+
table[r + CCR_AABB_MAX_X + axis] = -Infinity;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
for (const pose of PLANE_POSES) {
|
|
101
|
+
const rotation = r + pose[0];
|
|
102
|
+
const translation = r + pose[1];
|
|
103
|
+
|
|
104
|
+
v3_quaternion_apply(
|
|
105
|
+
PLANE_NORMAL, 0,
|
|
106
|
+
table[r + CCR_PARAM_0], table[r + CCR_PARAM_1], table[r + CCR_PARAM_2],
|
|
107
|
+
table[rotation], table[rotation + 1], table[rotation + 2], table[rotation + 3]
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// The boundary plane passes through `R·(offset·n_local) + t`, so its
|
|
111
|
+
// offset along the *world* normal is `offset + n_world·t`.
|
|
112
|
+
const offset = table[r + CCR_PARAM_3]
|
|
113
|
+
+ PLANE_NORMAL[0] * table[translation]
|
|
114
|
+
+ PLANE_NORMAL[1] * table[translation + 1]
|
|
115
|
+
+ PLANE_NORMAL[2] * table[translation + 2];
|
|
116
|
+
|
|
117
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
118
|
+
const n = PLANE_NORMAL[axis];
|
|
119
|
+
|
|
120
|
+
// Only an exactly axis-aligned normal bounds an axis, and the two
|
|
121
|
+
// poses have to agree — the union of two half-spaces facing
|
|
122
|
+
// different ways is not a half-space, so the looser of the two wins
|
|
123
|
+
// and a rotating plane simply stops bounding anything.
|
|
124
|
+
if (n > PLANE_AXIS_TOLERANCE) {
|
|
125
|
+
table[r + CCR_AABB_MAX_X + axis] = Math.max(table[r + CCR_AABB_MAX_X + axis], offset);
|
|
126
|
+
} else if (n < -PLANE_AXIS_TOLERANCE) {
|
|
127
|
+
table[r + CCR_AABB_MIN_X + axis] = Math.min(table[r + CCR_AABB_MIN_X + axis], -offset);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// An axis neither pose bounded is unbounded, which is the correct answer for
|
|
133
|
+
// a tilted plane and makes every query find it.
|
|
134
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
135
|
+
if (table[r + CCR_AABB_MAX_X + axis] === -Infinity) {
|
|
136
|
+
table[r + CCR_AABB_MAX_X + axis] = Infinity;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (table[r + CCR_AABB_MIN_X + axis] === Infinity) {
|
|
140
|
+
table[r + CCR_AABB_MIN_X + axis] = -Infinity;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* How close to an axis a plane's normal has to be for the half-space to bound
|
|
147
|
+
* that axis. A hundred-thousandth of a radian off, which no authored ground
|
|
148
|
+
* plane is and no accumulated rotation error reaches.
|
|
149
|
+
* @type {number}
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
const PLANE_AXIS_TOLERANCE = 0.999999;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The two pose slot pairs a plane's bounds are computed from — current, then
|
|
156
|
+
* previous — as `[rotation, translation]` offsets within a record.
|
|
157
|
+
* @type {number[][]}
|
|
158
|
+
* @private
|
|
159
|
+
*/
|
|
160
|
+
const PLANE_POSES = [[CCR_QX, CCR_TX], [CCR_PREV_QX, CCR_PREV_TX]];
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @type {Float64Array}
|
|
164
|
+
* @private
|
|
165
|
+
*/
|
|
166
|
+
const PLANE_NORMAL = new Float64Array(3);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @type {Float64Array}
|
|
170
|
+
* @private
|
|
171
|
+
*/
|
|
172
|
+
const LOCAL_BOUNDS = new Float64Array(6);
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @type {Float64Array}
|
|
176
|
+
* @private
|
|
177
|
+
*/
|
|
178
|
+
const CURRENT_BOUNDS = new Float64Array(6);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @type {Float64Array}
|
|
182
|
+
* @private
|
|
183
|
+
*/
|
|
184
|
+
const PREVIOUS_BOUNDS = new Float64Array(6);
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @type {Float64Array}
|
|
188
|
+
* @private
|
|
189
|
+
*/
|
|
190
|
+
const POSE = new Float64Array(16);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # `AbstractShape3D` → a packed record's geometry
|
|
3
|
+
*
|
|
4
|
+
* The one place a cloth collider is a shape object rather than a row of floats.
|
|
5
|
+
* It runs when a `ClothCollider` is linked or its shape changes, never per step
|
|
6
|
+
* and never per particle.
|
|
7
|
+
*
|
|
8
|
+
* `instanceof` rather than the prototype markers the physics narrowphase uses,
|
|
9
|
+
* because this needs to distinguish *five* kinds rather than short-circuit one,
|
|
10
|
+
* and because a marker per kind would be five new fields on `core` shapes for
|
|
11
|
+
* one consumer's benefit. The ordering matters in one place and is commented
|
|
12
|
+
* where it does.
|
|
13
|
+
*
|
|
14
|
+
* @author Alex Goldring
|
|
15
|
+
* @copyright Company Named Limited (c) 2026
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Write a shape's kind, parameters and feature size into a record.
|
|
19
|
+
*
|
|
20
|
+
* @param {Float32Array|Float64Array} table
|
|
21
|
+
* @param {number} record record index, not a slot offset
|
|
22
|
+
* @param {AbstractShape3D} shape in its canonical local frame
|
|
23
|
+
* @param {number} stride
|
|
24
|
+
* @returns {boolean} `false` if the shape is not one cloth can collide against,
|
|
25
|
+
* in which case nothing was written
|
|
26
|
+
*/
|
|
27
|
+
export function cloth_collider_pack(table: Float32Array | Float64Array, record: number, shape: AbstractShape3D, stride: number): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The AABB of a packed shape in its own local frame, ignoring pose.
|
|
30
|
+
*
|
|
31
|
+
* Written here rather than taken from `AbstractShape3D#compute_bounding_box`
|
|
32
|
+
* because a plane's box is `±Infinity` on its unbounded axes and the caller
|
|
33
|
+
* transforms this one — `0 · Infinity` is `NaN`, so an unbounded local box
|
|
34
|
+
* cannot go through a pose. {@link cloth_collider_local_bounds} therefore
|
|
35
|
+
* refuses a plane and the index bounds one directly from its world normal.
|
|
36
|
+
*
|
|
37
|
+
* @param {Float64Array|number[]} out `[x0, y0, z0, x1, y1, z1]`
|
|
38
|
+
* @param {Float32Array|Float64Array} table
|
|
39
|
+
* @param {number} record
|
|
40
|
+
* @param {number} stride
|
|
41
|
+
* @returns {boolean} `false` for an unbounded kind, in which case `out` is untouched
|
|
42
|
+
*/
|
|
43
|
+
export function cloth_collider_local_bounds(out: Float64Array | number[], table: Float32Array | Float64Array, record: number, stride: number): boolean;
|
|
44
|
+
//# sourceMappingURL=cloth_collider_pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloth_collider_pack.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/collider/cloth_collider_pack.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;GASG;AACH,2CAPW,YAAY,GAAC,YAAY,UACzB,MAAM,kCAEN,MAAM,GACJ,OAAO,CAiFnB;AAED;;;;;;;;;;;;;;GAcG;AACH,iDANW,YAAY,GAAC,MAAM,EAAE,SACrB,YAAY,GAAC,YAAY,UACzB,MAAM,UACN,MAAM,GACJ,OAAO,CAqCnB"}
|