@woosh/meep-engine 3.43.0 → 3.45.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/build/bundle-worker-terrain.js +1 -1
- package/editor/prototypeEditorShell.d.ts.map +1 -1
- package/editor/prototypeEditorShell.js +4 -2
- package/package.json +1 -1
- package/src/core/collection/array/array_sort_insertion_ascending.d.ts +19 -0
- package/src/core/collection/array/array_sort_insertion_ascending.d.ts.map +1 -0
- package/src/core/collection/array/array_sort_insertion_ascending.js +31 -0
- package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts +27 -0
- package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.js +39 -0
- package/src/core/geom/3d/aabb/aabb3_from_v3_array.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +4 -1
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +2 -2
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +1 -1
- package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts +21 -0
- package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.js +36 -0
- package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts +25 -0
- package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_apply_point_array.js +40 -0
- package/src/core/geom/3d/pose/pose3_compose_array.d.ts +28 -0
- package/src/core/geom/3d/pose/pose3_compose_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_compose_array.js +41 -0
- package/src/core/geom/3d/pose/pose3_to_local_array.d.ts +29 -0
- package/src/core/geom/3d/pose/pose3_to_local_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_to_local_array.js +42 -0
- package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts +28 -0
- package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.js +66 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts +22 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.js +30 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts +23 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.js +31 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts +26 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js +46 -0
- package/src/core/geom/vec3/v3_distance_array.d.ts +11 -0
- package/src/core/geom/vec3/v3_distance_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_distance_array.js +19 -0
- package/src/core/geom/vec3/v3_normalize_array_checked.d.ts +23 -0
- package/src/core/geom/vec3/v3_normalize_array_checked.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_normalize_array_checked.js +49 -0
- package/src/core/geom/vec3/v3_reject_array.d.ts +15 -0
- package/src/core/geom/vec3/v3_reject_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_reject_array.js +32 -0
- package/src/core/graph/csr/csr_build_incidence.d.ts +26 -0
- package/src/core/graph/csr/csr_build_incidence.d.ts.map +1 -0
- package/src/core/graph/csr/csr_build_incidence.js +71 -0
- package/src/core/graph/csr/csr_graph_color_greedy.d.ts +25 -0
- package/src/core/graph/csr/csr_graph_color_greedy.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_color_greedy.js +83 -0
- package/src/core/graph/csr/csr_graph_validate_coloring.d.ts +15 -0
- package/src/core/graph/csr/csr_graph_validate_coloring.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_validate_coloring.js +33 -0
- package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts +26 -0
- package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts.map +1 -0
- package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.js +71 -0
- package/src/core/math/max2_exact.d.ts +15 -0
- package/src/core/math/max2_exact.d.ts.map +1 -0
- package/src/core/math/max2_exact.js +30 -0
- package/src/core/math/min2_exact.d.ts +20 -0
- package/src/core/math/min2_exact.d.ts.map +1 -0
- package/src/core/math/min2_exact.js +35 -0
- 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/ecs/ik/IKGoalSystem.d.ts.map +1 -1
- package/src/engine/ecs/ik/IKGoalSystem.js +3 -19
- package/src/engine/ecs/parent/parent_entity_model_of.d.ts +17 -0
- package/src/engine/ecs/parent/parent_entity_model_of.d.ts.map +1 -0
- package/src/engine/ecs/parent/parent_entity_model_of.js +26 -0
- package/src/engine/ecs/transform/t64_read_pose_array.d.ts +15 -0
- package/src/engine/ecs/transform/t64_read_pose_array.d.ts.map +1 -0
- package/src/engine/ecs/transform/t64_read_pose_array.js +24 -0
- 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/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts +2 -0
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map +1 -1
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js +10 -21
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +28 -13
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.js +107 -64
- package/src/engine/graphics3/AnimationSystem.d.ts +29 -15
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem.js +112 -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 +93 -0
- package/src/engine/graphics3/register_clips.d.ts.map +1 -0
- package/src/engine/graphics3/register_clips.js +166 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +9 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +3 -1
- package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
- package/src/engine/physics/cloth/PLAN.md +349 -17
- 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 +44 -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 +107 -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 +371 -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 +275 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +7 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/ClothColliderIndex.js +85 -67
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +19 -101
- package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +2 -5
- package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_pack.js +7 -15
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +17 -62
- 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/ClothColliderFlags.d.ts +0 -1
- package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +6 -19
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +1 -2
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +3 -12
- 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 +754 -207
- 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 +297 -101
- 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 +12 -10
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +60 -120
- 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 +135 -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 +583 -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 +168 -51
- 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 +51 -42
- 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 +62 -50
- 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/cloth_playground_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/cloth_playground_build.js +2 -3
- package/src/engine/physics/cloth/playground/collide_main.js +3 -29
- 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 +5 -20
- package/src/engine/physics/cloth/playground/main.js +6 -48
- 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/playground/rig_main.js +947 -955
- package/src/engine/physics/cloth/playground/wind_main.js +8 -7
- 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 +79 -83
- package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts +10 -8
- package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_color_particles.js +30 -102
- 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 +9 -3
- 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 +350 -0
- package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts +21 -0
- package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_kinetic_energy.js +45 -0
- package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts +32 -0
- package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_particle_coupling.js +133 -0
- package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts +16 -0
- package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_particle_of_source.js +19 -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 +19 -68
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +30 -65
- 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 +189 -48
- 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 +12 -6
- package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts +21 -0
- package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_stretch_residual.js +54 -0
- package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts +15 -0
- package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.js +28 -0
- package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts +30 -0
- package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.js +56 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +3 -17
- 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/ClothFluidWind.d.ts +2 -1
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -25
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +12 -10
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/cloth_sample_air.js +60 -82
- package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/ContactProbeSystem.js +2 -18
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +9 -50
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts +24 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.js +42 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts +25 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.js +40 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -1
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +40 -90
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/capsule_contacts.js +3 -5
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +2 -14
- package/src/engine/physics/narrowphase/hull_sphere_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/hull_sphere_contact.js +2 -5
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/narrowphase_step.js +13 -32
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/sphere_box_contact.js +2 -5
- 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/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/etc1s_to_astc.js +2 -1
- package/src/shade/RENDERER_CONTRACT.md +8 -2
- package/src/shade/playground/image_decode_bench/main.js +2 -1
- package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.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/skinned_mesh_soup/verify_clone_vertices.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +2 -1
- package/src/shade/playground/ssr_variance/statistics.d.ts.map +1 -1
- package/src/shade/playground/ssr_variance/statistics.js +2 -1
- package/src/shade/playground/texture_encode/README.md +129 -109
- package/src/shade/playground/texture_encode/main.d.ts.map +1 -1
- package/src/shade/playground/texture_encode/main.js +1431 -1430
- package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
- package/src/shade/playground/volumetrics_froxel/measure.js +2 -1
- 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/buffer/table/gpu_database_check_links.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/gpu_database_check_links.js +2 -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/build/level/vgeo_build_group_step.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +3 -2
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js +3 -2
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js +2 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +3 -2
- 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/optimizer/dag/particle_vector_extract.d.ts.map +1 -1
- package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.js +3 -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
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
* to synthesise some arbitrary unit vector and hand it over as though it were a
|
|
18
18
|
* measurement.
|
|
19
19
|
*
|
|
20
|
+
* An indexed form of {@link tri3_compute_normal_area_weighted_array}, which holds the arithmetic.
|
|
21
|
+
*
|
|
20
22
|
* Single-face callers — a raycast normal, a plane side test — want
|
|
21
23
|
* {@link geometry_construct_triangle_normal} instead.
|
|
22
24
|
*
|
package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry_construct_triangle_normal_area_weighted.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geometry_construct_triangle_normal_area_weighted.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,sEARW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,GACnB,IAAI,CAShB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { tri3_compute_normal_area_weighted_array } from "../../../core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* The face normal of an indexed triangle, NOT normalised — the raw
|
|
3
5
|
* `(c - b) × (a - b)`, whose magnitude is twice the triangle's area.
|
|
@@ -17,6 +19,8 @@
|
|
|
17
19
|
* to synthesise some arbitrary unit vector and hand it over as though it were a
|
|
18
20
|
* measurement.
|
|
19
21
|
*
|
|
22
|
+
* An indexed form of {@link tri3_compute_normal_area_weighted_array}, which holds the arithmetic.
|
|
23
|
+
*
|
|
20
24
|
* Single-face callers — a raycast normal, a plane side test — want
|
|
21
25
|
* {@link geometry_construct_triangle_normal} instead.
|
|
22
26
|
*
|
|
@@ -29,25 +33,10 @@
|
|
|
29
33
|
* @returns {void}
|
|
30
34
|
*/
|
|
31
35
|
export function geometry_construct_triangle_normal_area_weighted(out, out_offset, a, b, c, positions) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const by = positions[b_address + 1];
|
|
39
|
-
const bz = positions[b_address + 2];
|
|
40
|
-
|
|
41
|
-
const cb_x = positions[c_address] - bx;
|
|
42
|
-
const cb_y = positions[c_address + 1] - by;
|
|
43
|
-
const cb_z = positions[c_address + 2] - bz;
|
|
44
|
-
|
|
45
|
-
const ab_x = positions[a_address] - bx;
|
|
46
|
-
const ab_y = positions[a_address + 1] - by;
|
|
47
|
-
const ab_z = positions[a_address + 2] - bz;
|
|
48
|
-
|
|
49
|
-
// the same winding `tri3_compute_normal` uses, so the direction agrees
|
|
50
|
-
out[out_offset] = cb_y * ab_z - cb_z * ab_y;
|
|
51
|
-
out[out_offset + 1] = cb_z * ab_x - cb_x * ab_z;
|
|
52
|
-
out[out_offset + 2] = cb_x * ab_y - cb_y * ab_x;
|
|
36
|
+
tri3_compute_normal_area_weighted_array(
|
|
37
|
+
out, out_offset,
|
|
38
|
+
positions, a * 3,
|
|
39
|
+
positions, b * 3,
|
|
40
|
+
positions, c * 3
|
|
41
|
+
);
|
|
53
42
|
}
|
|
@@ -2,6 +2,14 @@
|
|
|
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
|
+
*
|
|
9
|
+
* **Every node the clips key holds a row here** ({@link hold_clip_targets}), from the graph being
|
|
10
|
+
* bound to the clips until they go. A clip binds only once all of them do, and a keyed node outside
|
|
11
|
+
* every skin with nothing drawn under it — a socket, say — is held by no other system.
|
|
12
|
+
*
|
|
5
13
|
* **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
|
|
6
14
|
* itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
|
|
7
15
|
* clip's time is written down each frame from the controller's own clock. That is I-4: the pose
|
|
@@ -10,33 +18,38 @@
|
|
|
10
18
|
*
|
|
11
19
|
* **Nothing here is culled.** The legacy system skipped entities smaller than 32 px², which let
|
|
12
20
|
* 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
|
|
21
|
+
* its notifications are gameplay and run for every entity whose clips have arrived; what may be
|
|
14
22
|
* culled is drawing, and drawing is Shade's to cull.
|
|
15
23
|
*/
|
|
16
24
|
export class AnimationGraphSystem extends System<any> {
|
|
17
25
|
/**
|
|
18
26
|
* @param {GraphicsEngine} graphics
|
|
19
|
-
* @param {
|
|
27
|
+
* @param {Scene} scene
|
|
20
28
|
*/
|
|
21
|
-
constructor(graphics: GraphicsEngine,
|
|
22
|
-
dependencies: (typeof
|
|
29
|
+
constructor(graphics: GraphicsEngine, scene: Scene);
|
|
30
|
+
dependencies: (typeof AnimationGraphController | typeof AnimationClips)[];
|
|
23
31
|
components_used: ResourceAccessSpecification<typeof AnimationGraphController>[];
|
|
24
32
|
/**
|
|
33
|
+
* Only noted here: the graph is bound to the clips by the next {@link update}. A link can happen
|
|
34
|
+
* anywhere the components are added — inside a model's spawn, for one `MeshSystem` loads — and a
|
|
35
|
+
* graph naming a clip the entity has not got throws, which belongs in this system's tick and not
|
|
36
|
+
* in whoever added the component.
|
|
37
|
+
*
|
|
25
38
|
* @param {AnimationGraphController} controller
|
|
26
|
-
* @param {
|
|
39
|
+
* @param {AnimationClips} clips
|
|
27
40
|
* @param {number} entity
|
|
28
41
|
*/
|
|
29
|
-
link(controller: AnimationGraphController,
|
|
42
|
+
link(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
|
|
30
43
|
/**
|
|
31
|
-
* What the entity
|
|
32
|
-
*
|
|
44
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip
|
|
45
|
+
* **this graph names**, at the weight and the time the renderer has been given.
|
|
33
46
|
*
|
|
34
47
|
* **The clips the graph does not name are not here, because they are not registered** (D37).
|
|
35
48
|
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
36
49
|
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
37
50
|
* leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
|
|
38
51
|
* 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
|
|
52
|
+
* joints it alone would have driven stay where they rest.
|
|
40
53
|
*
|
|
41
54
|
* A clip the graph names but is not currently playing **is** here, at weight zero, because it is
|
|
42
55
|
* bound and the accumulator does see it.
|
|
@@ -47,21 +60,23 @@ export class AnimationGraphSystem extends System<any> {
|
|
|
47
60
|
* @param {PosePlayback[]} target appended to
|
|
48
61
|
* @param {number} entity
|
|
49
62
|
* @returns {boolean} whether this system is driving the entity — `false` for one with no
|
|
50
|
-
* {@link AnimationGraphController}, and for one whose
|
|
63
|
+
* {@link AnimationGraphController} or no {@link AnimationClips}, and for one whose clips arrived
|
|
64
|
+
* since the last update
|
|
51
65
|
*/
|
|
52
66
|
write_pose_playbacks(target: PosePlayback[], entity: number): boolean;
|
|
53
67
|
/**
|
|
54
68
|
* @param {AnimationGraphController} controller
|
|
55
|
-
* @param {
|
|
69
|
+
* @param {AnimationClips} clips
|
|
56
70
|
* @param {number} entity
|
|
57
71
|
*/
|
|
58
|
-
unlink(controller: AnimationGraphController,
|
|
72
|
+
unlink(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
|
|
73
|
+
startup(entityManager: any): Promise<void>;
|
|
59
74
|
shutdown(entityManager: any): Promise<void>;
|
|
60
75
|
#private;
|
|
61
76
|
}
|
|
62
77
|
import { System } from "../ecs/System.js";
|
|
63
|
-
import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
|
|
64
78
|
import { AnimationGraphController } from "./animation/AnimationGraphController.js";
|
|
79
|
+
import { AnimationClips } from "./animation/AnimationClips.js";
|
|
65
80
|
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
|
|
66
81
|
import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
|
|
67
82
|
//# 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":"AAWA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAyBI;;;OAGG;IACH,oDAgBC;IAPG,0EAA8D;IAI9D,gFAEC;IAGL;;;;;;;;;OASG;IACH,iBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAehB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,6BANW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAgDnB;IAED;;;;OAIG;IACH,mBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAkBhB;IAED,2CAaC;IAED,4CAWC;;CA2JJ;uBAvXsB,kBAAkB;yCAEA,yCAAyC;+BADnD,+BAA+B;4CAHlB,iDAAiD;6BAChE,qDAAqD"}
|
|
@@ -3,18 +3,24 @@ import { ResourceAccessKind } from "../../core/model/ResourceAccessKind.js";
|
|
|
3
3
|
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
|
|
4
4
|
import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
|
|
5
5
|
import { System } from "../ecs/System.js";
|
|
6
|
-
import {
|
|
6
|
+
import { AnimationClips } from "./animation/AnimationClips.js";
|
|
7
7
|
import { AnimationGraphController } from "./animation/AnimationGraphController.js";
|
|
8
8
|
import { write_graph_playback } from "./animation/write_graph_playback.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
unregister_instance_clips
|
|
12
|
-
} from "./register_instance_animation.js";
|
|
9
|
+
import { hold_clip_targets, register_clips, release_clip_targets, unregister_clips } from "./register_clips.js";
|
|
10
|
+
import { RowChains } from "./RowChains.js";
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* Drives every entity's {@link AnimationGraphController}: runs its clock, and tells the renderer
|
|
16
14
|
* what its clips weigh and where they are playing.
|
|
17
15
|
*
|
|
16
|
+
* **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
|
|
17
|
+
* components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
|
|
18
|
+
* clips are a new component, which this system sees as the entity leaving and coming back.
|
|
19
|
+
*
|
|
20
|
+
* **Every node the clips key holds a row here** ({@link hold_clip_targets}), from the graph being
|
|
21
|
+
* bound to the clips until they go. A clip binds only once all of them do, and a keyed node outside
|
|
22
|
+
* every skin with nothing drawn under it — a socket, say — is held by no other system.
|
|
23
|
+
*
|
|
18
24
|
* **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
|
|
19
25
|
* itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
|
|
20
26
|
* clip's time is written down each frame from the controller's own clock. That is I-4: the pose
|
|
@@ -23,7 +29,7 @@ import {
|
|
|
23
29
|
*
|
|
24
30
|
* **Nothing here is culled.** The legacy system skipped entities smaller than 32 px², which let
|
|
25
31
|
* camera framing decide whether a footstep effect or an ability release ever happened. The clock and
|
|
26
|
-
* its notifications are gameplay and run for every entity whose
|
|
32
|
+
* its notifications are gameplay and run for every entity whose clips have arrived; what may be
|
|
27
33
|
* culled is drawing, and drawing is Shade's to cull.
|
|
28
34
|
*/
|
|
29
35
|
export class AnimationGraphSystem extends System {
|
|
@@ -33,32 +39,38 @@ export class AnimationGraphSystem extends System {
|
|
|
33
39
|
#graphics;
|
|
34
40
|
|
|
35
41
|
/**
|
|
36
|
-
* The
|
|
37
|
-
* for them.
|
|
42
|
+
* The scene whose GPU context issues the clip ids.
|
|
38
43
|
*
|
|
39
|
-
* @type {
|
|
44
|
+
* @type {Scene}
|
|
40
45
|
*/
|
|
41
|
-
#
|
|
46
|
+
#scene;
|
|
42
47
|
|
|
43
48
|
/**
|
|
44
|
-
* @type {Map<number, {controller: AnimationGraphController,
|
|
49
|
+
* @type {Map<number, {controller: AnimationGraphController, clips: ShadeAnimationClip[], bound: boolean, held: boolean, clip_registration: ClipRegistration|null, slots: Int32Array, played_slots: Int32Array, clip_ids: Int32Array, weights: Float32Array, poses: PosePlayback[]}>}
|
|
45
50
|
*/
|
|
46
51
|
#entries = new Map();
|
|
47
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The chains of the nodes the clips key. Null until the system has a dataset.
|
|
55
|
+
*
|
|
56
|
+
* @type {RowChains|null}
|
|
57
|
+
*/
|
|
58
|
+
#chains = null;
|
|
59
|
+
|
|
48
60
|
/**
|
|
49
61
|
* @param {GraphicsEngine} graphics
|
|
50
|
-
* @param {
|
|
62
|
+
* @param {Scene} scene
|
|
51
63
|
*/
|
|
52
|
-
constructor(graphics,
|
|
64
|
+
constructor(graphics, scene) {
|
|
53
65
|
super();
|
|
54
66
|
|
|
55
67
|
assert.defined(graphics, 'graphics');
|
|
56
|
-
assert.
|
|
68
|
+
assert.equal(scene?.isScene, true, 'scene.isScene !== true');
|
|
57
69
|
|
|
58
70
|
this.#graphics = graphics;
|
|
59
|
-
this.#
|
|
71
|
+
this.#scene = scene;
|
|
60
72
|
|
|
61
|
-
this.dependencies = [AnimationGraphController,
|
|
73
|
+
this.dependencies = [AnimationGraphController, AnimationClips];
|
|
62
74
|
|
|
63
75
|
// this tick's clip times are this system's to set: whatever evaluates a pose from them
|
|
64
76
|
// (exact queries, IK's base pose) reads AnimationGraphController and so runs after it
|
|
@@ -68,14 +80,21 @@ export class AnimationGraphSystem extends System {
|
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
/**
|
|
83
|
+
* Only noted here: the graph is bound to the clips by the next {@link update}. A link can happen
|
|
84
|
+
* anywhere the components are added — inside a model's spawn, for one `MeshSystem` loads — and a
|
|
85
|
+
* graph naming a clip the entity has not got throws, which belongs in this system's tick and not
|
|
86
|
+
* in whoever added the component.
|
|
87
|
+
*
|
|
71
88
|
* @param {AnimationGraphController} controller
|
|
72
|
-
* @param {
|
|
89
|
+
* @param {AnimationClips} clips
|
|
73
90
|
* @param {number} entity
|
|
74
91
|
*/
|
|
75
|
-
link(controller,
|
|
92
|
+
link(controller, clips, entity) {
|
|
76
93
|
this.#entries.set(entity, {
|
|
77
94
|
controller,
|
|
78
|
-
|
|
95
|
+
clips: clips.clips,
|
|
96
|
+
bound: false,
|
|
97
|
+
held: false,
|
|
79
98
|
clip_registration: null,
|
|
80
99
|
slots: new Int32Array(0),
|
|
81
100
|
played_slots: new Int32Array(0),
|
|
@@ -86,15 +105,15 @@ export class AnimationGraphSystem extends System {
|
|
|
86
105
|
}
|
|
87
106
|
|
|
88
107
|
/**
|
|
89
|
-
* What the entity
|
|
90
|
-
*
|
|
108
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip
|
|
109
|
+
* **this graph names**, at the weight and the time the renderer has been given.
|
|
91
110
|
*
|
|
92
111
|
* **The clips the graph does not name are not here, because they are not registered** (D37).
|
|
93
112
|
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
94
113
|
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
95
114
|
* leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
|
|
96
115
|
* the same mistake; it is not to bind them. What the graph never names, nothing plays, and the
|
|
97
|
-
* joints it alone would have driven stay where
|
|
116
|
+
* joints it alone would have driven stay where they rest.
|
|
98
117
|
*
|
|
99
118
|
* A clip the graph names but is not currently playing **is** here, at weight zero, because it is
|
|
100
119
|
* bound and the accumulator does see it.
|
|
@@ -105,16 +124,17 @@ export class AnimationGraphSystem extends System {
|
|
|
105
124
|
* @param {PosePlayback[]} target appended to
|
|
106
125
|
* @param {number} entity
|
|
107
126
|
* @returns {boolean} whether this system is driving the entity — `false` for one with no
|
|
108
|
-
* {@link AnimationGraphController}, and for one whose
|
|
127
|
+
* {@link AnimationGraphController} or no {@link AnimationClips}, and for one whose clips arrived
|
|
128
|
+
* since the last update
|
|
109
129
|
*/
|
|
110
130
|
write_pose_playbacks(target, entity) {
|
|
111
131
|
const entry = this.#entries.get(entity);
|
|
112
132
|
|
|
113
|
-
if (entry === undefined || entry.
|
|
133
|
+
if (entry === undefined || !entry.bound) {
|
|
114
134
|
return false;
|
|
115
135
|
}
|
|
116
136
|
|
|
117
|
-
const clips = entry.
|
|
137
|
+
const clips = entry.clips;
|
|
118
138
|
const poses = entry.poses;
|
|
119
139
|
const played = entry.played_slots;
|
|
120
140
|
|
|
@@ -136,7 +156,7 @@ export class AnimationGraphSystem extends System {
|
|
|
136
156
|
const weight = weights[i];
|
|
137
157
|
|
|
138
158
|
// assignment rather than accumulation, and it matters only where two of the graph's
|
|
139
|
-
// clips are one clip of the
|
|
159
|
+
// clips are one clip of the entity: the renderer is written to in this order too, so the
|
|
140
160
|
// last of them is what it holds
|
|
141
161
|
pose.weight = weight;
|
|
142
162
|
|
|
@@ -155,21 +175,42 @@ export class AnimationGraphSystem extends System {
|
|
|
155
175
|
|
|
156
176
|
/**
|
|
157
177
|
* @param {AnimationGraphController} controller
|
|
158
|
-
* @param {
|
|
178
|
+
* @param {AnimationClips} clips
|
|
159
179
|
* @param {number} entity
|
|
160
180
|
*/
|
|
161
|
-
unlink(controller,
|
|
181
|
+
unlink(controller, clips, entity) {
|
|
162
182
|
controller.unlink();
|
|
163
183
|
|
|
164
184
|
const entry = this.#entries.get(entity);
|
|
165
185
|
|
|
166
186
|
if (entry !== undefined) {
|
|
167
187
|
this.#release_clips(entry);
|
|
188
|
+
|
|
189
|
+
if (entry.held) {
|
|
190
|
+
release_clip_targets(this.#chains, entry.clips);
|
|
191
|
+
|
|
192
|
+
entry.held = false;
|
|
193
|
+
}
|
|
168
194
|
}
|
|
169
195
|
|
|
170
196
|
this.#entries.delete(entity);
|
|
171
197
|
}
|
|
172
198
|
|
|
199
|
+
async startup(entityManager) {
|
|
200
|
+
// the scene's rows are this dataset's entities; the first system to place one says so
|
|
201
|
+
const dataset = entityManager.dataset;
|
|
202
|
+
const scene = this.#scene;
|
|
203
|
+
|
|
204
|
+
assert.ok(
|
|
205
|
+
scene.dataset === null || scene.dataset === undefined || scene.dataset === dataset,
|
|
206
|
+
'the scene is bound to another dataset'
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
scene.dataset = dataset;
|
|
210
|
+
|
|
211
|
+
this.#chains = new RowChains(dataset);
|
|
212
|
+
}
|
|
213
|
+
|
|
173
214
|
async shutdown(entityManager) {
|
|
174
215
|
for (const entry of this.#entries.values()) {
|
|
175
216
|
entry.controller.unlink();
|
|
@@ -178,6 +219,9 @@ export class AnimationGraphSystem extends System {
|
|
|
178
219
|
}
|
|
179
220
|
|
|
180
221
|
this.#entries.clear();
|
|
222
|
+
|
|
223
|
+
this.#chains.destroy();
|
|
224
|
+
this.#chains = null;
|
|
181
225
|
}
|
|
182
226
|
|
|
183
227
|
/**
|
|
@@ -186,7 +230,7 @@ export class AnimationGraphSystem extends System {
|
|
|
186
230
|
* **An id may only be handed back to the manager that issued it.** A renderer restart replaces
|
|
187
231
|
* the GPU scene context and voids every id it gave out, so a registration stamped with a context
|
|
188
232
|
* that is no longer current is forgotten rather than returned — returning it would corrupt a
|
|
189
|
-
* stranger's table. Same rule as {@link
|
|
233
|
+
* stranger's table. Same rule as {@link unregister_clips}, same `===`.
|
|
190
234
|
*
|
|
191
235
|
* @param {object} entry
|
|
192
236
|
*/
|
|
@@ -197,8 +241,8 @@ export class AnimationGraphSystem extends System {
|
|
|
197
241
|
return;
|
|
198
242
|
}
|
|
199
243
|
|
|
200
|
-
if (registration.context === this.#graphics.scene_context(this.#
|
|
201
|
-
|
|
244
|
+
if (registration.context === this.#graphics.scene_context(this.#scene)) {
|
|
245
|
+
unregister_clips(registration);
|
|
202
246
|
}
|
|
203
247
|
|
|
204
248
|
entry.clip_registration = null;
|
|
@@ -210,22 +254,18 @@ export class AnimationGraphSystem extends System {
|
|
|
210
254
|
update(time_delta_seconds) {
|
|
211
255
|
const ecd = this.entityManager.dataset;
|
|
212
256
|
|
|
213
|
-
const context = this.#graphics.scene_context(this.#
|
|
257
|
+
const context = this.#graphics.scene_context(this.#scene);
|
|
214
258
|
|
|
215
259
|
// No device — before the first start, and again after a stop. The clocks still run: a unit
|
|
216
260
|
// that fires an ability while the renderer is being replaced still fires it.
|
|
217
261
|
const manager = context === null ? null : context.animation_manager;
|
|
218
262
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (instance === null) {
|
|
223
|
-
// the model has not arrived, and its clips are what say how long they run
|
|
224
|
-
continue;
|
|
225
|
-
}
|
|
263
|
+
// a new context after a restart is acquired in whole; until there is one, holds are recorded
|
|
264
|
+
this.#chains.bind(context === null ? null : context.rows);
|
|
226
265
|
|
|
227
|
-
|
|
228
|
-
|
|
266
|
+
for (const [entity, entry] of this.#entries) {
|
|
267
|
+
if (!entry.bound) {
|
|
268
|
+
this.#bind_clips(entry, entity, ecd);
|
|
229
269
|
}
|
|
230
270
|
|
|
231
271
|
entry.controller.tick(time_delta_seconds);
|
|
@@ -240,7 +280,7 @@ export class AnimationGraphSystem extends System {
|
|
|
240
280
|
noticed — in one comparison, without depending on when anything last ran.
|
|
241
281
|
*/
|
|
242
282
|
if (entry.clip_registration === null || entry.clip_registration.context !== context) {
|
|
243
|
-
this.#bind_gpu(entry,
|
|
283
|
+
this.#bind_gpu(entry, context);
|
|
244
284
|
}
|
|
245
285
|
|
|
246
286
|
write_graph_playback(manager, entry.controller, entry.clip_ids, entry.weights);
|
|
@@ -248,15 +288,16 @@ export class AnimationGraphSystem extends System {
|
|
|
248
288
|
}
|
|
249
289
|
|
|
250
290
|
/**
|
|
251
|
-
* Bind the graph to
|
|
252
|
-
*
|
|
291
|
+
* Bind the graph to the entity's clips: work out which of them each of the graph's clips is, how
|
|
292
|
+
* long each of them runs, and start the graph on that.
|
|
253
293
|
*
|
|
254
294
|
* @param {object} entry
|
|
255
295
|
* @param {number} entity
|
|
256
|
-
* @param {PrefabInstance} instance
|
|
257
296
|
* @param {EntityComponentDataset} ecd
|
|
258
297
|
*/
|
|
259
|
-
#
|
|
298
|
+
#bind_clips(entry, entity, ecd) {
|
|
299
|
+
const clips = entry.clips;
|
|
300
|
+
|
|
260
301
|
const clip_index = entry.controller.def.clipIndex;
|
|
261
302
|
const clip_count = clip_index.length;
|
|
262
303
|
|
|
@@ -266,26 +307,25 @@ export class AnimationGraphSystem extends System {
|
|
|
266
307
|
for (let i = 0; i < clip_count; i++) {
|
|
267
308
|
const name = clip_index[i].name;
|
|
268
309
|
|
|
269
|
-
const slot =
|
|
310
|
+
const slot = clips.findIndex(clip => clip.name === name);
|
|
270
311
|
|
|
271
312
|
if (slot === -1) {
|
|
272
|
-
throw new Error(`Animation clip '${name}' is not
|
|
313
|
+
throw new Error(`Animation clip '${name}' is not among the clips of entity ${entity}`);
|
|
273
314
|
}
|
|
274
315
|
|
|
275
316
|
slots[i] = slot;
|
|
276
|
-
durations[i] =
|
|
317
|
+
durations[i] = clips[slot].duration;
|
|
277
318
|
}
|
|
278
319
|
|
|
279
320
|
entry.controller.unlink();
|
|
280
321
|
entry.controller.link(entity, ecd, durations);
|
|
281
322
|
|
|
282
|
-
entry.instance = instance;
|
|
283
323
|
entry.slots = slots;
|
|
284
324
|
|
|
285
325
|
/*
|
|
286
|
-
The distinct clips
|
|
287
|
-
|
|
288
|
-
|
|
326
|
+
The distinct clips this graph plays. Two states can name one clip — an idle a hurt returns
|
|
327
|
+
to, say — and it is one row on the GPU either way, so it is one entry here: registered once,
|
|
328
|
+
reported to the pose evaluator once.
|
|
289
329
|
*/
|
|
290
330
|
const played = [];
|
|
291
331
|
|
|
@@ -299,28 +339,31 @@ export class AnimationGraphSystem extends System {
|
|
|
299
339
|
|
|
300
340
|
entry.clip_ids = new Int32Array(clip_count);
|
|
301
341
|
entry.weights = new Float32Array(clip_count).fill(-1);
|
|
302
|
-
entry.poses =
|
|
342
|
+
entry.poses = clips.map(() => new PosePlayback());
|
|
343
|
+
|
|
344
|
+
entry.bound = true;
|
|
345
|
+
|
|
346
|
+
// past the throw above, so a graph that cannot be bound holds nothing; and before anything
|
|
347
|
+
// registers, so the clips bind in the update that registers them
|
|
348
|
+
hold_clip_targets(this.#chains, clips);
|
|
303
349
|
|
|
304
|
-
|
|
305
|
-
// have
|
|
306
|
-
this.#release_clips(entry);
|
|
350
|
+
entry.held = true;
|
|
307
351
|
}
|
|
308
352
|
|
|
309
353
|
/**
|
|
310
354
|
* Make this graph's clips playable, and take up the ids that come back.
|
|
311
355
|
*
|
|
312
356
|
* **Only the clips the graph names are registered** (D37), so there is nothing to silence: a
|
|
313
|
-
* clip
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
357
|
+
* clip no state plays is never bound, never marks a joint, and leaves the joints only it would
|
|
358
|
+
* have driven at rest. What this used to do instead — register everything and then write a zero
|
|
359
|
+
* weight over the surplus — kept them bound, and a bound clip at weight zero resolves its joints
|
|
360
|
+
* to zero rather than to the rig's own pose.
|
|
317
361
|
*
|
|
318
362
|
* @param {object} entry
|
|
319
|
-
* @param {PrefabInstance} instance
|
|
320
363
|
* @param {GPUSceneContext} context
|
|
321
364
|
*/
|
|
322
|
-
#bind_gpu(entry,
|
|
323
|
-
const registration =
|
|
365
|
+
#bind_gpu(entry, context) {
|
|
366
|
+
const registration = register_clips(context, entry.clips, entry.played_slots);
|
|
324
367
|
|
|
325
368
|
const slots = entry.slots;
|
|
326
369
|
const clip_ids = entry.clip_ids;
|
|
@@ -4,9 +4,17 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The list path is what the game uses wherever there is no state machine — buildings, critters and
|
|
6
6
|
* the strategy map's groups — and {@link ClipListPlayer} is what plays it. This is the ECS half:
|
|
7
|
-
* which entity has
|
|
7
|
+
* which clips each entity has, and when the ids the renderer issued for them stopped meaning
|
|
8
8
|
* anything.
|
|
9
9
|
*
|
|
10
|
+
* **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
|
|
11
|
+
* components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
|
|
12
|
+
* clips are a new component, which this system sees as the entity leaving and coming back.
|
|
13
|
+
*
|
|
14
|
+
* **Every node the clips key holds a row here** ({@link hold_clip_targets}), from the clips being
|
|
15
|
+
* taken up until they go. A clip binds only once all of them do, and a keyed node outside every skin
|
|
16
|
+
* with nothing drawn under it is held by no other system.
|
|
17
|
+
*
|
|
10
18
|
* **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
|
|
11
19
|
* itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
|
|
12
20
|
* clip's time is written down each frame from the player's own clock. That is I-4: the pose
|
|
@@ -20,31 +28,31 @@
|
|
|
20
28
|
export class AnimationSystem extends System<any> {
|
|
21
29
|
/**
|
|
22
30
|
* @param {GraphicsEngine} graphics
|
|
23
|
-
* @param {
|
|
31
|
+
* @param {Scene} scene
|
|
24
32
|
*/
|
|
25
|
-
constructor(graphics: GraphicsEngine,
|
|
26
|
-
dependencies: (typeof
|
|
33
|
+
constructor(graphics: GraphicsEngine, scene: Scene);
|
|
34
|
+
dependencies: (typeof Animation | typeof AnimationClips)[];
|
|
27
35
|
components_used: ResourceAccessSpecification<typeof Animation>[];
|
|
28
36
|
/**
|
|
29
37
|
* What an entity is playing, and where each of them is.
|
|
30
38
|
*
|
|
31
39
|
* One entry per clip in the component's list, in the list's own order. Empty for an entity this
|
|
32
|
-
* system is not driving — one that has left, or one whose
|
|
33
|
-
* same wait the clip durations are on.
|
|
40
|
+
* system is not driving — one that has left, or one whose clips arrived since the last update.
|
|
34
41
|
*
|
|
35
42
|
* @param {number} entity
|
|
36
43
|
* @returns {ClipPlayback[]}
|
|
37
44
|
*/
|
|
38
45
|
playbacks_of(entity: number): ClipPlayback[];
|
|
39
46
|
/**
|
|
40
|
-
* What the entity
|
|
41
|
-
*
|
|
47
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip of its
|
|
48
|
+
* {@link AnimationClips} that the list names, at the weight and the time the renderer has been
|
|
49
|
+
* given.
|
|
42
50
|
*
|
|
43
51
|
* **Only the clips the list names are here, because they are the only ones registered** (D37).
|
|
44
52
|
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
45
53
|
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
46
54
|
* leaving them at rest. The answer is not to hand the surplus to the evaluator so it agrees with
|
|
47
|
-
* a mistake; it is not to bind them, and then a clip
|
|
55
|
+
* a mistake; it is not to bind them, and then a clip nothing names moves nothing.
|
|
48
56
|
*
|
|
49
57
|
* The entries are this system's own and are rewritten by the next call, which is what keeps a
|
|
50
58
|
* query on a per-frame path from allocating.
|
|
@@ -52,27 +60,33 @@ export class AnimationSystem extends System<any> {
|
|
|
52
60
|
* @param {PosePlayback[]} target appended to
|
|
53
61
|
* @param {number} entity
|
|
54
62
|
* @returns {boolean} whether this system is driving the entity — `false` for one with no
|
|
55
|
-
* {@link Animation}, and for one whose
|
|
63
|
+
* {@link Animation} or no {@link AnimationClips}, and for one whose clips arrived since the last
|
|
64
|
+
* update
|
|
56
65
|
*/
|
|
57
66
|
write_pose_playbacks(target: PosePlayback[], entity: number): boolean;
|
|
58
67
|
/**
|
|
68
|
+
* Only noted here: the clips are taken up by the next {@link update}. A link can happen anywhere
|
|
69
|
+
* the components are added — inside a model's spawn, for one `MeshSystem` loads — and binding is
|
|
70
|
+
* this system's work, on its own tick.
|
|
71
|
+
*
|
|
59
72
|
* @param {Animation} component
|
|
60
|
-
* @param {
|
|
73
|
+
* @param {AnimationClips} clips
|
|
61
74
|
* @param {number} entity
|
|
62
75
|
*/
|
|
63
|
-
link(component: Animation,
|
|
76
|
+
link(component: Animation, clips: AnimationClips, entity: number): void;
|
|
64
77
|
/**
|
|
65
78
|
* @param {Animation} component
|
|
66
|
-
* @param {
|
|
79
|
+
* @param {AnimationClips} clips
|
|
67
80
|
* @param {number} entity
|
|
68
81
|
*/
|
|
69
|
-
unlink(component: Animation,
|
|
82
|
+
unlink(component: Animation, clips: AnimationClips, entity: number): void;
|
|
83
|
+
startup(entityManager: any): Promise<void>;
|
|
70
84
|
shutdown(entityManager: any): Promise<void>;
|
|
71
85
|
#private;
|
|
72
86
|
}
|
|
73
87
|
import { System } from "../ecs/System.js";
|
|
74
|
-
import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
|
|
75
88
|
import { Animation } from "../ecs/animation/Animation.js";
|
|
89
|
+
import { AnimationClips } from "./animation/AnimationClips.js";
|
|
76
90
|
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
|
|
77
91
|
import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
|
|
78
92
|
//# sourceMappingURL=AnimationSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationSystem.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAyBI;;;OAGG;IACH,oDAgBC;IAPG,2DAA+C;IAI/C,iEAEC;IAGL;;;;;;;;OAQG;IACH,qBAHW,MAAM,GACJ,cAAc,CAU1B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,6BANW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAyCnB;IAED;;;;;;;;OAQG;IACH,gBAJW,SAAS,SACT,cAAc,UACd,MAAM,QAahB;IAED;;;;OAIG;IACH,kBAJW,SAAS,SACT,cAAc,UACd,MAAM,QAgBhB;IAED,2CAaC;IAED,4CASC;;CA8KJ;uBArZsB,kBAAkB;0BADf,+BAA+B;+BAE1B,+BAA+B;4CAJlB,iDAAiD;6BAChE,qDAAqD"}
|