@woosh/meep-engine 3.42.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 +91 -96
- 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/playground/vgeo_runtime/README.md +5 -4
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +6 -5
- 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/atmosphere/GPUSky.d.ts +12 -0
- package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/GPUSky.js +162 -147
- 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/lightmap/bake/shader_lightmap_denoise_sh.d.ts.map +1 -1
- package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.js +10 -3
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/particles/DESIGN.md +13 -9
- 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/shaders/chunk_particle_lighting.d.ts +1 -1
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +1 -1
- 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/postprocess/nss/NSS.d.ts +1 -1
- 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/rasterize/native/avboit/AVBOITSideChannel.d.ts +3 -2
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +3 -2
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +9 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +23 -1
- 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/volumetrics/GPUViewVolumetrics.d.ts +4 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +74 -3
- package/src/shade/renderer/volumetrics/NOTES.md +1023 -957
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +5 -4
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +5 -4
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts +1 -1
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +1 -1
- package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts +1 -1
- package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +1 -1
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts +41 -0
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +112 -0
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +9 -23
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +18 -126
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts +22 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.js +228 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +0 -53
- 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/chunk_water_surface_sample.d.ts +4 -3
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +17 -7
- 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 +93 -30
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +13 -5
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +29 -8
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +155 -30
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +6 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +157 -39
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +91 -21
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +442 -70
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +11 -3
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +3 -0
- 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
|
@@ -39,6 +39,8 @@ export class ClothState {
|
|
|
39
39
|
* @param {Int32Array|number[]} [description.leash_particle] the particle each leash row holds
|
|
40
40
|
* @param {Float32Array|number[]} [description.leash_radius] leash radius per row; its length is
|
|
41
41
|
* the row count, and the leash centres are written per step rather than here
|
|
42
|
+
* @param {Int32Array|number[]} [description.leash_source] source particle per leash row, `−1`
|
|
43
|
+
* for a row whose centre the caller writes outright; default all `−1`
|
|
42
44
|
* @param {Int32Array|number[]} [description.backstop_particle] the particle each backstop row holds
|
|
43
45
|
* @param {Float32Array|number[]} [description.backstop_radius] backstop radius per row; the planes
|
|
44
46
|
* themselves are written per step rather than here
|
|
@@ -49,7 +51,7 @@ export class ClothState {
|
|
|
49
51
|
* back private memory would make both threads mutate copies of it.
|
|
50
52
|
* @returns {ClothState}
|
|
51
53
|
*/
|
|
52
|
-
static from({ position, mass_inverse, stretch_particle, stretch_rest, stretch_stiffness, stretch_force_min, stretch_force_max, bend_particle, bend_weight, bend_stiffness, leash_particle, leash_radius, backstop_particle, backstop_radius, shared }: {
|
|
54
|
+
static from({ position, mass_inverse, stretch_particle, stretch_rest, stretch_stiffness, stretch_force_min, stretch_force_max, bend_particle, bend_weight, bend_stiffness, leash_particle, leash_radius, leash_source, backstop_particle, backstop_radius, shared }: {
|
|
53
55
|
position: Float32Array | number[];
|
|
54
56
|
mass_inverse: Float32Array | number[];
|
|
55
57
|
stretch_particle?: Int32Array | number[];
|
|
@@ -62,6 +64,7 @@ export class ClothState {
|
|
|
62
64
|
bend_stiffness?: Float32Array | number[];
|
|
63
65
|
leash_particle?: Int32Array | number[];
|
|
64
66
|
leash_radius?: Float32Array | number[];
|
|
67
|
+
leash_source?: Int32Array | number[];
|
|
65
68
|
backstop_particle?: Int32Array | number[];
|
|
66
69
|
backstop_radius?: Float32Array | number[];
|
|
67
70
|
shared?: boolean;
|
|
@@ -278,15 +281,36 @@ export class ClothState {
|
|
|
278
281
|
* The point each leash row is measured from, 3 per row, in the cloth's own
|
|
279
282
|
* local frame.
|
|
280
283
|
*
|
|
281
|
-
* **Written per step by the caller, not baked
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
284
|
+
* **Written per step by the caller, not baked** — or, for a row with a
|
|
285
|
+
* {@link leash_source}, per substep by the step itself. A slack row's centre
|
|
286
|
+
* is the particle's animated position and a tether row's is the held
|
|
287
|
+
* particle it hangs from, and neither is a property of the rest shape.
|
|
288
|
+
* Storing a point per row rather than an index into a shared table costs
|
|
289
|
+
* three floats a row and removes an indirection from the inner loop, which
|
|
290
|
+
* is the trade this structure makes everywhere else too.
|
|
287
291
|
* @type {Float32Array}
|
|
288
292
|
*/
|
|
289
293
|
leash_target: Float32Array;
|
|
294
|
+
/**
|
|
295
|
+
* The particle each leash row is measured from, or `−1` for a row whose
|
|
296
|
+
* centre the caller writes outright.
|
|
297
|
+
*
|
|
298
|
+
* **A held particle moves inside a step** — it is carried an equal share of
|
|
299
|
+
* the way to where its holder will have it at each substep — so a centre
|
|
300
|
+
* written once per step is a step behind the particle it is supposed to sit
|
|
301
|
+
* on, and a hard row measured from a stale point fights the hold it hangs
|
|
302
|
+
* from. A row with a source is re-centred at every substep, after the held
|
|
303
|
+
* particles have moved, at `position[source] + leash_offset`.
|
|
304
|
+
* @type {Int32Array}
|
|
305
|
+
*/
|
|
306
|
+
leash_source: Int32Array;
|
|
307
|
+
/**
|
|
308
|
+
* Where a sourced leash row's centre sits relative to its source particle,
|
|
309
|
+
* 3 per row, cloth-local. Zero for a tether; the animated pose's offset from
|
|
310
|
+
* the held particle for a slack row. Written by the caller per step.
|
|
311
|
+
* @type {Float32Array}
|
|
312
|
+
*/
|
|
313
|
+
leash_offset: Float32Array;
|
|
290
314
|
/**
|
|
291
315
|
* Leash radius, one per row: `slack·d_geo,i` for a slack row, `d_geo,i` for
|
|
292
316
|
* a tether. Zero is a weld (§3.4 — the pin is a leash of no radius, not a
|
|
@@ -541,6 +565,20 @@ export class ClothState {
|
|
|
541
565
|
* @type {Float32Array}
|
|
542
566
|
*/
|
|
543
567
|
air_velocity: Float32Array;
|
|
568
|
+
/**
|
|
569
|
+
* Where each **held** particle — inverse mass zero — is to be at the end of
|
|
570
|
+
* the step, 3 per particle, cloth-local.
|
|
571
|
+
*
|
|
572
|
+
* Written by the caller; read by the predict, which carries a held particle
|
|
573
|
+
* an equal share of the remaining way at every substep so that it arrives
|
|
574
|
+
* here exactly at the last one. That is how a holder that moves relative to
|
|
575
|
+
* the cloth's frame moves its particles *through* the step rather than at
|
|
576
|
+
* its start, which is the same thing §8.2 does for colliders — and Chaos
|
|
577
|
+
* Cloth does for its kinematic particles. Seeded at the rest position, so a
|
|
578
|
+
* held particle nobody writes a target for stays where it is, bit for bit.
|
|
579
|
+
* @type {Float32Array}
|
|
580
|
+
*/
|
|
581
|
+
kinematic_target: Float32Array;
|
|
544
582
|
/**
|
|
545
583
|
* Gravity plus §10's aerodynamic drag, 3 per particle, cloth-local, m/s².
|
|
546
584
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClothState.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/ClothState.js"],"names":[],"mappings":";;;8BAkHU,MAAM;;;;;;AAkBhB;;;GAGG;AACH,sCAFU,MAAM,CAEyB;AAEzC;
|
|
1
|
+
{"version":3,"file":"ClothState.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/ClothState.js"],"names":[],"mappings":"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"}
|
|
@@ -360,16 +360,39 @@ export class ClothState {
|
|
|
360
360
|
* The point each leash row is measured from, 3 per row, in the cloth's own
|
|
361
361
|
* local frame.
|
|
362
362
|
*
|
|
363
|
-
* **Written per step by the caller, not baked
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
363
|
+
* **Written per step by the caller, not baked** — or, for a row with a
|
|
364
|
+
* {@link leash_source}, per substep by the step itself. A slack row's centre
|
|
365
|
+
* is the particle's animated position and a tether row's is the held
|
|
366
|
+
* particle it hangs from, and neither is a property of the rest shape.
|
|
367
|
+
* Storing a point per row rather than an index into a shared table costs
|
|
368
|
+
* three floats a row and removes an indirection from the inner loop, which
|
|
369
|
+
* is the trade this structure makes everywhere else too.
|
|
369
370
|
* @type {Float32Array}
|
|
370
371
|
*/
|
|
371
372
|
leash_target = null;
|
|
372
373
|
|
|
374
|
+
/**
|
|
375
|
+
* The particle each leash row is measured from, or `−1` for a row whose
|
|
376
|
+
* centre the caller writes outright.
|
|
377
|
+
*
|
|
378
|
+
* **A held particle moves inside a step** — it is carried an equal share of
|
|
379
|
+
* the way to where its holder will have it at each substep — so a centre
|
|
380
|
+
* written once per step is a step behind the particle it is supposed to sit
|
|
381
|
+
* on, and a hard row measured from a stale point fights the hold it hangs
|
|
382
|
+
* from. A row with a source is re-centred at every substep, after the held
|
|
383
|
+
* particles have moved, at `position[source] + leash_offset`.
|
|
384
|
+
* @type {Int32Array}
|
|
385
|
+
*/
|
|
386
|
+
leash_source = null;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Where a sourced leash row's centre sits relative to its source particle,
|
|
390
|
+
* 3 per row, cloth-local. Zero for a tether; the animated pose's offset from
|
|
391
|
+
* the held particle for a slack row. Written by the caller per step.
|
|
392
|
+
* @type {Float32Array}
|
|
393
|
+
*/
|
|
394
|
+
leash_offset = null;
|
|
395
|
+
|
|
373
396
|
/**
|
|
374
397
|
* Leash radius, one per row: `slack·d_geo,i` for a slack row, `d_geo,i` for
|
|
375
398
|
* a tether. Zero is a weld (§3.4 — the pin is a leash of no radius, not a
|
|
@@ -654,6 +677,21 @@ export class ClothState {
|
|
|
654
677
|
*/
|
|
655
678
|
air_velocity = null;
|
|
656
679
|
|
|
680
|
+
/**
|
|
681
|
+
* Where each **held** particle — inverse mass zero — is to be at the end of
|
|
682
|
+
* the step, 3 per particle, cloth-local.
|
|
683
|
+
*
|
|
684
|
+
* Written by the caller; read by the predict, which carries a held particle
|
|
685
|
+
* an equal share of the remaining way at every substep so that it arrives
|
|
686
|
+
* here exactly at the last one. That is how a holder that moves relative to
|
|
687
|
+
* the cloth's frame moves its particles *through* the step rather than at
|
|
688
|
+
* its start, which is the same thing §8.2 does for colliders — and Chaos
|
|
689
|
+
* Cloth does for its kinematic particles. Seeded at the rest position, so a
|
|
690
|
+
* held particle nobody writes a target for stays where it is, bit for bit.
|
|
691
|
+
* @type {Float32Array}
|
|
692
|
+
*/
|
|
693
|
+
kinematic_target = null;
|
|
694
|
+
|
|
657
695
|
/**
|
|
658
696
|
* Gravity plus §10's aerodynamic drag, 3 per particle, cloth-local, m/s².
|
|
659
697
|
*
|
|
@@ -693,6 +731,8 @@ export class ClothState {
|
|
|
693
731
|
* @param {Int32Array|number[]} [description.leash_particle] the particle each leash row holds
|
|
694
732
|
* @param {Float32Array|number[]} [description.leash_radius] leash radius per row; its length is
|
|
695
733
|
* the row count, and the leash centres are written per step rather than here
|
|
734
|
+
* @param {Int32Array|number[]} [description.leash_source] source particle per leash row, `−1`
|
|
735
|
+
* for a row whose centre the caller writes outright; default all `−1`
|
|
696
736
|
* @param {Int32Array|number[]} [description.backstop_particle] the particle each backstop row holds
|
|
697
737
|
* @param {Float32Array|number[]} [description.backstop_radius] backstop radius per row; the planes
|
|
698
738
|
* themselves are written per step rather than here
|
|
@@ -716,6 +756,7 @@ export class ClothState {
|
|
|
716
756
|
bend_stiffness = EMPTY_FLOAT32,
|
|
717
757
|
leash_particle = EMPTY_INT32,
|
|
718
758
|
leash_radius = EMPTY_FLOAT32,
|
|
759
|
+
leash_source = undefined,
|
|
719
760
|
backstop_particle = EMPTY_INT32,
|
|
720
761
|
backstop_radius = EMPTY_FLOAT32,
|
|
721
762
|
shared = false
|
|
@@ -732,6 +773,7 @@ export class ClothState {
|
|
|
732
773
|
assert.equal(bend_particle.length, bend_count * 4, 'bend_particle.length');
|
|
733
774
|
assert.equal(bend_weight.length, bend_count * 4, 'bend_weight.length');
|
|
734
775
|
assert.equal(leash_particle.length, leash_count, 'leash_particle.length');
|
|
776
|
+
assert.ok(leash_source === undefined || leash_source.length === leash_count, 'leash_source.length');
|
|
735
777
|
assert.equal(backstop_particle.length, backstop_count, 'backstop_particle.length');
|
|
736
778
|
|
|
737
779
|
const colors = cloth_color_particles(
|
|
@@ -774,6 +816,7 @@ export class ClothState {
|
|
|
774
816
|
// and the first step's `v = (x − x_prev)/h` reads zero.
|
|
775
817
|
state.position_previous.set(state.position);
|
|
776
818
|
state.inertial.set(state.position);
|
|
819
|
+
state.kinematic_target.set(state.position);
|
|
777
820
|
|
|
778
821
|
for (let row = 0; row < stretch_count; row++) {
|
|
779
822
|
state.stretch_particle[row * 2] = particle_of_source[stretch_particle[row * 2]];
|
|
@@ -828,6 +871,10 @@ export class ClothState {
|
|
|
828
871
|
state.leash_target[row * 3] = state.position[particle * 3];
|
|
829
872
|
state.leash_target[row * 3 + 1] = state.position[particle * 3 + 1];
|
|
830
873
|
state.leash_target[row * 3 + 2] = state.position[particle * 3 + 2];
|
|
874
|
+
|
|
875
|
+
state.leash_source[row] = leash_source === undefined || leash_source[row] < 0
|
|
876
|
+
? -1
|
|
877
|
+
: particle_of_source[leash_source[row]];
|
|
831
878
|
}
|
|
832
879
|
|
|
833
880
|
build_adjacency(
|
|
@@ -1028,6 +1075,8 @@ function allocate(
|
|
|
1028
1075
|
bend_count * 4, // bend_adjacency
|
|
1029
1076
|
leash_count, // leash_particle
|
|
1030
1077
|
leash_count * 3, // leash_target
|
|
1078
|
+
leash_count, // leash_source
|
|
1079
|
+
leash_count * 3, // leash_offset
|
|
1031
1080
|
leash_count, // leash_radius
|
|
1032
1081
|
leash_count, // leash_lambda
|
|
1033
1082
|
leash_count, // leash_penalty
|
|
@@ -1053,7 +1102,8 @@ function allocate(
|
|
|
1053
1102
|
particle_count * 3, // self_force
|
|
1054
1103
|
particle_count * 6, // self_hessian
|
|
1055
1104
|
particle_count * 3, // air_velocity
|
|
1056
|
-
particle_count * 3
|
|
1105
|
+
particle_count * 3, // external_acceleration
|
|
1106
|
+
particle_count * 3 // kinematic_target
|
|
1057
1107
|
];
|
|
1058
1108
|
|
|
1059
1109
|
let total = 0;
|
|
@@ -1119,6 +1169,8 @@ function allocate(
|
|
|
1119
1169
|
|
|
1120
1170
|
state.leash_particle = cut(Int32Array, leash_count);
|
|
1121
1171
|
state.leash_target = cut(Float32Array, leash_count * 3);
|
|
1172
|
+
state.leash_source = cut(Int32Array, leash_count);
|
|
1173
|
+
state.leash_offset = cut(Float32Array, leash_count * 3);
|
|
1122
1174
|
state.leash_radius = cut(Float32Array, leash_count);
|
|
1123
1175
|
state.leash_lambda = cut(Float32Array, leash_count);
|
|
1124
1176
|
state.leash_penalty = cut(Float32Array, leash_count);
|
|
@@ -1157,6 +1209,10 @@ function allocate(
|
|
|
1157
1209
|
state.air_velocity = cut(Float32Array, particle_count * 3);
|
|
1158
1210
|
state.external_acceleration = cut(Float32Array, particle_count * 3);
|
|
1159
1211
|
|
|
1212
|
+
// Held particles only, and a cloth whose holders ride its frame never
|
|
1213
|
+
// changes it: the cold end.
|
|
1214
|
+
state.kinematic_target = cut(Float32Array, particle_count * 3);
|
|
1215
|
+
|
|
1160
1216
|
assert.equal(cursor, total, 'buffer cursor at end of allocation');
|
|
1161
1217
|
}
|
|
1162
1218
|
|
|
@@ -15,9 +15,14 @@
|
|
|
15
15
|
* @param {number} dt seconds, the fixed step the discovered rows will be used
|
|
16
16
|
* across — how far a particle carries its current velocity before anything
|
|
17
17
|
* gets a chance to stop it
|
|
18
|
+
* @param {number} kinematic_travel metres, the furthest any held particle is
|
|
19
|
+
* carried this step. A cloth at rest that a holder yanks has no velocity to
|
|
20
|
+
* reach with and still moves, dragged by the particles it hangs from, so every
|
|
21
|
+
* free particle reaches this much further. Zero for a cloth whose holders ride
|
|
22
|
+
* its frame.
|
|
18
23
|
* @returns {number} how many contact rows were created
|
|
19
24
|
*/
|
|
20
|
-
export function cloth_contact_find(state: ClothState, table: Float32Array | Float64Array, keys: Int32Array, count: number, dt: number): number;
|
|
25
|
+
export function cloth_contact_find(state: ClothState, table: Float32Array | Float64Array, keys: Int32Array, count: number, dt: number, kinematic_travel: number): number;
|
|
21
26
|
/**
|
|
22
27
|
* # Finding the contacts, once per step
|
|
23
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloth_contact_find.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_contact_find.js"],"names":[],"mappings":"AAgHA
|
|
1
|
+
{"version":3,"file":"cloth_contact_find.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_contact_find.js"],"names":[],"mappings":"AAgHA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,6DAbW,YAAY,GAAC,YAAY,QACzB,UAAU,SACV,MAAM,MACN,MAAM,oBAGN,MAAM,GAKJ,MAAM,CAwLlB;AAvSD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AAEH;;;;;;;;;GASG;AACH,mCAFU,MAAM,CAEsB"}
|
|
@@ -127,9 +127,14 @@ export const CLOTH_CONTACT_MARGIN = 1;
|
|
|
127
127
|
* @param {number} dt seconds, the fixed step the discovered rows will be used
|
|
128
128
|
* across — how far a particle carries its current velocity before anything
|
|
129
129
|
* gets a chance to stop it
|
|
130
|
+
* @param {number} kinematic_travel metres, the furthest any held particle is
|
|
131
|
+
* carried this step. A cloth at rest that a holder yanks has no velocity to
|
|
132
|
+
* reach with and still moves, dragged by the particles it hangs from, so every
|
|
133
|
+
* free particle reaches this much further. Zero for a cloth whose holders ride
|
|
134
|
+
* its frame.
|
|
130
135
|
* @returns {number} how many contact rows were created
|
|
131
136
|
*/
|
|
132
|
-
export function cloth_contact_find(state, table, keys, count, dt) {
|
|
137
|
+
export function cloth_contact_find(state, table, keys, count, dt, kinematic_travel) {
|
|
133
138
|
const particle_count = state.particle_count;
|
|
134
139
|
|
|
135
140
|
const collider = state.contact_collider;
|
|
@@ -213,7 +218,7 @@ export function cloth_contact_find(state, table, keys, count, dt) {
|
|
|
213
218
|
// How far this particle carries its current velocity across the step.
|
|
214
219
|
// Hoisted out of the record loop: it is a property of the particle, and
|
|
215
220
|
// the loop below is the hot one.
|
|
216
|
-
const travel = dt * Math.hypot(velocity[p], velocity[p + 1], velocity[p + 2]);
|
|
221
|
+
const travel = dt * Math.hypot(velocity[p], velocity[p + 1], velocity[p + 2]) + kinematic_travel;
|
|
217
222
|
|
|
218
223
|
let found = 0;
|
|
219
224
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the held particles lie on one line, and which: written to `line` as
|
|
3
|
+
* the origin then the unit direction.
|
|
4
|
+
*
|
|
5
|
+
* The origin is the first held particle and the direction runs to the one
|
|
6
|
+
* furthest from it, which spans at least half of the set. Every held particle is
|
|
7
|
+
* then measured off that line.
|
|
8
|
+
*
|
|
9
|
+
* @param {Float64Array} line out, {@link CLOTH_HOLD_LINE_WORDS}
|
|
10
|
+
* @param {Float32Array} position
|
|
11
|
+
* @param {Int32Array} held particle indices
|
|
12
|
+
* @param {number} held_count
|
|
13
|
+
* @returns {boolean} `false` when there are fewer than two distinct held points
|
|
14
|
+
* or they are not on one line; `line` is then not written
|
|
15
|
+
*/
|
|
16
|
+
export function cloth_hold_line_fit(line: Float64Array, position: Float32Array, held: Int32Array, held_count: number): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Take one Newton step of the substep's energy along the turn about `line`, and
|
|
19
|
+
* turn every free particle by the angle it gives — see the module docblock.
|
|
20
|
+
*
|
|
21
|
+
* @param {ClothState} state
|
|
22
|
+
* @param {Float64Array} line from {@link cloth_hold_line_fit}
|
|
23
|
+
* @param {number} inverse_h_squared `1/h²` for the substep in progress
|
|
24
|
+
* @param {Float32Array|Float64Array|null} collider_table as the vertex update
|
|
25
|
+
* takes it; `null` skips the contact rows
|
|
26
|
+
* @returns {number} the angle turned, radians; `0` when there is nothing to turn
|
|
27
|
+
*/
|
|
28
|
+
export function cloth_hold_line_turn(state: ClothState, line: Float64Array, inverse_h_squared: number, collider_table: Float32Array | Float64Array | null): number;
|
|
29
|
+
/**
|
|
30
|
+
* # The turn about a hold line — one more block of the descent
|
|
31
|
+
*
|
|
32
|
+
* VBD is block coordinate descent on the step's energy, one 3×3 block per
|
|
33
|
+
* particle. A cloth whose held particles lie on one line has a motion no such
|
|
34
|
+
* block can make: turning the whole cloth about that line as a rigid body. Every
|
|
35
|
+
* internal row is unchanged by it — its ends turn together, or one of them is on
|
|
36
|
+
* the axis — so the only parts of the energy that see the turn are the inertial
|
|
37
|
+
* term and the rows measured from outside the cloth. When the line is vertical
|
|
38
|
+
* nothing outside restores it either, because gravity is parallel to the axis.
|
|
39
|
+
*
|
|
40
|
+
* A vertex update moves one particle, so every update adds `x_i × m·Δx_i` of
|
|
41
|
+
* angular momentum about the line, and the step stopped at a fabric's iteration
|
|
42
|
+
* count leaves a residual whose moment about it is not zero. The warm start keeps
|
|
43
|
+
* a quarter of each hard multiplier (§5.2), so a cloth at rest re-solves three
|
|
44
|
+
* quarters of its weight every substep, is never a fixed point, and leaves that
|
|
45
|
+
* residual every substep. A flag on a pole turned at ten degrees a second for as
|
|
46
|
+
* long as it was run (PLAN §18, `MEASUREMENTS.md` §63).
|
|
47
|
+
*
|
|
48
|
+
* So the turn gets a block of its own: **one Newton step of the substep's energy
|
|
49
|
+
* along the rotation about the hold line**, then every free particle turned by
|
|
50
|
+
* the angle it gives. It is a descent step on the same energy as the vertex
|
|
51
|
+
* updates, so §5.3 is untouched, and it changes no row, multiplier or constant.
|
|
52
|
+
*
|
|
53
|
+
* ## What enters
|
|
54
|
+
*
|
|
55
|
+
* With `a` the line's unit direction, `r_i` a particle's offset from the line's
|
|
56
|
+
* origin and `t_i = a × r_i` its velocity under a unit turn, along the path
|
|
57
|
+
* `x_i(θ) = o + R(θ)·r_i`:
|
|
58
|
+
*
|
|
59
|
+
* g = dE/dθ = Σ t_i·∇E_i
|
|
60
|
+
* H = d²E/dθ² = Σ t_iᵀ·H_i·t_i + Σ ∇E_i·(a(a·r_i) − r_i)
|
|
61
|
+
* θ = −g/H
|
|
62
|
+
*
|
|
63
|
+
* - `∇E_i` and `H_i` are the vertex update's own assembly with the internal rows
|
|
64
|
+
* left out: the inertial term `(m/h²)(x − y)`, the leash rows, the backstop
|
|
65
|
+
* rows and the contacts. Stretch, bend and self-collision rows are invariant
|
|
66
|
+
* under the turn: a row's energy does not change along the path, so its share
|
|
67
|
+
* of `g` is zero and its two shares of `H` cancel, and leaving it out is
|
|
68
|
+
* leaving out a zero. A tether is invariant too, since it is measured from a
|
|
69
|
+
* held particle and that is on the axis, but it shares its accumulation with
|
|
70
|
+
* the slack row, which is not. It enters, and it can only shorten the step.
|
|
71
|
+
* - The last sum is the path's own curvature, `d²x/dθ² = −r⊥`. About a vertical
|
|
72
|
+
* axis gravity has no part in it and what is left is close to zero; about a
|
|
73
|
+
* horizontal one it is the pendulum's gravity stiffness. It is added only where
|
|
74
|
+
* it is positive, which keeps `H` at least the first sum, positive definite
|
|
75
|
+
* through the mass term: a step no longer than the one without it.
|
|
76
|
+
*
|
|
77
|
+
* ## When it runs
|
|
78
|
+
*
|
|
79
|
+
* When the held particles lie on one line **at this substep**, at two or more
|
|
80
|
+
* distinct points — a fact about the holds the predict already has in hand,
|
|
81
|
+
* since it carries every held particle. A single held point has three free turns
|
|
82
|
+
* and a cloth nothing holds has six; this block is the line's, and neither of
|
|
83
|
+
* those is handled here. It runs on a line gravity restores too, a horizontal
|
|
84
|
+
* one included, and there it has slowed some sleeps and kept one cloth awake
|
|
85
|
+
* (PLAN §18).
|
|
86
|
+
*
|
|
87
|
+
* It runs once a substep, in the **last** iteration, after the sweep and before
|
|
88
|
+
* that iteration's dual update. Run in every iteration it measured no better on
|
|
89
|
+
* a flag and cost 9–19% of a step rather than 3–9% (`MEASUREMENTS.md` §66).
|
|
90
|
+
*
|
|
91
|
+
* @author Alex Goldring
|
|
92
|
+
* @copyright Company Named Limited (c) 2026
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* How far a held particle may sit off the line and still be on it, as a
|
|
96
|
+
* fraction of the largest coordinate among the held particles.
|
|
97
|
+
*
|
|
98
|
+
* Relative, because what it separates is rounding from geometry, and rounding is
|
|
99
|
+
* a proportion of magnitude. Held positions are `Float32` and are carried through
|
|
100
|
+
* the step in double and stored again at each substep. A flag turned off every
|
|
101
|
+
* axis, whose hoist is straight in exact arithmetic, measured at most 6.3e-8 of
|
|
102
|
+
* its largest coordinate off its own line — half a unit in the last place —
|
|
103
|
+
* from the origin out to four kilometres. This is 240 times that, and 15 µm at a
|
|
104
|
+
* metre. `MEASUREMENTS.md` §66.
|
|
105
|
+
*
|
|
106
|
+
* @type {number}
|
|
107
|
+
*/
|
|
108
|
+
export const CLOTH_HOLD_LINE_TOLERANCE: number;
|
|
109
|
+
/**
|
|
110
|
+
* Words of a hold line: the origin, then the unit direction.
|
|
111
|
+
* @type {number}
|
|
112
|
+
*/
|
|
113
|
+
export const CLOTH_HOLD_LINE_WORDS: number;
|
|
114
|
+
//# sourceMappingURL=cloth_hold_line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloth_hold_line.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/solver/cloth_hold_line.js"],"names":[],"mappings":"AAyGA;;;;;;;;;;;;;;GAcG;AACH,0CAPW,YAAY,YACZ,YAAY,QACZ,UAAU,cACV,MAAM,GACJ,OAAO,CAiGnB;AAED;;;;;;;;;;GAUG;AACH,8DANW,YAAY,qBACZ,MAAM,kBACN,YAAY,GAAC,YAAY,GAAC,IAAI,GAE5B,MAAM,CAiIlB;AAjVD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH;;;;;;;;;;;;;GAaG;AACH,wCAFU,MAAM,CAEkC;AAElD;;;GAGG;AACH,oCAFU,MAAM,CAEuB"}
|