@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
|
@@ -56,11 +56,13 @@ export function cloth_self_accumulate(accumulator: Float64Array, state: ClothSta
|
|
|
56
56
|
*
|
|
57
57
|
* A self-collision row carries nothing of the kind. What it holds apart is cloth
|
|
58
58
|
* against cloth — grams, moving at the speed cloth moves relative to itself — and
|
|
59
|
-
* a
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
59
|
+
* at a quarter of the way up the band the penalty still produces 0.29 N per
|
|
60
|
+
* millimetre against a particle's weight of 0.2 N: a fold resting on a fold
|
|
61
|
+
* sinks into it by under a millimetre per particle it carries. So it is a plain
|
|
62
|
+
* penalty with no multiplier, no warm start and no identity across steps, which
|
|
63
|
+
* is also what makes a pair list that is rebuilt from scratch every step
|
|
64
|
+
* affordable: there is nothing on a pair worth carrying. `MEASUREMENTS.md` §33,
|
|
65
|
+
* and §65 for the stiffness.
|
|
64
66
|
*
|
|
65
67
|
* @author Alex Goldring
|
|
66
68
|
* @copyright Company Named Limited (c) 2026
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloth_self_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_self_row.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cloth_self_row.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/physics/cloth/solver/constraint/cloth_self_row.js"],"names":[],"mappings":"AAsEA;;;;;;;;;;GAUG;AACH,4EAJW,MAAM,GAEJ,MAAM,CA4FlB;AAED;;;;;;GAMG;AACH,mDAJW,YAAY,+BAEZ,MAAM,QAyBhB;AA/LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH;;;;;GAKG;AACH,iCAFU,MAAM,CAEuB"}
|
|
@@ -48,11 +48,13 @@ import {
|
|
|
48
48
|
*
|
|
49
49
|
* A self-collision row carries nothing of the kind. What it holds apart is cloth
|
|
50
50
|
* against cloth — grams, moving at the speed cloth moves relative to itself — and
|
|
51
|
-
* a
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
51
|
+
* at a quarter of the way up the band the penalty still produces 0.29 N per
|
|
52
|
+
* millimetre against a particle's weight of 0.2 N: a fold resting on a fold
|
|
53
|
+
* sinks into it by under a millimetre per particle it carries. So it is a plain
|
|
54
|
+
* penalty with no multiplier, no warm start and no identity across steps, which
|
|
55
|
+
* is also what makes a pair list that is rebuilt from scratch every step
|
|
56
|
+
* affordable: there is nothing on a pair worth carrying. `MEASUREMENTS.md` §33,
|
|
57
|
+
* and §65 for the stiffness.
|
|
56
58
|
*
|
|
57
59
|
* @author Alex Goldring
|
|
58
60
|
* @copyright Company Named Limited (c) 2026
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
*
|
|
44
44
|
* @param {ClothState} state
|
|
45
45
|
* @param {AbstractClothWind} wind
|
|
46
|
-
* @param {Float64Array}
|
|
47
|
-
* @param {Float64Array}
|
|
46
|
+
* @param {Float64Array} frame_translation the cloth frame's world origin
|
|
47
|
+
* @param {Float64Array} frame_rotation the cloth frame's world rotation, xyzw
|
|
48
48
|
* @param {Float64Array} [centre] written with the world-space air at the cloth's
|
|
49
49
|
* own centre — what the sleep test compares against next step
|
|
50
50
|
* @param {number} [time] seconds this cloth has stepped, the clock its gust is a
|
|
51
51
|
* function of — see {@link AbstractClothWind}
|
|
52
52
|
* @returns {boolean} whether the source was sampled per particle
|
|
53
53
|
*/
|
|
54
|
-
export function cloth_sample_air(state: ClothState, wind: AbstractClothWind,
|
|
54
|
+
export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, frame_translation: Float64Array, frame_rotation: Float64Array, centre?: Float64Array, time?: number): boolean;
|
|
55
55
|
/**
|
|
56
56
|
* Whether the air at the cloth's centre has moved far enough since the last step
|
|
57
57
|
* that actually applied it to be worth waking for — §10's "sleep wakes on a wind
|
|
@@ -78,8 +78,8 @@ export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, anc
|
|
|
78
78
|
*
|
|
79
79
|
* @param {ClothState} state
|
|
80
80
|
* @param {AbstractClothWind} wind
|
|
81
|
-
* @param {Float64Array}
|
|
82
|
-
* @param {Float64Array}
|
|
81
|
+
* @param {Float64Array} frame_translation
|
|
82
|
+
* @param {Float64Array} frame_rotation
|
|
83
83
|
* @param {Float64Array} previous the air last applied to this cloth, world-space
|
|
84
84
|
* @param {number} threshold m/s
|
|
85
85
|
* @param {number} time seconds the cloth has stepped — the clock its gust is a
|
|
@@ -87,7 +87,7 @@ export function cloth_sample_air(state: ClothState, wind: AbstractClothWind, anc
|
|
|
87
87
|
* have, because it has to be asking about the air that step would feel
|
|
88
88
|
* @returns {boolean}
|
|
89
89
|
*/
|
|
90
|
-
export function cloth_air_changed(state: ClothState, wind: AbstractClothWind,
|
|
90
|
+
export function cloth_air_changed(state: ClothState, wind: AbstractClothWind, frame_translation: Float64Array, frame_rotation: Float64Array, previous: Float64Array, threshold: number, time: number): boolean;
|
|
91
91
|
/**
|
|
92
92
|
* The cloth's world-space axis-aligned bounds.
|
|
93
93
|
*
|
|
@@ -97,10 +97,10 @@ export function cloth_air_changed(state: ClothState, wind: AbstractClothWind, an
|
|
|
97
97
|
* a rotated box is not a box.
|
|
98
98
|
*
|
|
99
99
|
* @param {ClothState} state
|
|
100
|
-
* @param {Float64Array}
|
|
101
|
-
* @param {Float64Array}
|
|
100
|
+
* @param {Float64Array} frame_translation
|
|
101
|
+
* @param {Float64Array} frame_rotation
|
|
102
102
|
* @param {Float64Array} out six words, min then max
|
|
103
103
|
* @returns {void}
|
|
104
104
|
*/
|
|
105
|
-
export function cloth_air_bounds(state: ClothState,
|
|
105
|
+
export function cloth_air_bounds(state: ClothState, frame_translation: Float64Array, frame_rotation: Float64Array, out: Float64Array): void;
|
|
106
106
|
//# sourceMappingURL=cloth_sample_air.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloth_sample_air.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/cloth_sample_air.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;;;GAaG;AACH,
|
|
1
|
+
{"version":3,"file":"cloth_sample_air.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/cloth_sample_air.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;;;GAaG;AACH,gGARW,YAAY,kBACZ,YAAY,WACZ,YAAY,SAEZ,MAAM,GAEJ,OAAO,CA8EnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iGATW,YAAY,kBACZ,YAAY,YACZ,YAAY,aACZ,MAAM,QACN,MAAM,GAGJ,OAAO,CAsBnB;AAED;;;;;;;;;;;;;GAaG;AACH,uEALW,YAAY,kBACZ,YAAY,OACZ,YAAY,GACV,IAAI,CAoEhB"}
|
|
@@ -47,15 +47,15 @@ import { v3_quaternion_apply_inverse } from "../../../../core/geom/vec3/v3_quate
|
|
|
47
47
|
*
|
|
48
48
|
* @param {ClothState} state
|
|
49
49
|
* @param {AbstractClothWind} wind
|
|
50
|
-
* @param {Float64Array}
|
|
51
|
-
* @param {Float64Array}
|
|
50
|
+
* @param {Float64Array} frame_translation the cloth frame's world origin
|
|
51
|
+
* @param {Float64Array} frame_rotation the cloth frame's world rotation, xyzw
|
|
52
52
|
* @param {Float64Array} [centre] written with the world-space air at the cloth's
|
|
53
53
|
* own centre — what the sleep test compares against next step
|
|
54
54
|
* @param {number} [time] seconds this cloth has stepped, the clock its gust is a
|
|
55
55
|
* function of — see {@link AbstractClothWind}
|
|
56
56
|
* @returns {boolean} whether the source was sampled per particle
|
|
57
57
|
*/
|
|
58
|
-
export function cloth_sample_air(state, wind,
|
|
58
|
+
export function cloth_sample_air(state, wind, frame_translation, frame_rotation, centre = undefined, time = 0) {
|
|
59
59
|
const particle_count = state.particle_count;
|
|
60
60
|
|
|
61
61
|
const air = state.air_velocity;
|
|
@@ -66,16 +66,16 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
|
|
|
66
66
|
|
|
67
67
|
const position = state.position;
|
|
68
68
|
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
69
|
+
const frame_x = frame_translation[0];
|
|
70
|
+
const frame_y = frame_translation[1];
|
|
71
|
+
const frame_z = frame_translation[2];
|
|
72
72
|
|
|
73
|
-
const qx =
|
|
74
|
-
const qy =
|
|
75
|
-
const qz =
|
|
76
|
-
const qw =
|
|
73
|
+
const qx = frame_rotation[0];
|
|
74
|
+
const qy = frame_rotation[1];
|
|
75
|
+
const qz = frame_rotation[2];
|
|
76
|
+
const qw = frame_rotation[3];
|
|
77
77
|
|
|
78
|
-
cloth_air_bounds(state,
|
|
78
|
+
cloth_air_bounds(state, frame_translation, frame_rotation, BOUNDS);
|
|
79
79
|
|
|
80
80
|
const varies = wind.varies(BOUNDS[0], BOUNDS[1], BOUNDS[2], BOUNDS[3], BOUNDS[4], BOUNDS[5]);
|
|
81
81
|
|
|
@@ -121,7 +121,7 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
|
|
|
121
121
|
|
|
122
122
|
v3_quaternion_apply(WORLD, 0, position[p], position[p + 1], position[p + 2], qx, qy, qz, qw);
|
|
123
123
|
|
|
124
|
-
wind.sample(SAMPLE, WORLD[0] +
|
|
124
|
+
wind.sample(SAMPLE, WORLD[0] + frame_x, WORLD[1] + frame_y, WORLD[2] + frame_z, time);
|
|
125
125
|
|
|
126
126
|
v3_quaternion_apply_inverse(LOCAL, 0, SAMPLE[0], SAMPLE[1], SAMPLE[2], qx, qy, qz, qw);
|
|
127
127
|
|
|
@@ -159,8 +159,8 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
|
|
|
159
159
|
*
|
|
160
160
|
* @param {ClothState} state
|
|
161
161
|
* @param {AbstractClothWind} wind
|
|
162
|
-
* @param {Float64Array}
|
|
163
|
-
* @param {Float64Array}
|
|
162
|
+
* @param {Float64Array} frame_translation
|
|
163
|
+
* @param {Float64Array} frame_rotation
|
|
164
164
|
* @param {Float64Array} previous the air last applied to this cloth, world-space
|
|
165
165
|
* @param {number} threshold m/s
|
|
166
166
|
* @param {number} time seconds the cloth has stepped — the clock its gust is a
|
|
@@ -168,12 +168,12 @@ export function cloth_sample_air(state, wind, anchor_translation, anchor_rotatio
|
|
|
168
168
|
* have, because it has to be asking about the air that step would feel
|
|
169
169
|
* @returns {boolean}
|
|
170
170
|
*/
|
|
171
|
-
export function cloth_air_changed(state, wind,
|
|
171
|
+
export function cloth_air_changed(state, wind, frame_translation, frame_rotation, previous, threshold, time) {
|
|
172
172
|
if (state.particle_count === 0) {
|
|
173
173
|
return false;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
cloth_air_bounds(state,
|
|
176
|
+
cloth_air_bounds(state, frame_translation, frame_rotation, BOUNDS);
|
|
177
177
|
|
|
178
178
|
wind.sample(
|
|
179
179
|
SAMPLE,
|
|
@@ -199,12 +199,12 @@ export function cloth_air_changed(state, wind, anchor_translation, anchor_rotati
|
|
|
199
199
|
* a rotated box is not a box.
|
|
200
200
|
*
|
|
201
201
|
* @param {ClothState} state
|
|
202
|
-
* @param {Float64Array}
|
|
203
|
-
* @param {Float64Array}
|
|
202
|
+
* @param {Float64Array} frame_translation
|
|
203
|
+
* @param {Float64Array} frame_rotation
|
|
204
204
|
* @param {Float64Array} out six words, min then max
|
|
205
205
|
* @returns {void}
|
|
206
206
|
*/
|
|
207
|
-
export function cloth_air_bounds(state,
|
|
207
|
+
export function cloth_air_bounds(state, frame_translation, frame_rotation, out) {
|
|
208
208
|
const particle_count = state.particle_count;
|
|
209
209
|
|
|
210
210
|
const position = state.position;
|
|
@@ -231,10 +231,10 @@ export function cloth_air_bounds(state, anchor_translation, anchor_rotation, out
|
|
|
231
231
|
if (z > max_z) { max_z = z; }
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
const qx =
|
|
235
|
-
const qy =
|
|
236
|
-
const qz =
|
|
237
|
-
const qw =
|
|
234
|
+
const qx = frame_rotation[0];
|
|
235
|
+
const qy = frame_rotation[1];
|
|
236
|
+
const qz = frame_rotation[2];
|
|
237
|
+
const qw = frame_rotation[3];
|
|
238
238
|
|
|
239
239
|
let world_min_x = Infinity;
|
|
240
240
|
let world_min_y = Infinity;
|
|
@@ -252,9 +252,9 @@ export function cloth_air_bounds(state, anchor_translation, anchor_rotation, out
|
|
|
252
252
|
qx, qy, qz, qw
|
|
253
253
|
);
|
|
254
254
|
|
|
255
|
-
const x = WORLD[0] +
|
|
256
|
-
const y = WORLD[1] +
|
|
257
|
-
const z = WORLD[2] +
|
|
255
|
+
const x = WORLD[0] + frame_translation[0];
|
|
256
|
+
const y = WORLD[1] + frame_translation[1];
|
|
257
|
+
const z = WORLD[2] + frame_translation[2];
|
|
258
258
|
|
|
259
259
|
if (x < world_min_x) { world_min_x = x; }
|
|
260
260
|
if (y < world_min_y) { world_min_y = y; }
|
|
@@ -66,11 +66,11 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
66
66
|
/**
|
|
67
67
|
* @param {FluidComponent} fluid
|
|
68
68
|
*/
|
|
69
|
-
static "__#
|
|
69
|
+
static "__#432@#refresh_masks"(fluid: FluidComponent): void;
|
|
70
70
|
/**
|
|
71
71
|
* @param {FluidComponent} fluid
|
|
72
72
|
*/
|
|
73
|
-
static "__#
|
|
73
|
+
static "__#432@#clear_field"(fluid: FluidComponent): void;
|
|
74
74
|
/**
|
|
75
75
|
* Mark every cell of `fluid` whose centre lies within `inflation` of the
|
|
76
76
|
* posed shape as solid. Iteration is clipped to the shape's world AABB
|
|
@@ -82,7 +82,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
82
82
|
* @param {number} inflation world-units SDF threshold
|
|
83
83
|
* @param {Float64Array} point length-3 scratch
|
|
84
84
|
*/
|
|
85
|
-
static "__#
|
|
85
|
+
static "__#432@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
|
|
86
86
|
/**
|
|
87
87
|
* Write the obstacle's translation velocity onto every face of every cell
|
|
88
88
|
* it voxelized — the moving-wall boundary condition. Runs AFTER the mask
|
|
@@ -102,7 +102,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
102
102
|
* @param {number} wvy
|
|
103
103
|
* @param {number} wvz
|
|
104
104
|
*/
|
|
105
|
-
static "__#
|
|
105
|
+
static "__#432@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
|
|
106
106
|
constructor();
|
|
107
107
|
dependencies: (typeof FluidObstacle)[];
|
|
108
108
|
components_used: (ResourceAccessSpecification<typeof Transform64> | ResourceAccessSpecification<typeof RigidBody> | ResourceAccessSpecification<typeof Collider> | ResourceAccessSpecification<typeof FluidComponent> | ResourceAccessSpecification<typeof FluidObstacle>)[];
|
|
@@ -4,6 +4,10 @@ export default Ticker;
|
|
|
4
4
|
* Dispatches "tick" every animation frame or "maxDelay" time, whichever happens to be soonest
|
|
5
5
|
* This is essentially the timing bus that all the simulation systems subscribe to for their step advancement
|
|
6
6
|
*
|
|
7
|
+
* A tick taken in an animation frame runs inside that frame and is measured to the frame's timestamp,
|
|
8
|
+
* and {@link Ticker#onFrame} follows it, so whatever draws from `onFrame` draws the simulation as of
|
|
9
|
+
* that frame.
|
|
10
|
+
*
|
|
7
11
|
*
|
|
8
12
|
* @example
|
|
9
13
|
* ticker.onTick.add(delta_s => {
|
|
@@ -40,6 +44,14 @@ declare class Ticker {
|
|
|
40
44
|
* @type {Signal<number>}
|
|
41
45
|
*/
|
|
42
46
|
readonly onTick: any;
|
|
47
|
+
/**
|
|
48
|
+
* Dispatched once per animation frame, after that frame's tick - or with none, while paused or
|
|
49
|
+
* suspended. The place to draw: the simulation is at the frame's timestamp here.
|
|
50
|
+
* Not dispatched for the {@link start}'s `maxTimeout` fallback ticks, which are not frames.
|
|
51
|
+
* @readonly
|
|
52
|
+
* @type {Signal}
|
|
53
|
+
*/
|
|
54
|
+
readonly onFrame: Signal;
|
|
43
55
|
/**
|
|
44
56
|
* Whether the update loop is cycling. {@link Ticker#pause} and {@link Ticker#resume} require this,
|
|
45
57
|
* they throw otherwise.
|
|
@@ -66,4 +78,5 @@ declare class Ticker {
|
|
|
66
78
|
#private;
|
|
67
79
|
}
|
|
68
80
|
import Clock from '../Clock.js';
|
|
81
|
+
import Signal from "../../core/events/signal/Signal.js";
|
|
69
82
|
//# sourceMappingURL=Ticker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ticker.d.ts","sourceRoot":"","sources":["../../../../src/engine/simulation/Ticker.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Ticker.d.ts","sourceRoot":"","sources":["../../../../src/engine/simulation/Ticker.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IACI;;;OAGG;IACH,gBAFU,KAAK,CAEK;IAEpB;;;;;;;;;;;;OAYG;IACH,uBAFU,OAAO,CAEY;IAkC7B;;;;OAIG;IACH,qBAAsB;IAEtB;;;;;;OAMG;IACH,kBAFU,MAAM,CAEO;IA2BvB;;;;OAIG;IACH,yBAEC;IAED;;;;OAIG;IACH,yBAEC;IAuGD;;;;OAIG;IACH;QAF4B,UAAU,GAA3B,MAAM;aAuGhB;IAED,cAWC;IAED,eAaC;IAED,aAaC;;CACJ;kBAjYiB,aAAa;mBAFZ,oCAAoC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../core/assert.js";
|
|
2
2
|
import Signal from "../../core/events/signal/Signal.js";
|
|
3
|
+
import { current_time_in_seconds } from "../../core/time/current_time_in_seconds.js";
|
|
3
4
|
import Clock from '../Clock.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -7,6 +8,10 @@ import Clock from '../Clock.js';
|
|
|
7
8
|
* Dispatches "tick" every animation frame or "maxDelay" time, whichever happens to be soonest
|
|
8
9
|
* This is essentially the timing bus that all the simulation systems subscribe to for their step advancement
|
|
9
10
|
*
|
|
11
|
+
* A tick taken in an animation frame runs inside that frame and is measured to the frame's timestamp,
|
|
12
|
+
* and {@link Ticker#onFrame} follows it, so whatever draws from `onFrame` draws the simulation as of
|
|
13
|
+
* that frame.
|
|
14
|
+
*
|
|
10
15
|
*
|
|
11
16
|
* @example
|
|
12
17
|
* ticker.onTick.add(delta_s => {
|
|
@@ -78,6 +83,15 @@ class Ticker {
|
|
|
78
83
|
*/
|
|
79
84
|
onTick = new Signal();
|
|
80
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Dispatched once per animation frame, after that frame's tick - or with none, while paused or
|
|
88
|
+
* suspended. The place to draw: the simulation is at the frame's timestamp here.
|
|
89
|
+
* Not dispatched for the {@link start}'s `maxTimeout` fallback ticks, which are not frames.
|
|
90
|
+
* @readonly
|
|
91
|
+
* @type {Signal}
|
|
92
|
+
*/
|
|
93
|
+
onFrame = new Signal();
|
|
94
|
+
|
|
81
95
|
constructor() {
|
|
82
96
|
this.clock.pause();
|
|
83
97
|
}
|
|
@@ -242,12 +256,15 @@ class Ticker {
|
|
|
242
256
|
const generation = this.#generation;
|
|
243
257
|
const is_current = () => this.#generation === generation;
|
|
244
258
|
|
|
245
|
-
|
|
259
|
+
/**
|
|
260
|
+
* @param {number} time in seconds, on the {@link current_time_in_seconds} timeline
|
|
261
|
+
*/
|
|
262
|
+
const update = (time) => {
|
|
246
263
|
if (!this.#isRunning || this.#isSuspended) {
|
|
247
264
|
return;
|
|
248
265
|
}
|
|
249
266
|
|
|
250
|
-
const delta = this.clock.
|
|
267
|
+
const delta = this.clock.getDeltaAt(time);
|
|
251
268
|
|
|
252
269
|
this.#last_tick_delta_s = delta;
|
|
253
270
|
|
|
@@ -261,28 +278,46 @@ class Ticker {
|
|
|
261
278
|
return;
|
|
262
279
|
}
|
|
263
280
|
|
|
264
|
-
animate();
|
|
281
|
+
animate(current_time_in_seconds());
|
|
265
282
|
}
|
|
266
283
|
|
|
267
|
-
|
|
284
|
+
/**
|
|
285
|
+
* @param {number} timestamp the frame's, in milliseconds
|
|
286
|
+
*/
|
|
287
|
+
const animationFrameCallback = (timestamp) => {
|
|
268
288
|
clearTimeout(this.#timeoutHandle);
|
|
269
289
|
|
|
270
290
|
if (!is_current()) {
|
|
271
291
|
return;
|
|
272
292
|
}
|
|
273
293
|
|
|
274
|
-
|
|
275
|
-
|
|
294
|
+
/*
|
|
295
|
+
Ticked here, on the frame's own timestamp, and before the frame is announced. This used to
|
|
296
|
+
be pushed to a setTimeout(0) "allowing draw to happen" first, which made every frame draw
|
|
297
|
+
the simulation as of the previous frame's timeout - and that fired whenever the previous
|
|
298
|
+
draw finished, so a steady motion was drawn at a different speed every frame.
|
|
299
|
+
*/
|
|
300
|
+
animate(timestamp * 1e-3);
|
|
301
|
+
|
|
302
|
+
//a tick listener is allowed to stop us
|
|
303
|
+
if (!is_current()) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
this.onFrame.send0();
|
|
276
308
|
}
|
|
277
309
|
|
|
278
|
-
|
|
310
|
+
/**
|
|
311
|
+
* @param {number} time in seconds, on the {@link current_time_in_seconds} timeline
|
|
312
|
+
*/
|
|
313
|
+
const animate = (time) => {
|
|
279
314
|
if (!is_current()) {
|
|
280
315
|
return;
|
|
281
316
|
}
|
|
282
317
|
|
|
283
318
|
this.#animationFrameHandle = requestAnimationFrame(animationFrameCallback);
|
|
284
319
|
|
|
285
|
-
update();
|
|
320
|
+
update(time);
|
|
286
321
|
|
|
287
322
|
//update() dispatches onTick, and a listener is allowed to stop us from inside it
|
|
288
323
|
if (!is_current()) {
|
|
@@ -258,9 +258,10 @@ geometry.getAttribute(StandardAttributes.Position).data // Float32Array
|
|
|
258
258
|
geometry.index.data // Uint32Array
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
Ten generators ship, all returning a `Geometry`, in `renderer/geometry/primitives/`:
|
|
262
262
|
`make_box_geometry`, `make_plane_geometry`, `make_polyhedron_geometry`, `make_octahedron_geometry`,
|
|
263
|
-
`
|
|
263
|
+
`make_uv_sphere_geometry`, `make_capsule_geometry`, `make_cylinder_geometry`, `make_cone_geometry`,
|
|
264
|
+
`make_torus_geometry`, `make_torus_knot_geometry`.
|
|
264
265
|
|
|
265
266
|
**`MeshletGeometry`** is the GPU form: triangles clustered into meshlets, attributes encoded, and a
|
|
266
267
|
BVH over the clusters. This is what a mesh row names, and it is what buys cluster culling and a
|
|
@@ -273,6 +274,11 @@ const meshlets = meshlet_geometry_build_from_geometry(geometry);
|
|
|
273
274
|
**That build is a precompute.** Do it once, when the content is created or loaded. If your vertices
|
|
274
275
|
change every frame, you are on the wrong path — see §8.
|
|
275
276
|
|
|
277
|
+
Seven of the primitives also come ready built, as `MeshletGeometry` subclasses one per module in
|
|
278
|
+
`renderer/geometry/`: `BoxGeometry`, `PlaneGeometry`, `UVSphereGeometry`, `CapsuleGeometry`,
|
|
279
|
+
`CylinderGeometry`, `ConeGeometry` and `TorusGeometry`. Each constructor runs its generator and then
|
|
280
|
+
this build, so constructing one is the same precompute.
|
|
281
|
+
|
|
276
282
|
### Materials
|
|
277
283
|
|
|
278
284
|
`ShadeMaterial` is the base: `transparency_mode`, `draw_mode` and `draw_side`.
|
|
@@ -3,7 +3,8 @@ import { EntityComponentDataset } from "../../../engine/ecs/EntityComponentDatas
|
|
|
3
3
|
import { Transform64 } from "../../../engine/ecs/transform/Transform64.js";
|
|
4
4
|
import { OrbitalCameraController } from "../../renderer/camera/OrbitalCameraController.js";
|
|
5
5
|
import { PerspectiveCamera } from "../../renderer/camera/PerspectiveCamera.js";
|
|
6
|
-
import { BoxGeometry
|
|
6
|
+
import { BoxGeometry } from "../../renderer/geometry/BoxGeometry.js";
|
|
7
|
+
import { PlaneGeometry } from "../../renderer/geometry/PlaneGeometry.js";
|
|
7
8
|
import { make_sunlight } from "../../renderer/light/make_sunlight.js";
|
|
8
9
|
import { place_light } from "../../renderer/light/place_light.js";
|
|
9
10
|
import { StandardShadeMaterial } from "../../renderer/material/StandardShadeMaterial.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/main.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/main.js"],"names":[],"mappings":"AAgQA;;;;;GAKG;AACH,yBAFa,QAAQ,IAAI,CAAC,CAoiBzB"}
|
|
@@ -11,6 +11,8 @@ import { create_frame_loop } from "../../renderer/create_frame_loop.js";
|
|
|
11
11
|
import { make_sunlight } from "../../renderer/light/make_sunlight.js";
|
|
12
12
|
import { place_light } from "../../renderer/light/place_light.js";
|
|
13
13
|
import { EntityComponentDataset } from "../../../engine/ecs/EntityComponentDataset.js";
|
|
14
|
+
import { MeshSkin } from "../../../engine/graphics/ecs/mesh-v2/MeshSkin.js";
|
|
15
|
+
import { AnimationClips } from "../../../engine/graphics3/animation/AnimationClips.js";
|
|
14
16
|
import { prefab_compile } from "../../../engine/graphics3/prefab/prefab_compile.js";
|
|
15
17
|
import { load_gltf } from "../../renderer/loader/gltf/load_gltf.js";
|
|
16
18
|
import { row_of_entity } from "../../renderer/scene/rows/GPUSceneRows.js";
|
|
@@ -161,25 +163,15 @@ class FrameTimer {
|
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
/**
|
|
164
|
-
* Every
|
|
165
|
-
*
|
|
166
|
-
* Off the skins rather than by walking the entities: a skin already lists exactly the meshes that
|
|
167
|
-
* bind to it, which is what `register_skin` uses, so this cannot disagree with what actually gets
|
|
168
|
-
* deformed.
|
|
166
|
+
* Every mesh entity of an instance that a skin deforms: the ones carrying a `MeshSkin`, which is
|
|
167
|
+
* exactly what gets registered and bound.
|
|
169
168
|
*
|
|
169
|
+
* @param {EntityComponentDataset} dataset
|
|
170
170
|
* @param {PrefabInstance} instance
|
|
171
171
|
* @returns {number[]}
|
|
172
172
|
*/
|
|
173
|
-
function skinned_meshes_of(instance) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
for (const skin of instance.skins) {
|
|
177
|
-
for (const mesh of skin.meshes) {
|
|
178
|
-
meshes.add(mesh);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return [...meshes];
|
|
173
|
+
function skinned_meshes_of(dataset, instance) {
|
|
174
|
+
return Array.from(instance.mesh_entities).filter(entity => dataset.getComponent(entity, MeshSkin) !== undefined);
|
|
183
175
|
}
|
|
184
176
|
|
|
185
177
|
/**
|
|
@@ -201,9 +193,9 @@ function add_dancer(scene_context, dataset, prefab, index, count) {
|
|
|
201
193
|
// what has to move. See `place_character`.
|
|
202
194
|
const { x, z } = grid_position(index, count, SPACING);
|
|
203
195
|
|
|
204
|
-
const { instance } = place_character(scene_context, dataset, prefab, x, z);
|
|
196
|
+
const { root, instance } = place_character(scene_context, dataset, prefab, x, z);
|
|
205
197
|
|
|
206
|
-
const meshes = skinned_meshes_of(instance);
|
|
198
|
+
const meshes = skinned_meshes_of(dataset, instance);
|
|
207
199
|
|
|
208
200
|
if (meshes.length === 0) {
|
|
209
201
|
throw new Error(`${CHARACTER_URL} has no skinned mesh — nothing here has a BLAS to refit`);
|
|
@@ -214,8 +206,8 @@ function add_dancer(scene_context, dataset, prefab, index, count) {
|
|
|
214
206
|
// One clip, looping, at full weight. The pose accumulator sums every *bound* clip whatever its
|
|
215
207
|
// weight, so binding the T-pose alongside the dance would blend the two rather than leave the
|
|
216
208
|
// dance alone — only what should play is registered.
|
|
217
|
-
const
|
|
218
|
-
|
|
209
|
+
const clips = dataset.getComponent(root, AnimationClips).clips;
|
|
210
|
+
const clip = clips.find(candidate => /samba|dance/i.test(candidate.name ?? '')) ?? clips[0];
|
|
219
211
|
|
|
220
212
|
if (clip !== undefined) {
|
|
221
213
|
const clip_id = animations.register_clip(clip);
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* primitives hold a row of the `meshes` table too, over a clone of their geometry when the mesh is
|
|
20
20
|
* skinned, which is the region the skinning pass deforms and the BLAS refit follows.
|
|
21
21
|
*
|
|
22
|
-
* This is what `MeshSystem` and `
|
|
22
|
+
* This is what `MeshSystem`, `ShadedGeometrySystem` and `MeshSkinSystem` do between them for a game; a playground
|
|
23
23
|
* has no systems, so `prefab_place` does the same by hand and in one place — this is it, at a
|
|
24
24
|
* grid position.
|
|
25
25
|
*
|
|
@@ -31,14 +31,17 @@
|
|
|
31
31
|
* @param {object} [options]
|
|
32
32
|
* @param {boolean} [options.register_animation] whether the instance's skins are registered; off
|
|
33
33
|
* leaves a skinned mesh's clone undeformed, which is a question of its own
|
|
34
|
-
* @returns {{root: number, instance: PrefabInstance,
|
|
34
|
+
* @returns {{root: number, instance: PrefabInstance, skins: Array<{entity: number, skin_id: number}>|null}}
|
|
35
35
|
*/
|
|
36
36
|
export function place_character(scene_context: GPUSceneContext, dataset: EntityComponentDataset, prefab: Prefab, x: number, z: number, { register_animation }?: {
|
|
37
37
|
register_animation?: boolean;
|
|
38
38
|
}): {
|
|
39
39
|
root: number;
|
|
40
40
|
instance: PrefabInstance;
|
|
41
|
-
|
|
41
|
+
skins: Array<{
|
|
42
|
+
entity: number;
|
|
43
|
+
skin_id: number;
|
|
44
|
+
}> | null;
|
|
42
45
|
};
|
|
43
46
|
/**
|
|
44
47
|
* The source geometry a mesh entity draws — for a skinned one, what its clone is a clone of.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place_character.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/place_character.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,oHAPW,MAAM,KACN,MAAM;IAEY,kBAAkB,GAApC,OAAO;IAEL;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,iBAAiB;IAAC,
|
|
1
|
+
{"version":3,"file":"place_character.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/place_character.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,oHAPW,MAAM,KACN,MAAM;IAEY,kBAAkB,GAApC,OAAO;IAEL;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,iBAAiB;IAAC,KAAK,EAAE,MAAM;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,GAAC,IAAI,CAAA;CAAC,CAa1G;AAED;;;;;;GAMG;AACH,qEAHW,MAAM,mBAShB;AAED;;;;;;;;;;;;GAYG;AACH,qCALW,MAAM,SACN,MAAM,WACN,MAAM,GACJ;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAUlC"}
|