@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prototypeEditorShell.d.ts","sourceRoot":"","sources":["../../editor/prototypeEditorShell.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prototypeEditorShell.d.ts","sourceRoot":"","sources":["../../editor/prototypeEditorShell.js"],"names":[],"mappings":"AAyLA;;;;;GAKG;AACH,2BAFU,QAAQ;IAAC,MAAM,SAAS;IAAC,MAAM,SAAS;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,UAAS;CAAC,CAAC,CAEzD"}
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
ShadedGeometrySystem
|
|
34
34
|
} from "../src/engine/graphics3/ShadedGeometrySystem.js";
|
|
35
|
+
import { MeshSkinSystem } from "../src/engine/graphics3/MeshSkinSystem.js";
|
|
35
36
|
import { GPUParticleEmitterSystem } from "../src/engine/graphics3/GPUParticleEmitterSystem.js";
|
|
36
37
|
import { enableEditor } from "./enableEditor.js";
|
|
37
38
|
|
|
@@ -96,9 +97,10 @@ async function addGraphicsSystems(engine) {
|
|
|
96
97
|
|
|
97
98
|
await em.addSystem(meshes);
|
|
98
99
|
|
|
99
|
-
// a model
|
|
100
|
-
// system that owns
|
|
100
|
+
// a model becomes entities: its primitives are drawn by the system that owns primitives
|
|
101
|
+
// (D47), and the skinned ones deformed by the system that owns skins
|
|
101
102
|
await em.addSystem(new ShadedGeometrySystem(engine.graphics, EngineHarness.shadeScene(engine)));
|
|
103
|
+
await em.addSystem(new MeshSkinSystem(engine.graphics, EngineHarness.shadeScene(engine)));
|
|
102
104
|
|
|
103
105
|
/*
|
|
104
106
|
One outline pass and both of its sources, because the editor offers a `Highlight` editor and
|
package/package.json
CHANGED
package/src/engine/Clock.d.ts
CHANGED
|
@@ -52,6 +52,21 @@ declare class Clock {
|
|
|
52
52
|
* @returns {number} in seconds
|
|
53
53
|
*/
|
|
54
54
|
getDelta(): number;
|
|
55
|
+
/**
|
|
56
|
+
* {@link getDelta}, measured to a given moment instead of to now - an animation frame's
|
|
57
|
+
* timestamp, so that the simulation shown by a frame is the simulation at that frame's time and
|
|
58
|
+
* not at whenever the code reading the clock happened to run.
|
|
59
|
+
*
|
|
60
|
+
* Only a moment between the clock's last reading and now can be measured to; anything else is
|
|
61
|
+
* measured to now. A frame's timestamp is when the frame began, so it can sit behind a reading
|
|
62
|
+
* taken earlier in that frame (a resume() from an input handler). And it is only on this
|
|
63
|
+
* clock's timeline where the environment keeps its promise that it is - jsdom stamps frames
|
|
64
|
+
* 1.5 s behind `performance.now()`, a `Date.now()` polyfill decades ahead - and measured to
|
|
65
|
+
* those, the clock froze or leapt.
|
|
66
|
+
* @param {number} time in seconds, on the {@link current_time_in_seconds} timeline
|
|
67
|
+
* @returns {number} in seconds
|
|
68
|
+
*/
|
|
69
|
+
getDeltaAt(time: number): number;
|
|
55
70
|
/**
|
|
56
71
|
*
|
|
57
72
|
* @returns {number} in seconds
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/engine/Clock.js"],"names":[],"mappings":";AAcA;;GAEG;AACH;IAEI;;;;OAIG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,oBAAoB;IAGpB;;;;;;OAMG;IACH,gBAHU,IAAI,CAGM;IAMpB;;;OAGG;IACH,0BAEC;IAED;;;OAGG;IACH,yBAEC;IAED,cAIC;IAED,aAEC;IAED,cAeC;IAED;;;OAGG;IACH,YAFa,MAAM,
|
|
1
|
+
{"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/engine/Clock.js"],"names":[],"mappings":";AAcA;;GAEG;AACH;IAEI;;;;OAIG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,oBAAoB;IAGpB;;;;;;OAMG;IACH,gBAHU,IAAI,CAGM;IAMpB;;;OAGG;IACH,0BAEC;IAED;;;OAGG;IACH,yBAEC;IAED,cAIC;IAED,aAEC;IAED,cAeC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;;OAaG;IACH,iBAHW,MAAM,GACJ,MAAM,CAalB;IAED;;;OAGG;IACH,qBAFa,MAAM,CAOlB;IAED;;;;OAIG;IACH,kBAFY,MAAM,CAIjB;IAED,cAGC;CACJ;iBAlKgB,4BAA4B"}
|
package/src/engine/Clock.js
CHANGED
|
@@ -4,9 +4,9 @@ import { current_time_in_seconds } from "../core/time/current_time_in_seconds.js
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @param {Clock} clock
|
|
7
|
+
* @param {number} now in seconds, on the {@link current_time_in_seconds} timeline
|
|
7
8
|
*/
|
|
8
|
-
function updateElapsedTime(clock) {
|
|
9
|
-
const now = current_time_in_seconds();
|
|
9
|
+
function updateElapsedTime(clock, now) {
|
|
10
10
|
const delta = (now - clock.__lastMeasurement) * clock.speed;
|
|
11
11
|
clock.__lastMeasurement = now;
|
|
12
12
|
clock.elapsedTime += delta;
|
|
@@ -98,7 +98,7 @@ class Clock {
|
|
|
98
98
|
|
|
99
99
|
this.__isRunning = false;
|
|
100
100
|
//update time
|
|
101
|
-
updateElapsedTime(this);
|
|
101
|
+
updateElapsedTime(this, current_time_in_seconds());
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -106,7 +106,31 @@ class Clock {
|
|
|
106
106
|
* @returns {number} in seconds
|
|
107
107
|
*/
|
|
108
108
|
getDelta() {
|
|
109
|
-
|
|
109
|
+
return this.getDeltaAt(current_time_in_seconds());
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* {@link getDelta}, measured to a given moment instead of to now - an animation frame's
|
|
114
|
+
* timestamp, so that the simulation shown by a frame is the simulation at that frame's time and
|
|
115
|
+
* not at whenever the code reading the clock happened to run.
|
|
116
|
+
*
|
|
117
|
+
* Only a moment between the clock's last reading and now can be measured to; anything else is
|
|
118
|
+
* measured to now. A frame's timestamp is when the frame began, so it can sit behind a reading
|
|
119
|
+
* taken earlier in that frame (a resume() from an input handler). And it is only on this
|
|
120
|
+
* clock's timeline where the environment keeps its promise that it is - jsdom stamps frames
|
|
121
|
+
* 1.5 s behind `performance.now()`, a `Date.now()` polyfill decades ahead - and measured to
|
|
122
|
+
* those, the clock froze or leapt.
|
|
123
|
+
* @param {number} time in seconds, on the {@link current_time_in_seconds} timeline
|
|
124
|
+
* @returns {number} in seconds
|
|
125
|
+
*/
|
|
126
|
+
getDeltaAt(time) {
|
|
127
|
+
if (this.__isRunning) {
|
|
128
|
+
const now = current_time_in_seconds();
|
|
129
|
+
|
|
130
|
+
updateElapsedTime(this, time >= this.__lastMeasurement && time <= now ? time : now);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const elapsedTime = this.elapsedTime;
|
|
110
134
|
const delta = elapsedTime - this.timeAtDelta;
|
|
111
135
|
this.timeAtDelta = elapsedTime;
|
|
112
136
|
return delta;
|
|
@@ -118,7 +142,7 @@ class Clock {
|
|
|
118
142
|
*/
|
|
119
143
|
updateElapsedTime() {
|
|
120
144
|
if (this.__isRunning) {
|
|
121
|
-
updateElapsedTime(this);
|
|
145
|
+
updateElapsedTime(this, current_time_in_seconds());
|
|
122
146
|
}
|
|
123
147
|
return this.elapsedTime;
|
|
124
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/engine/Engine.js"],"names":[],"mappings":";6BAqCa,OAAO,8BAA8B,EAAE,cAAc;AAwClE;
|
|
1
|
+
{"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/engine/Engine.js"],"names":[],"mappings":";6BAqCa,OAAO,8BAA8B,EAAE,cAAc;AAwClE;IA4FI;;;;;;;;;OASG;IACH,sBARW,cAAc;QAEU,aAAa,GAArC,aAAa;QACK,cAAc,GAAhC,OAAO;QACW,WAAW,GAA7B,OAAO;QACW,KAAK,GAAvB,OAAO;OAiPjB;IAtSD;;;OAGG;IACH,UAFU,cAAc,GAAC,IAAI,CAEb;IAEhB;;;OAGG;IACH,OAFU,WAAW,GAAC,IAAI,CAEb;IAEb,qBAA4B;IAE5B;;;;;;;;;OASG;IACH,0BAFU,uBAAuB,CAEe;IAEhD;;;OAGG;IACH,kBAFU,mBAAmB,CAEO;IAEpC;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,mBAFU,kBAAkB,CAEa;IAoBrC;;;OAGG;IACH,UAFU,cAAc,CAEA;IAKxB;;;OAGG;IACH,aAFU,gBAAgB,CAEe;IAGzC,yCAAkE;IAK9D,6BAAkC;IAMtC;;;OAGG;IACH,cAFU,aAAa,MAAM,CAAC,CAK5B;IAEF,8CAiCE;IAgCF;;;OAGG;IACH,SAFU,WAAW,CAEoB;IAEzC;;;OAGG;IACH,oCAA0C;IAE1C;;;OAGG;IACH,sCAFU,2BAA2B,CAE+B;IAEpE,yBAAoC;IAGpC;;OAEG;IACH,aAAkB;IAElB;;;OAGG;IACH,SAFU,OAAO,CAEwB;IAGzC,2BAAsC;IAuCtC;;;OAGG;IACH,KAFU,SAAS,CAEO;IAE1B;;;OAGG;IACH,uBAFU,YAAY,CAEqD;IAI3E;;;;;MAKC;IA8BD;;;OAGG;IACH,kBAFU,OAAO,CAEW;IAwIhC,wBAgCC;IApBG,oBAAwB;IAsB5B,2BA8CC;IAED,oBAiBC;IAED;;;OAGG;IACH,+CAUC;IAED,eAkDC;IAED;;;OAGG;IACH,sBA0GC;IAoBD;;OAEG;IACH,sBA+DC;IAED,aAEC;IAED;;OAEG;IACH,4BAOC;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;+BA94B8B,+BAA+B;wBAWtC,wBAAwB;0BArBtB,0CAA0C;wCAeN,iDAAiD;oCAG3E,iCAAiC;mBAElD,wBAAwB;+BAtBZ,gDAAgD;iCAO9C,+CAA+C;8BAGlD,wBAAwB;6BALzB,yBAAyB;uCAIf,6DAA6D;4BAUxE,0BAA0B;+BArBvB,iCAAiC;4CAapB,qDAAqD;AAgBjG;;GAEG;AAGH;IACI,gDAA2D;IAC3D,0BAAkC;IAClC,iCAAyC;CAC5C;6BAvC4B,sCAAsC;sBA4B7C,mBAAmB;yBAJhB,yBAAyB;8BALpB,kCAAkC;2BADrC,mCAAmC;8BAFhC,kCAAkC;8BAClC,kCAAkC;sBAb1C,+BAA+B;+BAKtB,qCAAqC;4BAPxC,kCAAkC;oBAH1C,yBAAyB"}
|
package/src/engine/Engine.js
CHANGED
|
@@ -86,11 +86,6 @@ class Engine {
|
|
|
86
86
|
*/
|
|
87
87
|
#last_render_simulation_time = 0;
|
|
88
88
|
|
|
89
|
-
/**
|
|
90
|
-
* Handle of the pending render-loop frame, `-1` when the loop is not running
|
|
91
|
-
* @type {number}
|
|
92
|
-
*/
|
|
93
|
-
#animation_frame_handle = -1;
|
|
94
89
|
|
|
95
90
|
/**
|
|
96
91
|
* Handle of the pending "pause the simulation, this outage is taking a while" timer, `-1` when none
|
|
@@ -699,14 +694,14 @@ class Engine {
|
|
|
699
694
|
scene's speed modifiers (see SceneManager), so a paused game holds its particles still
|
|
700
695
|
and a slowed one slows them. A wall-clock measurement would do neither.
|
|
701
696
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
697
|
+
Read, not advanced: a frame draws right after the ticker advanced the clock to the
|
|
698
|
+
frame's timestamp (see Ticker#onFrame), so this is the simulation time of the frame.
|
|
699
|
+
Advancing it here would step the renderer by however long that tick took to run.
|
|
705
700
|
|
|
706
701
|
Moved only when a frame is actually drawn, so simulation time that passes while
|
|
707
702
|
rendering is off is caught up by the next frame rather than lost.
|
|
708
703
|
*/
|
|
709
|
-
const simulation_time = this.ticker.clock.
|
|
704
|
+
const simulation_time = this.ticker.clock.getElapsedTime();
|
|
710
705
|
const time_delta_seconds = simulation_time - this.#last_render_simulation_time;
|
|
711
706
|
|
|
712
707
|
this.#last_render_simulation_time = simulation_time;
|
|
@@ -781,10 +776,9 @@ class Engine {
|
|
|
781
776
|
|
|
782
777
|
this.#last_frame_timestamp = performance.now();
|
|
783
778
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
this.#animation_frame_handle = requestAnimationFrame(this.#animation_frame);
|
|
779
|
+
// Drawn from the ticker's frame, after that frame's tick. A render loop of its own drew
|
|
780
|
+
// each frame before the tick, i.e. the simulation as of whenever the previous tick ran.
|
|
781
|
+
this.ticker.onFrame.add(this.#animation_frame);
|
|
788
782
|
|
|
789
783
|
//start simulation
|
|
790
784
|
this.ticker.start({ maxTimeout: 200 });
|
|
@@ -835,13 +829,12 @@ class Engine {
|
|
|
835
829
|
}
|
|
836
830
|
|
|
837
831
|
/**
|
|
838
|
-
* Fired every animation frame via {@link
|
|
832
|
+
* Fired every animation frame via {@link Ticker#onFrame}
|
|
839
833
|
*/
|
|
840
834
|
#animation_frame = () => {
|
|
841
835
|
|
|
842
836
|
const t0 = this.#last_frame_timestamp;
|
|
843
837
|
const t1 = performance.now();
|
|
844
|
-
this.#animation_frame_handle = requestAnimationFrame(this.#animation_frame);
|
|
845
838
|
this.render();
|
|
846
839
|
|
|
847
840
|
const frame_delay = (t1 - t0) / 1000;
|
|
@@ -865,10 +858,9 @@ class Engine {
|
|
|
865
858
|
// running, which would abort the whole teardown below
|
|
866
859
|
this.ticker.stop();
|
|
867
860
|
|
|
868
|
-
//
|
|
869
|
-
//
|
|
870
|
-
|
|
871
|
-
this.#animation_frame_handle = -1;
|
|
861
|
+
// which also ends the render loop, as it draws from the ticker's frames. Unsubscribed too,
|
|
862
|
+
// so a restart does not draw twice per frame
|
|
863
|
+
this.ticker.onFrame.remove(this.#animation_frame);
|
|
872
864
|
|
|
873
865
|
// the input devices the constructor started. The gamepad one polls on its own animation
|
|
874
866
|
// frame loop, so left alone it outlives the engine the same way the render loop would;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the geometry on this entity deforms: the joints its vertices are weighted to, as entities,
|
|
3
|
+
* and where each joint stood when the mesh was bound to it.
|
|
4
|
+
*
|
|
5
|
+
* **It describes the mesh, so it lives on the mesh entity.** The geometry's per-vertex joint indices
|
|
6
|
+
* index {@link joints}, and an inverse bind belongs to the pair (this mesh, that joint) — one joint
|
|
7
|
+
* can bind with different matrices in different skins. The joints are entities like any other: a
|
|
8
|
+
* clip, IK, a ragdoll or a cloth moves them, and the skin follows.
|
|
9
|
+
*
|
|
10
|
+
* The geometry beside it says it draws a deformed clone (`ShadedGeometryFlags.Skinned`); without
|
|
11
|
+
* that it draws the shared source and nothing would deform. `MeshSkinSystem` deforms it; a model
|
|
12
|
+
* loaded by `MeshSystem` carries one on each skinned primitive, and code builds one the same way.
|
|
13
|
+
*
|
|
14
|
+
* **Replaced, never edited.** A skin is registered once with the joints and matrices it has then;
|
|
15
|
+
* to change either, take the component off and put another on. Meshes of one model that share a
|
|
16
|
+
* skeleton and bind it the same way — a body and its hair — share one registration on the GPU,
|
|
17
|
+
* whether or not they share the arrays.
|
|
18
|
+
*
|
|
19
|
+
* **Not saved**, for the reason {@link ShadedGeometry} is not: the joint indices address the vertex
|
|
20
|
+
* attribute of a geometry no save holds, so whatever builds the geometry builds its skin.
|
|
21
|
+
*
|
|
22
|
+
* @author Alex Goldring
|
|
23
|
+
* @copyright Company Named Limited (c) 2026
|
|
24
|
+
*/
|
|
25
|
+
export class MeshSkin {
|
|
26
|
+
/**
|
|
27
|
+
* @param {Int32Array} joints entities
|
|
28
|
+
* @param {Float32Array} inverse_bind_matrices `joints.length` × 16
|
|
29
|
+
* @returns {MeshSkin}
|
|
30
|
+
*/
|
|
31
|
+
static from(joints: Int32Array, inverse_bind_matrices: Float32Array): MeshSkin;
|
|
32
|
+
/**
|
|
33
|
+
* The joints, as entities, in the order the geometry's per-vertex joint indices address them.
|
|
34
|
+
* Read-only once the component is on an entity.
|
|
35
|
+
*
|
|
36
|
+
* @type {Int32Array}
|
|
37
|
+
*/
|
|
38
|
+
joints: Int32Array;
|
|
39
|
+
/**
|
|
40
|
+
* `joints.length` × 16 column-major matrices, flat: joint `j`'s at `[j * 16, j * 16 + 16)`, taking
|
|
41
|
+
* a vertex from the mesh's frame into the joint's at bind. Read-only, and shared — a model's
|
|
42
|
+
* placements all hold the one array their prefab compiled.
|
|
43
|
+
*
|
|
44
|
+
* @type {Float32Array}
|
|
45
|
+
*/
|
|
46
|
+
inverse_bind_matrices: Float32Array;
|
|
47
|
+
/**
|
|
48
|
+
* @readonly
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
readonly isMeshSkin: boolean;
|
|
52
|
+
}
|
|
53
|
+
export namespace MeshSkin {
|
|
54
|
+
let typeName: string;
|
|
55
|
+
let serializable: boolean;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=MeshSkin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeshSkin.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/mesh-v2/MeshSkin.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IAkBI;;;;OAIG;IACH,oBAJW,UAAU,yBACV,YAAY,GACV,QAAQ,CAiBpB;IArCD;;;;;OAKG;IACH,QAFU,UAAU,CAEO;IAE3B;;;;;;OAMG;IACH,uBAFU,YAAY,CAEsB;IAyBhD;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAN5B;;kBAUS,MAAM;sBAMN,OAAO"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How the geometry on this entity deforms: the joints its vertices are weighted to, as entities,
|
|
5
|
+
* and where each joint stood when the mesh was bound to it.
|
|
6
|
+
*
|
|
7
|
+
* **It describes the mesh, so it lives on the mesh entity.** The geometry's per-vertex joint indices
|
|
8
|
+
* index {@link joints}, and an inverse bind belongs to the pair (this mesh, that joint) — one joint
|
|
9
|
+
* can bind with different matrices in different skins. The joints are entities like any other: a
|
|
10
|
+
* clip, IK, a ragdoll or a cloth moves them, and the skin follows.
|
|
11
|
+
*
|
|
12
|
+
* The geometry beside it says it draws a deformed clone (`ShadedGeometryFlags.Skinned`); without
|
|
13
|
+
* that it draws the shared source and nothing would deform. `MeshSkinSystem` deforms it; a model
|
|
14
|
+
* loaded by `MeshSystem` carries one on each skinned primitive, and code builds one the same way.
|
|
15
|
+
*
|
|
16
|
+
* **Replaced, never edited.** A skin is registered once with the joints and matrices it has then;
|
|
17
|
+
* to change either, take the component off and put another on. Meshes of one model that share a
|
|
18
|
+
* skeleton and bind it the same way — a body and its hair — share one registration on the GPU,
|
|
19
|
+
* whether or not they share the arrays.
|
|
20
|
+
*
|
|
21
|
+
* **Not saved**, for the reason {@link ShadedGeometry} is not: the joint indices address the vertex
|
|
22
|
+
* attribute of a geometry no save holds, so whatever builds the geometry builds its skin.
|
|
23
|
+
*
|
|
24
|
+
* @author Alex Goldring
|
|
25
|
+
* @copyright Company Named Limited (c) 2026
|
|
26
|
+
*/
|
|
27
|
+
export class MeshSkin {
|
|
28
|
+
/**
|
|
29
|
+
* The joints, as entities, in the order the geometry's per-vertex joint indices address them.
|
|
30
|
+
* Read-only once the component is on an entity.
|
|
31
|
+
*
|
|
32
|
+
* @type {Int32Array}
|
|
33
|
+
*/
|
|
34
|
+
joints = new Int32Array(0);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* `joints.length` × 16 column-major matrices, flat: joint `j`'s at `[j * 16, j * 16 + 16)`, taking
|
|
38
|
+
* a vertex from the mesh's frame into the joint's at bind. Read-only, and shared — a model's
|
|
39
|
+
* placements all hold the one array their prefab compiled.
|
|
40
|
+
*
|
|
41
|
+
* @type {Float32Array}
|
|
42
|
+
*/
|
|
43
|
+
inverse_bind_matrices = new Float32Array(0);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {Int32Array} joints entities
|
|
47
|
+
* @param {Float32Array} inverse_bind_matrices `joints.length` × 16
|
|
48
|
+
* @returns {MeshSkin}
|
|
49
|
+
*/
|
|
50
|
+
static from(joints, inverse_bind_matrices) {
|
|
51
|
+
assert.equal(joints instanceof Int32Array, true, 'joints must be an Int32Array of entities');
|
|
52
|
+
assert.greaterThanOrEqual(joints.length, 1, 'a skin has at least one joint');
|
|
53
|
+
assert.equal(inverse_bind_matrices instanceof Float32Array, true, 'inverse_bind_matrices must be a Float32Array');
|
|
54
|
+
assert.equal(
|
|
55
|
+
inverse_bind_matrices.length, joints.length * 16,
|
|
56
|
+
'inverse_bind_matrices.length !== joints.length * 16'
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const r = new MeshSkin();
|
|
60
|
+
|
|
61
|
+
r.joints = joints;
|
|
62
|
+
r.inverse_bind_matrices = inverse_bind_matrices;
|
|
63
|
+
|
|
64
|
+
return r;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @readonly
|
|
70
|
+
* @type {boolean}
|
|
71
|
+
*/
|
|
72
|
+
MeshSkin.prototype.isMeshSkin = true;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @readonly
|
|
76
|
+
* @type {string}
|
|
77
|
+
*/
|
|
78
|
+
MeshSkin.typeName = "MeshSkin";
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @readonly
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
*/
|
|
84
|
+
MeshSkin.serializable = false;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Drives every entity's {@link AnimationGraphController}: runs its clock, and tells the renderer
|
|
3
3
|
* what its clips weigh and where they are playing.
|
|
4
4
|
*
|
|
5
|
+
* **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
|
|
6
|
+
* components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
|
|
7
|
+
* clips are a new component, which this system sees as the entity leaving and coming back.
|
|
8
|
+
*
|
|
5
9
|
* **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
|
|
6
10
|
* itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
|
|
7
11
|
* clip's time is written down each frame from the controller's own clock. That is I-4: the pose
|
|
@@ -10,33 +14,38 @@
|
|
|
10
14
|
*
|
|
11
15
|
* **Nothing here is culled.** The legacy system skipped entities smaller than 32 px², which let
|
|
12
16
|
* camera framing decide whether a footstep effect or an ability release ever happened. The clock and
|
|
13
|
-
* its notifications are gameplay and run for every entity whose
|
|
17
|
+
* its notifications are gameplay and run for every entity whose clips have arrived; what may be
|
|
14
18
|
* culled is drawing, and drawing is Shade's to cull.
|
|
15
19
|
*/
|
|
16
20
|
export class AnimationGraphSystem extends System<any> {
|
|
17
21
|
/**
|
|
18
22
|
* @param {GraphicsEngine} graphics
|
|
19
|
-
* @param {
|
|
23
|
+
* @param {Scene} scene
|
|
20
24
|
*/
|
|
21
|
-
constructor(graphics: GraphicsEngine,
|
|
22
|
-
dependencies: (typeof
|
|
25
|
+
constructor(graphics: GraphicsEngine, scene: Scene);
|
|
26
|
+
dependencies: (typeof AnimationGraphController | typeof AnimationClips)[];
|
|
23
27
|
components_used: ResourceAccessSpecification<typeof AnimationGraphController>[];
|
|
24
28
|
/**
|
|
29
|
+
* Only noted here: the graph is bound to the clips by the next {@link update}. A link can happen
|
|
30
|
+
* anywhere the components are added — inside a model's spawn, for one `MeshSystem` loads — and a
|
|
31
|
+
* graph naming a clip the entity has not got throws, which belongs in this system's tick and not
|
|
32
|
+
* in whoever added the component.
|
|
33
|
+
*
|
|
25
34
|
* @param {AnimationGraphController} controller
|
|
26
|
-
* @param {
|
|
35
|
+
* @param {AnimationClips} clips
|
|
27
36
|
* @param {number} entity
|
|
28
37
|
*/
|
|
29
|
-
link(controller: AnimationGraphController,
|
|
38
|
+
link(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
|
|
30
39
|
/**
|
|
31
|
-
* What the entity
|
|
32
|
-
*
|
|
40
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip
|
|
41
|
+
* **this graph names**, at the weight and the time the renderer has been given.
|
|
33
42
|
*
|
|
34
43
|
* **The clips the graph does not name are not here, because they are not registered** (D37).
|
|
35
44
|
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
36
45
|
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
37
46
|
* leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
|
|
38
47
|
* the same mistake; it is not to bind them. What the graph never names, nothing plays, and the
|
|
39
|
-
* joints it alone would have driven stay where
|
|
48
|
+
* joints it alone would have driven stay where they rest.
|
|
40
49
|
*
|
|
41
50
|
* A clip the graph names but is not currently playing **is** here, at weight zero, because it is
|
|
42
51
|
* bound and the accumulator does see it.
|
|
@@ -47,21 +56,22 @@ export class AnimationGraphSystem extends System<any> {
|
|
|
47
56
|
* @param {PosePlayback[]} target appended to
|
|
48
57
|
* @param {number} entity
|
|
49
58
|
* @returns {boolean} whether this system is driving the entity — `false` for one with no
|
|
50
|
-
* {@link AnimationGraphController}, and for one whose
|
|
59
|
+
* {@link AnimationGraphController} or no {@link AnimationClips}, and for one whose clips arrived
|
|
60
|
+
* since the last update
|
|
51
61
|
*/
|
|
52
62
|
write_pose_playbacks(target: PosePlayback[], entity: number): boolean;
|
|
53
63
|
/**
|
|
54
64
|
* @param {AnimationGraphController} controller
|
|
55
|
-
* @param {
|
|
65
|
+
* @param {AnimationClips} clips
|
|
56
66
|
* @param {number} entity
|
|
57
67
|
*/
|
|
58
|
-
unlink(controller: AnimationGraphController,
|
|
68
|
+
unlink(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
|
|
59
69
|
shutdown(entityManager: any): Promise<void>;
|
|
60
70
|
#private;
|
|
61
71
|
}
|
|
62
72
|
import { System } from "../ecs/System.js";
|
|
63
|
-
import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
|
|
64
73
|
import { AnimationGraphController } from "./animation/AnimationGraphController.js";
|
|
74
|
+
import { AnimationClips } from "./animation/AnimationClips.js";
|
|
65
75
|
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
|
|
66
76
|
import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
|
|
67
77
|
//# sourceMappingURL=AnimationGraphSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationGraphSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationGraphSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationGraphSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationGraphSystem.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAkBI;;;OAGG;IACH,oDAgBC;IAPG,0EAA8D;IAI9D,gFAEC;IAGL;;;;;;;;;OASG;IACH,iBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAchB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,6BANW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAgDnB;IAED;;;;OAIG;IACH,mBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAYhB;IAED,4CAQC;;CAkJJ;uBAzUsB,kBAAkB;yCAEA,yCAAyC;+BADnD,+BAA+B;4CAHlB,iDAAiD;6BAChE,qDAAqD"}
|