@woosh/meep-engine 3.43.0 → 3.44.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/editor/prototypeEditorShell.d.ts.map +1 -1
- package/editor/prototypeEditorShell.js +4 -2
- package/package.json +1 -1
- package/src/engine/Clock.d.ts +15 -0
- package/src/engine/Clock.d.ts.map +1 -1
- package/src/engine/Clock.js +29 -5
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +11 -19
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +23 -13
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.js +61 -64
- package/src/engine/graphics3/AnimationSystem.d.ts +24 -15
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem.js +67 -61
- package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
- package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
- package/src/engine/graphics3/MeshSkinSystem.js +317 -0
- package/src/engine/graphics3/MeshSystem.d.ts +15 -35
- package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
- package/src/engine/graphics3/MeshSystem.js +21 -298
- package/src/engine/graphics3/RowChains.d.ts +76 -0
- package/src/engine/graphics3/RowChains.d.ts.map +1 -0
- package/src/engine/graphics3/RowChains.js +347 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
- package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
- package/src/engine/graphics3/animation/AnimationClips.js +79 -0
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
- package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
- package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
- package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -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 +80 -75
- package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
- package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
- package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
- package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_place.js +175 -130
- package/src/engine/graphics3/register_clips.d.ts +64 -0
- package/src/engine/graphics3/register_clips.d.ts.map +1 -0
- package/src/engine/graphics3/register_clips.js +114 -0
- package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
- package/src/engine/physics/cloth/PLAN.md +339 -9
- package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
- package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
- package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +22 -0
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +75 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +357 -284
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +280 -0
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
- package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
- package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
- package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
- package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
- package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
- package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothWorld.js +816 -179
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_build_rows.js +321 -84
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +9 -7
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +30 -30
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_geodesic.js +142 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.js +608 -0
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +160 -9
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +44 -15
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -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 +60 -16
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
- package/src/engine/physics/cloth/playground/collide_main.js +1 -1
- package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/garment_build.js +17 -5
- package/src/engine/physics/cloth/playground/garment_main.js +1 -1
- package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/rig_build.js +302 -296
- package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
- package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/ClothState.js +63 -7
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_contact_find.js +7 -2
- package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
- package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_hold_line.js +362 -0
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_self_find.js +13 -13
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
- package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +183 -20
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step_instance.js +10 -3
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +9 -9
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/cloth_sample_air.js +26 -26
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/simulation/Ticker.d.ts +13 -0
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +43 -8
- package/src/shade/RENDERER_CONTRACT.md +8 -2
- package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
- package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/main.js +11 -19
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
- package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
- package/src/shade/playground/texture_encode/README.md +129 -109
- package/src/shade/playground/texture_encode/main.js +1430 -1430
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
- package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
- package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
- package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
- package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
- package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
- package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
- package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
- package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
- package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
- package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
- package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
- package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
- package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
- package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
- package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles.js +6 -2
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
- package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
- package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_transport.js +7 -5
- package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
- package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
- package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water.js +3 -1
- package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
- package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +37 -20
- package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
- package/src/shade/wgsl/validate_wgsl_source.js +74 -3
- package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
- package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
- package/src/engine/graphics3/register_instance_animation.js +0 -201
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
* step, the colliders that could touch it are queried out of the index and
|
|
9
9
|
* rewritten into its frame.
|
|
10
10
|
*
|
|
11
|
-
* ## Both poses go into the *current*
|
|
11
|
+
* ## Both poses go into the cloth's *current* frame
|
|
12
12
|
*
|
|
13
13
|
* A record carries where the collider was and where it is. Both are converted
|
|
14
|
-
* using the
|
|
14
|
+
* using the frame's pose **now**, not each with the frame pose of its own
|
|
15
15
|
* step, so what the sweep interpolates is the collider's motion *relative to
|
|
16
16
|
* the cloth's frame*. That is the motion the particles actually see: the frame
|
|
17
17
|
* change has already been applied to them by `move_local_frame`, scaled by
|
|
18
18
|
* `ClothDynamics#inertia`, before the step begins.
|
|
19
19
|
*
|
|
20
20
|
* The alternative — converting each pose in its own frame — would make a
|
|
21
|
-
* collider appear to move whenever the
|
|
21
|
+
* collider appear to move whenever the frame did, so a character running past
|
|
22
22
|
* a static wall would sweep the wall through their own cape.
|
|
23
23
|
*
|
|
24
24
|
* ## The query box
|
|
@@ -47,17 +47,17 @@ import { CLOTH_COLLIDER_SLOTS } from "../solver/cloth_solver_constants.js";
|
|
|
47
47
|
* step, the colliders that could touch it are queried out of the index and
|
|
48
48
|
* rewritten into its frame.
|
|
49
49
|
*
|
|
50
|
-
* ## Both poses go into the *current*
|
|
50
|
+
* ## Both poses go into the cloth's *current* frame
|
|
51
51
|
*
|
|
52
52
|
* A record carries where the collider was and where it is. Both are converted
|
|
53
|
-
* using the
|
|
53
|
+
* using the frame's pose **now**, not each with the frame pose of its own
|
|
54
54
|
* step, so what the sweep interpolates is the collider's motion *relative to
|
|
55
55
|
* the cloth's frame*. That is the motion the particles actually see: the frame
|
|
56
56
|
* change has already been applied to them by `move_local_frame`, scaled by
|
|
57
57
|
* `ClothDynamics#inertia`, before the step begins.
|
|
58
58
|
*
|
|
59
59
|
* The alternative — converting each pose in its own frame — would make a
|
|
60
|
-
* collider appear to move whenever the
|
|
60
|
+
* collider appear to move whenever the frame did, so a character running past
|
|
61
61
|
* a static wall would sweep the wall through their own cape.
|
|
62
62
|
*
|
|
63
63
|
* ## The query box
|
|
@@ -193,20 +193,20 @@ function query_colliders(instance, index, reach) {
|
|
|
193
193
|
return 0;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
// The
|
|
196
|
+
// The frame pose the particles were carried into this step, not the live
|
|
197
197
|
// component — those are the same value by the time this runs, and the
|
|
198
198
|
// cached pair is the one `move_local_frame` used.
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
const
|
|
199
|
+
const frame_x = instance.frame_translation[0];
|
|
200
|
+
const frame_y = instance.frame_translation[1];
|
|
201
|
+
const frame_z = instance.frame_translation[2];
|
|
202
202
|
|
|
203
|
-
const
|
|
203
|
+
const frame_rotation = instance.frame_rotation;
|
|
204
204
|
|
|
205
205
|
const contact_reach = reach + state.contact_radius * (1 + CLOTH_CONTACT_MARGIN);
|
|
206
206
|
const local_scale = Math.max(Math.abs(min_x), Math.abs(max_x))
|
|
207
207
|
+ Math.max(Math.abs(min_y), Math.abs(max_y))
|
|
208
208
|
+ Math.max(Math.abs(min_z), Math.abs(max_z)) + contact_reach;
|
|
209
|
-
const world_scale = local_scale + Math.abs(
|
|
209
|
+
const world_scale = local_scale + Math.abs(frame_x) + Math.abs(frame_y) + Math.abs(frame_z);
|
|
210
210
|
const margin = contact_reach + cloth_contact_rounding(local_scale, world_scale);
|
|
211
211
|
|
|
212
212
|
min_x -= margin;
|
|
@@ -233,11 +233,11 @@ function query_colliders(instance, index, reach) {
|
|
|
233
233
|
CORNER[1] = (corner & 2) === 0 ? min_y : max_y;
|
|
234
234
|
CORNER[2] = (corner & 4) === 0 ? min_z : max_z;
|
|
235
235
|
|
|
236
|
-
v3_quaternion_apply_array(CORNER, 0, CORNER, 0,
|
|
236
|
+
v3_quaternion_apply_array(CORNER, 0, CORNER, 0, frame_rotation, 0);
|
|
237
237
|
|
|
238
|
-
const x = CORNER[0] +
|
|
239
|
-
const y = CORNER[1] +
|
|
240
|
-
const z = CORNER[2] +
|
|
238
|
+
const x = CORNER[0] + frame_x;
|
|
239
|
+
const y = CORNER[1] + frame_y;
|
|
240
|
+
const z = CORNER[2] + frame_z;
|
|
241
241
|
|
|
242
242
|
if (x < world_min_x) { world_min_x = x; }
|
|
243
243
|
if (y < world_min_y) { world_min_y = y; }
|
|
@@ -339,8 +339,8 @@ export function cloth_gather_colliders(instance, index, reach) {
|
|
|
339
339
|
* @private
|
|
340
340
|
*/
|
|
341
341
|
function localise_record(table, record, source, handle, instance) {
|
|
342
|
-
const
|
|
343
|
-
const
|
|
342
|
+
const frame_translation = instance.frame_translation;
|
|
343
|
+
const frame_rotation = instance.frame_rotation;
|
|
344
344
|
const from = handle * CCR_STRIDE;
|
|
345
345
|
const to = record * CCR_STRIDE;
|
|
346
346
|
|
|
@@ -356,13 +356,13 @@ function localise_record(table, record, source, handle, instance) {
|
|
|
356
356
|
localise(
|
|
357
357
|
table, to + CCR_TX, to + CCR_QX,
|
|
358
358
|
source, from + CCR_TX, from + CCR_QX,
|
|
359
|
-
|
|
359
|
+
frame_translation, frame_rotation
|
|
360
360
|
);
|
|
361
361
|
|
|
362
362
|
localise(
|
|
363
363
|
table, to + CCR_PREV_TX, to + CCR_PREV_QX,
|
|
364
364
|
source, from + CCR_PREV_TX, from + CCR_PREV_QX,
|
|
365
|
-
|
|
365
|
+
frame_translation, frame_rotation
|
|
366
366
|
);
|
|
367
367
|
|
|
368
368
|
cloth_collider_refit_bounds(table, record, CCR_STRIDE);
|
|
@@ -382,31 +382,31 @@ function localise_record(table, record, source, handle, instance) {
|
|
|
382
382
|
* @param {Float32Array|Float64Array} source the world pose's record table
|
|
383
383
|
* @param {number} source_translation_slot `[x, y, z]`
|
|
384
384
|
* @param {number} source_rotation_slot `[x, y, z, w]`
|
|
385
|
-
* @param {Float64Array}
|
|
386
|
-
* @param {Float64Array}
|
|
385
|
+
* @param {Float64Array} frame_translation `[x, y, z]`
|
|
386
|
+
* @param {Float64Array} frame_rotation `[x, y, z, w]`
|
|
387
387
|
* @private
|
|
388
388
|
*/
|
|
389
389
|
function localise(
|
|
390
390
|
table, translation_slot, rotation_slot,
|
|
391
391
|
source, source_translation_slot, source_rotation_slot,
|
|
392
|
-
|
|
392
|
+
frame_translation, frame_rotation
|
|
393
393
|
) {
|
|
394
|
-
LOCAL_TRANSLATION[0] = source[source_translation_slot] -
|
|
395
|
-
LOCAL_TRANSLATION[1] = source[source_translation_slot + 1] -
|
|
396
|
-
LOCAL_TRANSLATION[2] = source[source_translation_slot + 2] -
|
|
394
|
+
LOCAL_TRANSLATION[0] = source[source_translation_slot] - frame_translation[0];
|
|
395
|
+
LOCAL_TRANSLATION[1] = source[source_translation_slot + 1] - frame_translation[1];
|
|
396
|
+
LOCAL_TRANSLATION[2] = source[source_translation_slot + 2] - frame_translation[2];
|
|
397
397
|
|
|
398
|
-
v3_quaternion_apply_inverse_array(LOCAL_TRANSLATION, 0, LOCAL_TRANSLATION, 0,
|
|
398
|
+
v3_quaternion_apply_inverse_array(LOCAL_TRANSLATION, 0, LOCAL_TRANSLATION, 0, frame_rotation, 0);
|
|
399
399
|
|
|
400
400
|
table[translation_slot] = LOCAL_TRANSLATION[0];
|
|
401
401
|
table[translation_slot + 1] = LOCAL_TRANSLATION[1];
|
|
402
402
|
table[translation_slot + 2] = LOCAL_TRANSLATION[2];
|
|
403
403
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
404
|
+
FRAME_CONJUGATE[0] = -frame_rotation[0];
|
|
405
|
+
FRAME_CONJUGATE[1] = -frame_rotation[1];
|
|
406
|
+
FRAME_CONJUGATE[2] = -frame_rotation[2];
|
|
407
|
+
FRAME_CONJUGATE[3] = frame_rotation[3];
|
|
408
408
|
|
|
409
|
-
quat3_multiply_array(LOCAL_ROTATION, 0,
|
|
409
|
+
quat3_multiply_array(LOCAL_ROTATION, 0, FRAME_CONJUGATE, 0, source, source_rotation_slot);
|
|
410
410
|
|
|
411
411
|
table[rotation_slot] = LOCAL_ROTATION[0];
|
|
412
412
|
table[rotation_slot + 1] = LOCAL_ROTATION[1];
|
|
@@ -517,7 +517,7 @@ const LOCAL_ROTATION = new Float64Array(4);
|
|
|
517
517
|
* @type {Float64Array}
|
|
518
518
|
* @private
|
|
519
519
|
*/
|
|
520
|
-
const
|
|
520
|
+
const FRAME_CONJUGATE = new Float64Array(4);
|
|
521
521
|
|
|
522
522
|
/**
|
|
523
523
|
* The world box {@link query_colliders} asks the index about, `[min_x, min_y, min_z, max_x, max_y,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edges incident on each node, CSR, from an edge list.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} node_count
|
|
5
|
+
* @param {Int32Array} edge node pairs, 2 per edge
|
|
6
|
+
* @returns {{offset: Int32Array, edge: Int32Array}} `edge[offset[n] .. offset[n + 1]]` are the
|
|
7
|
+
* edges touching `n`
|
|
8
|
+
*/
|
|
9
|
+
export function cloth_edge_incidence(node_count: number, edge: Int32Array): {
|
|
10
|
+
offset: Int32Array;
|
|
11
|
+
edge: Int32Array;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Distance from every node to the nearest of a set of source nodes, along the
|
|
15
|
+
* edges, and which source that is.
|
|
16
|
+
*
|
|
17
|
+
* A node marked in `blocked` can be reached but is never passed through. That is
|
|
18
|
+
* Chaos Cloth's rule for its long-range attachments (`ClothTetherData.cpp`):
|
|
19
|
+
* a path from one island of held particles does not run through another, because
|
|
20
|
+
* the far side of another island is that island's business.
|
|
21
|
+
*
|
|
22
|
+
* @param {Float64Array} out_distance per node; `Infinity` where no source reaches
|
|
23
|
+
* @param {Int32Array} out_nearest per node, the source it is nearest; `−1` where none reaches
|
|
24
|
+
* @param {number} node_count
|
|
25
|
+
* @param {Int32Array} edge node pairs, 2 per edge
|
|
26
|
+
* @param {Float64Array} edge_length rest length per edge
|
|
27
|
+
* @param {{offset: Int32Array, edge: Int32Array}} incidence from {@link cloth_edge_incidence}
|
|
28
|
+
* @param {Int32Array|number[]} source
|
|
29
|
+
* @param {number} source_count
|
|
30
|
+
* @param {Uint8Array|null} blocked per node, non-zero for a node no path may pass through;
|
|
31
|
+
* `null` for none
|
|
32
|
+
*/
|
|
33
|
+
export function cloth_geodesic_field(out_distance: Float64Array, out_nearest: Int32Array, node_count: number, edge: Int32Array, edge_length: Float64Array, incidence: {
|
|
34
|
+
offset: Int32Array;
|
|
35
|
+
edge: Int32Array;
|
|
36
|
+
}, source: Int32Array | number[], source_count: number, blocked: Uint8Array | null): void;
|
|
37
|
+
//# sourceMappingURL=cloth_geodesic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloth_geodesic.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/cloth_geodesic.js"],"names":[],"mappings":"AAsCA;;;;;;;GAOG;AACH,iDALW,MAAM,QACN,UAAU,GACR;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAC,CAyBlD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mDAXW,YAAY,eACZ,UAAU,cACV,MAAM,QACN,UAAU,eACV,YAAY,aACZ;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAC,UACtC,UAAU,GAAC,MAAM,EAAE,gBACnB,MAAM,WACN,UAAU,GAAC,IAAI,QAsDzB"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Uint32Heap } from "../../../../core/collection/heap/Uint32Heap.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* # How far each particle is from a set of particles, along the fabric
|
|
5
|
+
*
|
|
6
|
+
* The tether row (§6, §7 P2) bounds a particle's distance from a held one by
|
|
7
|
+
* the length of fabric between them, so it needs that length: the shortest path
|
|
8
|
+
* through the cloth's stretch edges, each weighted by its rest length. A chain
|
|
9
|
+
* has one path and the answer is a sum; a sheet has many and the answer is
|
|
10
|
+
* Dijkstra's.
|
|
11
|
+
*
|
|
12
|
+
* A path along edges is never shorter than the surface geodesic it follows, and
|
|
13
|
+
* that is never shorter than the straight line, so in the rest pose a tether
|
|
14
|
+
* built from it is never taut. That is the property the tether needs; how much
|
|
15
|
+
* longer a grid path is than the true geodesic is how much slack the bound
|
|
16
|
+
* carries, and it is the price of a bound that costs nothing at runtime.
|
|
17
|
+
*
|
|
18
|
+
* ## In double, and label-correcting
|
|
19
|
+
*
|
|
20
|
+
* The distances are accumulated in `Float64` from `Float64` edge lengths. The
|
|
21
|
+
* open set is a {@link Uint32Heap}, whose scores are `Float32`, so two
|
|
22
|
+
* candidates closer together than a single-precision step can pop in the wrong
|
|
23
|
+
* order; a node is therefore never closed, and a shorter path arriving after it
|
|
24
|
+
* popped is relaxed through again. The answer is the exact shortest path
|
|
25
|
+
* whatever the heap's rounding, and on the graphs this sees the extra pops are
|
|
26
|
+
* a handful.
|
|
27
|
+
*
|
|
28
|
+
* @author Alex Goldring
|
|
29
|
+
* @copyright Company Named Limited (c) 2026
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The open set. Module-level: a search runs start to finish synchronously, and
|
|
34
|
+
* it runs when a cloth is seeded or its held set changes, never per step.
|
|
35
|
+
* @type {Uint32Heap}
|
|
36
|
+
*/
|
|
37
|
+
const OPEN = new Uint32Heap();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Edges incident on each node, CSR, from an edge list.
|
|
41
|
+
*
|
|
42
|
+
* @param {number} node_count
|
|
43
|
+
* @param {Int32Array} edge node pairs, 2 per edge
|
|
44
|
+
* @returns {{offset: Int32Array, edge: Int32Array}} `edge[offset[n] .. offset[n + 1]]` are the
|
|
45
|
+
* edges touching `n`
|
|
46
|
+
*/
|
|
47
|
+
export function cloth_edge_incidence(node_count, edge) {
|
|
48
|
+
const edge_count = edge.length >> 1;
|
|
49
|
+
|
|
50
|
+
const offset = new Int32Array(node_count + 1);
|
|
51
|
+
|
|
52
|
+
for (let i = 0; i < edge_count * 2; i++) {
|
|
53
|
+
offset[edge[i] + 1]++;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
for (let n = 0; n < node_count; n++) {
|
|
57
|
+
offset[n + 1] += offset[n];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const incident = new Int32Array(edge_count * 2);
|
|
61
|
+
const cursor = offset.slice(0, node_count);
|
|
62
|
+
|
|
63
|
+
for (let e = 0; e < edge_count; e++) {
|
|
64
|
+
incident[cursor[edge[e * 2]]++] = e;
|
|
65
|
+
incident[cursor[edge[e * 2 + 1]]++] = e;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return { offset, edge: incident };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Distance from every node to the nearest of a set of source nodes, along the
|
|
73
|
+
* edges, and which source that is.
|
|
74
|
+
*
|
|
75
|
+
* A node marked in `blocked` can be reached but is never passed through. That is
|
|
76
|
+
* Chaos Cloth's rule for its long-range attachments (`ClothTetherData.cpp`):
|
|
77
|
+
* a path from one island of held particles does not run through another, because
|
|
78
|
+
* the far side of another island is that island's business.
|
|
79
|
+
*
|
|
80
|
+
* @param {Float64Array} out_distance per node; `Infinity` where no source reaches
|
|
81
|
+
* @param {Int32Array} out_nearest per node, the source it is nearest; `−1` where none reaches
|
|
82
|
+
* @param {number} node_count
|
|
83
|
+
* @param {Int32Array} edge node pairs, 2 per edge
|
|
84
|
+
* @param {Float64Array} edge_length rest length per edge
|
|
85
|
+
* @param {{offset: Int32Array, edge: Int32Array}} incidence from {@link cloth_edge_incidence}
|
|
86
|
+
* @param {Int32Array|number[]} source
|
|
87
|
+
* @param {number} source_count
|
|
88
|
+
* @param {Uint8Array|null} blocked per node, non-zero for a node no path may pass through;
|
|
89
|
+
* `null` for none
|
|
90
|
+
*/
|
|
91
|
+
export function cloth_geodesic_field(
|
|
92
|
+
out_distance, out_nearest,
|
|
93
|
+
node_count, edge, edge_length, incidence,
|
|
94
|
+
source, source_count,
|
|
95
|
+
blocked
|
|
96
|
+
) {
|
|
97
|
+
out_distance.fill(Infinity, 0, node_count);
|
|
98
|
+
out_nearest.fill(-1, 0, node_count);
|
|
99
|
+
|
|
100
|
+
OPEN.clear();
|
|
101
|
+
|
|
102
|
+
for (let i = 0; i < source_count; i++) {
|
|
103
|
+
const s = source[i];
|
|
104
|
+
|
|
105
|
+
out_distance[s] = 0;
|
|
106
|
+
out_nearest[s] = s;
|
|
107
|
+
|
|
108
|
+
OPEN.insert(s, 0);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const offset = incidence.offset;
|
|
112
|
+
const incident = incidence.edge;
|
|
113
|
+
|
|
114
|
+
while (!OPEN.is_empty()) {
|
|
115
|
+
const u = OPEN.pop_min();
|
|
116
|
+
|
|
117
|
+
const d = out_distance[u];
|
|
118
|
+
|
|
119
|
+
if (d > 0 && blocked !== null && blocked[u] !== 0) {
|
|
120
|
+
// Reached, and that is where the path stops.
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const nearest = out_nearest[u];
|
|
125
|
+
|
|
126
|
+
for (let k = offset[u]; k < offset[u + 1]; k++) {
|
|
127
|
+
const e = incident[k];
|
|
128
|
+
|
|
129
|
+
const a = edge[e * 2];
|
|
130
|
+
const v = a === u ? edge[e * 2 + 1] : a;
|
|
131
|
+
|
|
132
|
+
const candidate = d + edge_length[e];
|
|
133
|
+
|
|
134
|
+
if (candidate < out_distance[v]) {
|
|
135
|
+
out_distance[v] = candidate;
|
|
136
|
+
out_nearest[v] = nearest;
|
|
137
|
+
|
|
138
|
+
OPEN.insert(v, candidate);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # What holding a particle does to a cloth
|
|
3
|
+
*
|
|
4
|
+
* A {@link ClothPin} holds particles, and that one fact decides four things the
|
|
5
|
+
* rows depend on. This module is where they are decided, once per change in
|
|
6
|
+
* what is held ({@link cloth_apply_holds}) and once per step
|
|
7
|
+
* ({@link cloth_hold_step}):
|
|
8
|
+
*
|
|
9
|
+
* - **Who is kinematic.** A held particle has inverse mass zero and follows its
|
|
10
|
+
* holder: the solver carries it through the step towards
|
|
11
|
+
* `ClothState#kinematic_target`.
|
|
12
|
+
* - **What each free particle hangs from.** Its nearest held particle, along the
|
|
13
|
+
* fabric — one multi-source Dijkstra over the stretch edges, every held
|
|
14
|
+
* particle a source, so a path never runs through one held particle to reach
|
|
15
|
+
* another. Nothing held in reach means nothing to hang from.
|
|
16
|
+
* - **The tether and the slack**, §6's two leash rows, both measured from that
|
|
17
|
+
* particle (`ClothState#leash_source`), so that they follow it through the step
|
|
18
|
+
* rather than lag a step behind it. One tether per particle, to the nearest
|
|
19
|
+
* hold only: two hard tethers to two holders pulled apart are two bounds no
|
|
20
|
+
* position satisfies, and the fabric between them already says everything a
|
|
21
|
+
* second tether could.
|
|
22
|
+
* - **The animated pose**, which is the rest pose hung from that particle and
|
|
23
|
+
* turned by its holder — see `ClothInstance#animated_position`.
|
|
24
|
+
*
|
|
25
|
+
* A particle nothing held reaches gets a tether and a slack row of radius
|
|
26
|
+
* `Infinity`, which say nothing, and a cloth nothing holds is all such
|
|
27
|
+
* particles: there is no case here for it.
|
|
28
|
+
*
|
|
29
|
+
* ## The tether never pulls
|
|
30
|
+
*
|
|
31
|
+
* A hold that begins mid-run — a hand closing on a falling ribbon — begins
|
|
32
|
+
* wherever the fabric is, and a free configuration is routinely further from
|
|
33
|
+
* the new hold than the geodesic, because the fabric stretches and the tether
|
|
34
|
+
* only binds when something pulls. A tether switched on at its full tightness
|
|
35
|
+
* would snap the cloth onto the hold inside one step. So a tether's radius
|
|
36
|
+
* starts at the larger of `d_geo` and where the particle is, and each step comes
|
|
37
|
+
* down to wherever the particle has since come to, never below `d_geo`: it
|
|
38
|
+
* stops a particle going further than it has been since the hold began, and
|
|
39
|
+
* it never drags one in. A cloth seeded at rest is inside `d_geo` everywhere,
|
|
40
|
+
* so its tethers are `d_geo` from the first step, which is what they always
|
|
41
|
+
* were — and only a tether that began loose is looked at again, so a cloth
|
|
42
|
+
* whose holds have not changed pays nothing for it.
|
|
43
|
+
*
|
|
44
|
+
* @author Alex Goldring
|
|
45
|
+
* @copyright Company Named Limited (c) 2026
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Take a hold's offsets: each of its particles relative to the holder, in the
|
|
49
|
+
* holder's own frame, from where the particle is now.
|
|
50
|
+
*
|
|
51
|
+
* Done in world terms, because the particles are in the frame they were last
|
|
52
|
+
* stepped in and the holder is where it is this step; the two meet in the
|
|
53
|
+
* world. The holder's turn is then measured from its pose in this step's frame,
|
|
54
|
+
* {@link ClothHold#pose}, so a hold begins unturned.
|
|
55
|
+
*
|
|
56
|
+
* @param {ClothInstance} instance
|
|
57
|
+
* @param {ClothHold} hold with {@link ClothHold#world} and {@link ClothHold#pose}
|
|
58
|
+
* this step's
|
|
59
|
+
* @param {Float64Array} frame_translation the frame the particle positions are in
|
|
60
|
+
* @param {Float64Array} frame_rotation
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
export function cloth_capture_hold(instance: ClothInstance, hold: ClothHold, frame_translation: Float64Array, frame_rotation: Float64Array): void;
|
|
64
|
+
/**
|
|
65
|
+
* Re-derive everything that depends on what is held: who is kinematic, what
|
|
66
|
+
* each free particle hangs from, the leash rows, and `reach`.
|
|
67
|
+
*
|
|
68
|
+
* Called once a seed and once per change in the set of holds — never per step.
|
|
69
|
+
* Writes into the instance's existing `ClothState`; nothing is re-built, so a
|
|
70
|
+
* worker that holds the buffer sees it on the next step without a second
|
|
71
|
+
* registration.
|
|
72
|
+
*
|
|
73
|
+
* @param {ClothInstance} instance
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
export function cloth_apply_holds(instance: ClothInstance): void;
|
|
77
|
+
/**
|
|
78
|
+
* Everything a hold changes per step: where each held particle is to be, the
|
|
79
|
+
* animated pose hung from them, the leash centres and the tethers' ratchet.
|
|
80
|
+
*
|
|
81
|
+
* Reads each hold's {@link ClothHold#pose} — the holder in this step's frame —
|
|
82
|
+
* and the particle positions as the frame carry left them.
|
|
83
|
+
*
|
|
84
|
+
* **Nothing is recomputed that cannot have changed.** Every quantity here
|
|
85
|
+
* except the ratchet is a function of the holds' poses in the frame, and a
|
|
86
|
+
* holder riding the frame — a rope's own top, a cape's shoulder in a cape riding
|
|
87
|
+
* that shoulder — has the same pose in it every step however the frame moves.
|
|
88
|
+
* So when no hold has moved in the frame since the last step, and nothing has
|
|
89
|
+
* rewritten the particles since ({@link ClothInstance#holds_dirty}), the
|
|
90
|
+
* targets, the animated pose and the leash offsets are left as they are: the
|
|
91
|
+
* question is a fact the step already has, not a kind of cloth.
|
|
92
|
+
*
|
|
93
|
+
* @param {ClothInstance} instance
|
|
94
|
+
* @returns {void}
|
|
95
|
+
*/
|
|
96
|
+
export function cloth_hold_step(instance: ClothInstance): void;
|
|
97
|
+
//# sourceMappingURL=cloth_holds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloth_holds.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/cloth_holds.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,gGAJW,YAAY,kBACZ,YAAY,GACV,IAAI,CA6ChB;AAED;;;;;;;;;;;GAWG;AACH,4DAFa,IAAI,CA0KhB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,0DAFa,IAAI,CA2KhB"}
|