@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
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { assert } from "../../core/assert.js";
|
|
2
|
+
import { EntityObserver } from "../ecs/EntityObserver.js";
|
|
3
|
+
import { TRANSFORM_ATTACHMENT_EVENT_CHANGE } from "../ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.js";
|
|
4
|
+
import { TransformAttachment } from "../ecs/transform-attachment/TransformAttachment.js";
|
|
5
|
+
import { TRANSFORM64_EVENT_CHANGE } from "../ecs/transform/TRANSFORM64_EVENT_CHANGE.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import("../ecs/EntityComponentDataset.js").EntityComponentDataset} EntityComponentDataset
|
|
9
|
+
* @typedef {import("../../shade/renderer/scene/rows/GPUSceneRows.js").GPUSceneRows} GPUSceneRows
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* What {@link RowChains} records for an entity with no attachment: the top of its chain.
|
|
14
|
+
*
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
const NO_PARENT = -1;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The rows one system holds, each with the rows of everything it hangs from, kept where the
|
|
21
|
+
* entities say.
|
|
22
|
+
*
|
|
23
|
+
* **Why a chain and not a row.** A row whose attachment parent holds no row is written with its CPU
|
|
24
|
+
* world under the scene root. That is exact until something above it is driven on the GPU — a clip
|
|
25
|
+
* keying a joint takes the joint's whole subtree off the CPU, and its worlds there stop moving. So a
|
|
26
|
+
* primitive under an animated node, or a joint under another, composes correctly only when every
|
|
27
|
+
* entity above it holds a row too, and the GPU composes the chain from the top. A clip also binds
|
|
28
|
+
* only once every node it keys holds a row, so a chain is what lets it play at all.
|
|
29
|
+
*
|
|
30
|
+
* **Held per system.** One system's holds are its own: two primitives under one parent count twice
|
|
31
|
+
* here and hold the parent's row once. Two systems holding the same entity each hold its row — the
|
|
32
|
+
* rows count holders — and each follow it; across a model that overlap is the placing entity and a
|
|
33
|
+
* node or two.
|
|
34
|
+
*
|
|
35
|
+
* **Following is the dataset's events, as a placing system's always was.** An entity with an
|
|
36
|
+
* attachment holds its offset and its parent's row, so what moves it is a new offset, announced as
|
|
37
|
+
* `TRANSFORM_ATTACHMENT_EVENT_CHANGE`; its world follows on the GPU. The top of a chain holds its
|
|
38
|
+
* world, announced as `TRANSFORM64_EVENT_CHANGE`. One listener an entity, the same method for all of
|
|
39
|
+
* them, with the dataset passing the entity in.
|
|
40
|
+
*
|
|
41
|
+
* **A reparent is the attachment taken off and put back**, which no change event announces, so one
|
|
42
|
+
* observer on `TransformAttachment` watches for it and moves a held entity's hold onto its new chain.
|
|
43
|
+
*
|
|
44
|
+
* **Rows come and go with the device.** Until {@link bind} is given a scene's rows, holds and
|
|
45
|
+
* following are recorded and nothing is acquired; binding the rows of a new context after a restart
|
|
46
|
+
* acquires every held entity again, and no listener changes.
|
|
47
|
+
*/
|
|
48
|
+
export class RowChains {
|
|
49
|
+
/**
|
|
50
|
+
* @type {EntityComponentDataset}
|
|
51
|
+
*/
|
|
52
|
+
#dataset;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @type {GPUSceneRows|null}
|
|
56
|
+
*/
|
|
57
|
+
#rows = null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* How many times each entity is held here — by the system, and by every held entity hanging
|
|
61
|
+
* from it.
|
|
62
|
+
*
|
|
63
|
+
* @type {Map<number, number>}
|
|
64
|
+
*/
|
|
65
|
+
#holds = new Map();
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The entity each held entity holds through, or {@link NO_PARENT} at the top of a chain. What
|
|
69
|
+
* its attachment named when it was held, kept so the hold can be given back to the same parent
|
|
70
|
+
* after the attachment has gone.
|
|
71
|
+
*
|
|
72
|
+
* @type {Map<number, number>}
|
|
73
|
+
*/
|
|
74
|
+
#parent = new Map();
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @type {EntityObserver}
|
|
78
|
+
*/
|
|
79
|
+
#observer;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @param {EntityComponentDataset} dataset
|
|
83
|
+
*/
|
|
84
|
+
constructor(dataset) {
|
|
85
|
+
assert.defined(dataset, 'dataset');
|
|
86
|
+
assert.equal(dataset.isEntityComponentDataset, true, 'dataset.isEntityComponentDataset !== true');
|
|
87
|
+
|
|
88
|
+
this.#dataset = dataset;
|
|
89
|
+
|
|
90
|
+
// a scene with no attachment in it still has chains, each one entity long
|
|
91
|
+
dataset.registerComponentType(TransformAttachment);
|
|
92
|
+
|
|
93
|
+
this.#observer = new EntityObserver([TransformAttachment], this.#attached, this.#detached, this);
|
|
94
|
+
|
|
95
|
+
dataset.addObserver(this.#observer, false);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The rows the chains are held in, or null while there is no device.
|
|
100
|
+
*
|
|
101
|
+
* @returns {GPUSceneRows|null}
|
|
102
|
+
*/
|
|
103
|
+
get rows() {
|
|
104
|
+
return this.#rows;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Hold the chains in these rows from now on. Rows replaced by a restart took what they held
|
|
109
|
+
* with them, so nothing is given back to them; every held entity is acquired in the new ones.
|
|
110
|
+
*
|
|
111
|
+
* @param {GPUSceneRows|null} rows
|
|
112
|
+
*/
|
|
113
|
+
bind(rows) {
|
|
114
|
+
if (rows === this.#rows) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
this.#rows = rows;
|
|
119
|
+
|
|
120
|
+
if (rows === null) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
for (const entity of this.#holds.keys()) {
|
|
125
|
+
rows.acquire(entity);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Whether this holds the entity, for itself or for something hanging from it.
|
|
131
|
+
*
|
|
132
|
+
* @param {number} entity
|
|
133
|
+
* @returns {boolean}
|
|
134
|
+
*/
|
|
135
|
+
holds(entity) {
|
|
136
|
+
return this.#holds.has(entity);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Hold the entity's row and the rows of everything it hangs from. Every hold is matched by a
|
|
141
|
+
* {@link release}.
|
|
142
|
+
*
|
|
143
|
+
* @param {number} entity
|
|
144
|
+
*/
|
|
145
|
+
hold(entity) {
|
|
146
|
+
assert.isNonNegativeInteger(entity, 'entity');
|
|
147
|
+
|
|
148
|
+
const count = this.#holds.get(entity);
|
|
149
|
+
|
|
150
|
+
if (count !== undefined) {
|
|
151
|
+
this.#holds.set(entity, count + 1);
|
|
152
|
+
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
assert.ok(this.#dataset.entityExists(entity), `entity ${entity} does not exist`);
|
|
157
|
+
|
|
158
|
+
const parent = this.#parent_named(entity);
|
|
159
|
+
|
|
160
|
+
this.#holds.set(entity, 1);
|
|
161
|
+
this.#parent.set(entity, parent);
|
|
162
|
+
|
|
163
|
+
this.#follow(entity, parent);
|
|
164
|
+
|
|
165
|
+
if (this.#rows !== null) {
|
|
166
|
+
this.#rows.acquire(entity);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (parent !== NO_PARENT) {
|
|
170
|
+
this.hold(parent);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Let go of one hold. The last lets go of the entity's row and of the hold it had on its parent.
|
|
176
|
+
*
|
|
177
|
+
* @param {number} entity
|
|
178
|
+
*/
|
|
179
|
+
release(entity) {
|
|
180
|
+
const count = this.#holds.get(entity);
|
|
181
|
+
|
|
182
|
+
assert.defined(count, `entity ${entity} is not held`);
|
|
183
|
+
|
|
184
|
+
if (count > 1) {
|
|
185
|
+
this.#holds.set(entity, count - 1);
|
|
186
|
+
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const parent = this.#parent.get(entity);
|
|
191
|
+
|
|
192
|
+
this.#holds.delete(entity);
|
|
193
|
+
this.#parent.delete(entity);
|
|
194
|
+
|
|
195
|
+
this.#unfollow(entity, parent);
|
|
196
|
+
|
|
197
|
+
if (this.#rows !== null) {
|
|
198
|
+
this.#rows.release(entity);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (parent !== NO_PARENT) {
|
|
202
|
+
this.release(parent);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Let go of everything and stop watching the dataset.
|
|
208
|
+
*/
|
|
209
|
+
destroy() {
|
|
210
|
+
const rows = this.#rows;
|
|
211
|
+
|
|
212
|
+
for (const [entity, parent] of this.#parent) {
|
|
213
|
+
this.#unfollow(entity, parent);
|
|
214
|
+
|
|
215
|
+
if (rows !== null) {
|
|
216
|
+
rows.release(entity);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.#holds.clear();
|
|
221
|
+
this.#parent.clear();
|
|
222
|
+
|
|
223
|
+
this.#rows = null;
|
|
224
|
+
|
|
225
|
+
this.#dataset.removeObserver(this.#observer, false);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @param {number} entity
|
|
230
|
+
* @returns {number} the entity its attachment names, or {@link NO_PARENT}
|
|
231
|
+
*/
|
|
232
|
+
#parent_named(entity) {
|
|
233
|
+
const attachment = this.#dataset.getComponent(entity, TransformAttachment);
|
|
234
|
+
|
|
235
|
+
return attachment === undefined ? NO_PARENT : attachment.parent;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @param {number} entity
|
|
240
|
+
* @param {number} parent
|
|
241
|
+
*/
|
|
242
|
+
#follow(entity, parent) {
|
|
243
|
+
if (parent === NO_PARENT) {
|
|
244
|
+
this.#dataset.addEntityEventListener(entity, TRANSFORM64_EVENT_CHANGE, this.#world_moved, this);
|
|
245
|
+
} else {
|
|
246
|
+
this.#dataset.addEntityEventListener(entity, TRANSFORM_ATTACHMENT_EVENT_CHANGE, this.#offset_moved, this);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @param {number} entity
|
|
252
|
+
* @param {number} parent
|
|
253
|
+
*/
|
|
254
|
+
#unfollow(entity, parent) {
|
|
255
|
+
if (!this.#dataset.entityExists(entity)) {
|
|
256
|
+
// its listeners went with it
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (parent === NO_PARENT) {
|
|
261
|
+
this.#dataset.removeEntityEventListener(entity, TRANSFORM64_EVENT_CHANGE, this.#world_moved, this);
|
|
262
|
+
} else {
|
|
263
|
+
this.#dataset.removeEntityEventListener(entity, TRANSFORM_ATTACHMENT_EVENT_CHANGE, this.#offset_moved, this);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @param {*} event
|
|
269
|
+
* @param {number} entity
|
|
270
|
+
*/
|
|
271
|
+
#offset_moved(event, entity) {
|
|
272
|
+
if (this.#rows !== null) {
|
|
273
|
+
this.#rows.mark_local(entity);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* @param {*} event
|
|
279
|
+
* @param {number} entity
|
|
280
|
+
*/
|
|
281
|
+
#world_moved(event, entity) {
|
|
282
|
+
if (this.#rows !== null) {
|
|
283
|
+
this.#rows.mark_world(entity);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @param {TransformAttachment} attachment
|
|
289
|
+
* @param {number} entity
|
|
290
|
+
*/
|
|
291
|
+
#attached(attachment, entity) {
|
|
292
|
+
if (!this.#holds.has(entity)) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const previous = this.#parent.get(entity);
|
|
297
|
+
|
|
298
|
+
if (previous !== attachment.parent) {
|
|
299
|
+
this.#move(entity, previous, attachment.parent);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @param {TransformAttachment} attachment
|
|
305
|
+
* @param {number} entity
|
|
306
|
+
*/
|
|
307
|
+
#detached(attachment, entity) {
|
|
308
|
+
if (!this.#holds.has(entity)) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const previous = this.#parent.get(entity);
|
|
313
|
+
|
|
314
|
+
if (previous !== NO_PARENT) {
|
|
315
|
+
this.#move(entity, previous, NO_PARENT);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The entity hangs from another parent, or from none. The new chain is held before the old one
|
|
321
|
+
* is let go, so an ancestor the two share keeps its row throughout.
|
|
322
|
+
*
|
|
323
|
+
* @param {number} entity
|
|
324
|
+
* @param {number} previous
|
|
325
|
+
* @param {number} next
|
|
326
|
+
*/
|
|
327
|
+
#move(entity, previous, next) {
|
|
328
|
+
this.#unfollow(entity, previous);
|
|
329
|
+
|
|
330
|
+
this.#parent.set(entity, next);
|
|
331
|
+
|
|
332
|
+
this.#follow(entity, next);
|
|
333
|
+
|
|
334
|
+
if (next !== NO_PARENT) {
|
|
335
|
+
this.hold(next);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (previous !== NO_PARENT) {
|
|
339
|
+
this.release(previous);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (this.#rows !== null) {
|
|
343
|
+
// its row is written against the new parent, or as a world of its own
|
|
344
|
+
this.#rows.mark_local(entity);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
* on its component ({@link ShadedGeometryFlags.Skinned}) and draws a per-instance clone the
|
|
17
17
|
* skinning pass writes; the skin itself is the model's business.
|
|
18
18
|
*
|
|
19
|
+
* **A primitive holds the rows of everything it hangs from** ({@link RowChains}). Under a parent
|
|
20
|
+
* with no row it would carry its CPU world under the scene root, which stops moving the moment a
|
|
21
|
+
* clip drives a node above it — a rigid head under an animated tag is the common case. Holding the
|
|
22
|
+
* chain lets the GPU compose it from the top, and holds the tag's row, without which the clip never
|
|
23
|
+
* binds.
|
|
24
|
+
*
|
|
19
25
|
* **Rows need a device.** A primitive linked before the renderer has started, or after it has been
|
|
20
26
|
* replaced, waits: {@link update} notices the scene's GPU context arriving or changing and attaches
|
|
21
27
|
* everything it holds to it. Nothing about the entity is lost meanwhile — the component and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShadedGeometrySystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/ShadedGeometrySystem.js"],"names":[],"mappings":"AAgDA
|
|
1
|
+
{"version":3,"file":"ShadedGeometrySystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/ShadedGeometrySystem.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IAwCI;;;OAGG;IACH,sBAHW,cAAc,SACd,KAAK,EAYf;IADG,6DAAiD;IAGrD;;OAEG;IACH,iEAEC;IAED,2CAeC;IAED,4CAUC;IA4CD;;;;OAIG;IACH,eAJW,cAAc,aACd,WAAW,UACX,MAAM,QAgDhB;IAED;;;;OAIG;IACH,iBAJW,cAAc,aACd,WAAW,UACX,MAAM,QAOhB;;CAsDJ;8BA9TY,OAAO,+CAA+C,EAAE,eAAe;6BACvE,OAAO,qBAAqB,EAAE,cAAc;oBAC5C,OAAO,qCAAqC,EAAE,KAAK;uBAXzC,kBAAkB;4BACb,iCAAiC;+BAG9B,2CAA2C"}
|