@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
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { assert } from "../../core/assert.js";
|
|
2
|
+
import { System } from "../ecs/System.js";
|
|
3
|
+
import { MeshSkin } from "../graphics/ecs/mesh-v2/MeshSkin.js";
|
|
4
|
+
import { ShadedGeometry } from "../graphics/ecs/mesh-v2/ShadedGeometry.js";
|
|
5
|
+
import { ShadedGeometryFlags } from "../graphics/ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
6
|
+
import { RowChains } from "./RowChains.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {import("../../shade/renderer/scene/GPUSceneContext.js").GPUSceneContext} GPUSceneContext
|
|
10
|
+
* @typedef {import("./GraphicsEngine.js").GraphicsEngine} GraphicsEngine
|
|
11
|
+
* @typedef {import("../../shade/renderer/scene/Scene.js").Scene} Scene
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* What the GPU gave one skinned primitive, and in which context.
|
|
16
|
+
*/
|
|
17
|
+
class Entry {
|
|
18
|
+
/**
|
|
19
|
+
* @type {number}
|
|
20
|
+
*/
|
|
21
|
+
entity = -1;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @type {MeshSkin}
|
|
25
|
+
*/
|
|
26
|
+
skin = null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The id the animation manager issued for the skin, or -1 while nothing is registered: not yet,
|
|
30
|
+
* no device, or a restart not yet drained.
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
*/
|
|
34
|
+
skin_id = -1;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The context {@link skin_id} belongs to, or null while there is none.
|
|
38
|
+
*
|
|
39
|
+
* @type {GPUSceneContext|null}
|
|
40
|
+
*/
|
|
41
|
+
context = null;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Whether the joints' chains are held. They are held from the first registration until the
|
|
45
|
+
* entity leaves, across restarts: the chains re-acquire in a new context on their own.
|
|
46
|
+
*
|
|
47
|
+
* @type {boolean}
|
|
48
|
+
*/
|
|
49
|
+
held = false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Deforms every primitive that carries a {@link MeshSkin}: registers its skin with the animation
|
|
54
|
+
* manager, binds the primitive to it, and holds a row for each joint and everything above it.
|
|
55
|
+
*
|
|
56
|
+
* **It does not care where the skin came from.** `MeshSystem` puts one on each skinned primitive of
|
|
57
|
+
* a model it loads; code building a skinned mesh puts one there itself. Both are the same
|
|
58
|
+
* components on the same kinds of entities, and this is the whole of what makes them deform —
|
|
59
|
+
* `ShadedGeometrySystem` draws the clone, this binds it.
|
|
60
|
+
*
|
|
61
|
+
* **One skeleton, one registration.** A body and its hair carry a skin each, with the same joints
|
|
62
|
+
* bound the same way; the manager answers both registrations with one skin, so the skeleton's
|
|
63
|
+
* matrices are made once a frame.
|
|
64
|
+
*
|
|
65
|
+
* **Joint rows are chains** ({@link RowChains}). A joint composes on the GPU under its parent's row;
|
|
66
|
+
* under a clip-driven ancestor that is the only place its world is right, and a clip keying the
|
|
67
|
+
* ancestor binds only once the ancestor holds a row.
|
|
68
|
+
*
|
|
69
|
+
* **Registration waits for {@link update}**, never happening at link. A spawn adds components node
|
|
70
|
+
* by node, so a joint later in the file is not complete when the primitive links; and there may be
|
|
71
|
+
* no device to register with. A restart replaces the context and voids every id it issued: they are
|
|
72
|
+
* forgotten rather than handed back, and every skin registers again in the new one.
|
|
73
|
+
*/
|
|
74
|
+
export class MeshSkinSystem extends System {
|
|
75
|
+
/**
|
|
76
|
+
* @type {GraphicsEngine}
|
|
77
|
+
*/
|
|
78
|
+
#graphics;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @type {Scene}
|
|
82
|
+
*/
|
|
83
|
+
#scene;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @type {Map<number, Entry>}
|
|
87
|
+
*/
|
|
88
|
+
#entries = new Map();
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The scene's GPU context as of the last {@link update}. A different one is a restart.
|
|
92
|
+
*
|
|
93
|
+
* @type {GPUSceneContext|null}
|
|
94
|
+
*/
|
|
95
|
+
#context = null;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Entries not registered with {@link #context}: linked since the last frame, or voided by a
|
|
99
|
+
* restart. A queue rather than a scan, because the answer is almost always "nothing to do".
|
|
100
|
+
*
|
|
101
|
+
* @type {Entry[]}
|
|
102
|
+
*/
|
|
103
|
+
#unregistered = [];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The joints' chains. Null until the system has a dataset.
|
|
107
|
+
*
|
|
108
|
+
* @type {RowChains|null}
|
|
109
|
+
*/
|
|
110
|
+
#chains = null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @param {GraphicsEngine} graphics
|
|
114
|
+
* @param {Scene} scene
|
|
115
|
+
*/
|
|
116
|
+
constructor(graphics, scene) {
|
|
117
|
+
super();
|
|
118
|
+
|
|
119
|
+
assert.defined(graphics, 'graphics');
|
|
120
|
+
assert.defined(scene, 'scene');
|
|
121
|
+
|
|
122
|
+
this.#graphics = graphics;
|
|
123
|
+
this.#scene = scene;
|
|
124
|
+
|
|
125
|
+
this.dependencies = [MeshSkin, ShadedGeometry];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @returns {Scene}
|
|
130
|
+
*/
|
|
131
|
+
get scene() {
|
|
132
|
+
return this.#scene;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async startup(entityManager) {
|
|
136
|
+
this.entityManager = entityManager;
|
|
137
|
+
|
|
138
|
+
// the scene's rows are this dataset's entities; the first system to place one says so
|
|
139
|
+
const dataset = entityManager.dataset;
|
|
140
|
+
const scene = this.#scene;
|
|
141
|
+
|
|
142
|
+
assert.ok(
|
|
143
|
+
scene.dataset === null || scene.dataset === undefined || scene.dataset === dataset,
|
|
144
|
+
'the scene is bound to another dataset'
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
scene.dataset = dataset;
|
|
148
|
+
|
|
149
|
+
this.#chains = new RowChains(dataset);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async shutdown(entityManager) {
|
|
153
|
+
for (const entity of Array.from(this.#entries.keys())) {
|
|
154
|
+
this.#drop(entity);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
this.#chains.destroy();
|
|
158
|
+
this.#chains = null;
|
|
159
|
+
|
|
160
|
+
this.#context = null;
|
|
161
|
+
this.#unregistered.length = 0;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @param {MeshSkin} skin
|
|
166
|
+
* @param {ShadedGeometry} geometry
|
|
167
|
+
* @param {number} entity
|
|
168
|
+
*/
|
|
169
|
+
link(skin, geometry, entity) {
|
|
170
|
+
assert.equal(
|
|
171
|
+
geometry.getFlag(ShadedGeometryFlags.Skinned), true,
|
|
172
|
+
'a MeshSkin deforms a geometry that draws a clone: set ShadedGeometryFlags.Skinned'
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
const entry = new Entry();
|
|
176
|
+
|
|
177
|
+
entry.entity = entity;
|
|
178
|
+
entry.skin = skin;
|
|
179
|
+
|
|
180
|
+
this.#entries.set(entity, entry);
|
|
181
|
+
this.#unregistered.push(entry);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @param {MeshSkin} skin
|
|
186
|
+
* @param {ShadedGeometry} geometry
|
|
187
|
+
* @param {number} entity
|
|
188
|
+
*/
|
|
189
|
+
unlink(skin, geometry, entity) {
|
|
190
|
+
this.#drop(entity);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Register what arrived since the last frame, and everything again after a restart.
|
|
195
|
+
*
|
|
196
|
+
* @param {number} time_delta_seconds
|
|
197
|
+
*/
|
|
198
|
+
update(time_delta_seconds) {
|
|
199
|
+
const context = this.#graphics.scene_context(this.#scene);
|
|
200
|
+
|
|
201
|
+
if (context === null) {
|
|
202
|
+
// No device — before the first start, or after a stop. The next context to arrive is a
|
|
203
|
+
// change like any other.
|
|
204
|
+
this.#chains.bind(null);
|
|
205
|
+
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (context !== this.#context) {
|
|
210
|
+
this.#context = context;
|
|
211
|
+
|
|
212
|
+
this.#chains.bind(context.rows);
|
|
213
|
+
|
|
214
|
+
const waiting = this.#unregistered;
|
|
215
|
+
|
|
216
|
+
waiting.length = 0;
|
|
217
|
+
|
|
218
|
+
for (const entry of this.#entries.values()) {
|
|
219
|
+
// the old context's ids are void, and only forgotten
|
|
220
|
+
entry.skin_id = -1;
|
|
221
|
+
entry.context = null;
|
|
222
|
+
|
|
223
|
+
waiting.push(entry);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const waiting = this.#unregistered;
|
|
228
|
+
|
|
229
|
+
if (waiting.length === 0) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/*
|
|
234
|
+
An entry comes off the list before it is registered, so a registration that throws
|
|
235
|
+
cannot leave the ones before it queued for a second time — a mesh registered twice is
|
|
236
|
+
refused as a rebind, once a frame, for as long as the game runs. One that cannot be
|
|
237
|
+
registered is dropped with a message, and every other one goes ahead.
|
|
238
|
+
*/
|
|
239
|
+
const entries = waiting.slice();
|
|
240
|
+
|
|
241
|
+
waiting.length = 0;
|
|
242
|
+
|
|
243
|
+
for (let i = 0; i < entries.length; i++) {
|
|
244
|
+
const entry = entries[i];
|
|
245
|
+
|
|
246
|
+
try {
|
|
247
|
+
this.#register(entry, context);
|
|
248
|
+
} catch (e) {
|
|
249
|
+
console.error(`MeshSkinSystem: failed to register the skin of entity ${entry.entity}, dropping it`, e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @param {Entry} entry
|
|
256
|
+
* @param {GPUSceneContext} context
|
|
257
|
+
*/
|
|
258
|
+
#register(entry, context) {
|
|
259
|
+
const skin = entry.skin;
|
|
260
|
+
const joints = skin.joints;
|
|
261
|
+
|
|
262
|
+
if (!entry.held) {
|
|
263
|
+
for (let i = 0; i < joints.length; i++) {
|
|
264
|
+
this.#chains.hold(joints[i]);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
entry.held = true;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const manager = context.animation_manager;
|
|
271
|
+
|
|
272
|
+
entry.skin_id = manager.register_skin(joints, skin.inverse_bind_matrices);
|
|
273
|
+
entry.context = context;
|
|
274
|
+
|
|
275
|
+
manager.bind_skin_mesh(entry.entity, entry.skin_id);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @param {number} entity
|
|
280
|
+
*/
|
|
281
|
+
#drop(entity) {
|
|
282
|
+
const entry = this.#entries.get(entity);
|
|
283
|
+
|
|
284
|
+
if (entry === undefined) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
this.#entries.delete(entity);
|
|
289
|
+
|
|
290
|
+
const waiting = this.#unregistered.indexOf(entry);
|
|
291
|
+
|
|
292
|
+
if (waiting !== -1) {
|
|
293
|
+
this.#unregistered.splice(waiting, 1);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// A context replaced by a restart took its ids with it; only the running one gets any back.
|
|
297
|
+
if (entry.context !== null && entry.context === this.#graphics.scene_context(this.#scene)) {
|
|
298
|
+
const manager = entry.context.animation_manager;
|
|
299
|
+
|
|
300
|
+
manager.unbind_skin_mesh(entity);
|
|
301
|
+
manager.unregister_skin(entry.skin_id);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
entry.skin_id = -1;
|
|
305
|
+
entry.context = null;
|
|
306
|
+
|
|
307
|
+
if (entry.held) {
|
|
308
|
+
const joints = entry.skin.joints;
|
|
309
|
+
|
|
310
|
+
for (let i = 0; i < joints.length; i++) {
|
|
311
|
+
this.#chains.release(joints[i]);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
entry.held = false;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Loads models and spawns them as entities, so that a caller need not handle the loading lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* **A shortcut, and nothing more.** Give an entity an {@link SGMesh} naming a file; when the file
|
|
5
|
+
* has loaded — whenever that is — the model appears under the entity as entities and components,
|
|
6
|
+
* and when the component goes, they go. Everything that makes the model work is those components,
|
|
7
|
+
* read by their own systems, exactly as if code had built them: `ShadedGeometry` draws through
|
|
8
|
+
* `ShadedGeometrySystem`, `MeshSkin` deforms through `MeshSkinSystem`, a `TransformAttachment`
|
|
9
|
+
* composes through `TransformAttachmentSystem`, and the `AnimationClips` on the entity play through
|
|
10
|
+
* `AnimationSystem` and `AnimationGraphSystem`. None of them knows this system exists, and this
|
|
11
|
+
* system puts nothing on the GPU itself.
|
|
3
12
|
*
|
|
4
13
|
* **A model is a prefab, and a placement is entities.** A loaded bundle is compiled once per url
|
|
5
|
-
* ({@link prefab_compile}) and spawned once per entity that wears it
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* copy of a node tree per placement is the dataset's own hierarchy, addressable by every system —
|
|
9
|
-
* IK finds a foot by name, cloth seeds from joints, gameplay asks where a socket is — and the
|
|
10
|
-
* renderer's tables are indexed by those entities, at `entity + 1`.
|
|
14
|
+
* ({@link prefab_compile}) and spawned once per entity that wears it ({@link prefab_instantiate}):
|
|
15
|
+
* every node of the file becomes an entity attached to its parent's, named, drawing where it draws,
|
|
16
|
+
* with the placing entity as the root.
|
|
11
17
|
*
|
|
12
18
|
* **It owns the scene and tells the facade to draw it**, rather than the facade handing a graph out
|
|
13
19
|
* for anyone to write into.
|
|
14
|
-
*
|
|
15
|
-
* **Rows need a device, and registration does too.** A model loads whenever it loads, and there
|
|
16
|
-
* may be no renderer yet; {@link update} attaches every instance's entities to the scene's GPU
|
|
17
|
-
* context when one arrives, registers its skins with the animation manager, and does both again
|
|
18
|
-
* after a renderer restart. Driving the clips is not this system's business — that is the
|
|
19
|
-
* animation systems' — but a clip nothing has registered cannot be driven by anyone, which is why
|
|
20
|
-
* the instance is handed out ({@link instance_of}) rather than kept.
|
|
21
20
|
*/
|
|
22
21
|
export class MeshSystem extends System<any> {
|
|
23
22
|
/**
|
|
@@ -32,12 +31,8 @@ export class MeshSystem extends System<any> {
|
|
|
32
31
|
*/
|
|
33
32
|
get scene(): Scene;
|
|
34
33
|
/**
|
|
35
|
-
* The model an entity is showing, as entities:
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Handed out rather than copied because an animation driver has to know *which* instance it is
|
|
39
|
-
* bound to: a model swap builds a new one, and a driver still holding the old one would be
|
|
40
|
-
* driving entities that have gone. The object's identity is the only signal that says so.
|
|
34
|
+
* The model an entity is showing, as entities: the prefab, and its node entities by index and by
|
|
35
|
+
* name. What loading produced — nothing a model needs in order to work is only here.
|
|
41
36
|
*
|
|
42
37
|
* **A model swap is remove-component then add-component.** Reassigning {@link SGMesh#url} on an
|
|
43
38
|
* attached mesh is NOT one and is not observed: `link` reads the url once, the only other
|
|
@@ -51,19 +46,6 @@ export class MeshSystem extends System<any> {
|
|
|
51
46
|
* whose model has not finished loading
|
|
52
47
|
*/
|
|
53
48
|
instance_of(entity: number): PrefabInstance | null;
|
|
54
|
-
/**
|
|
55
|
-
* What the GPU's animation manager gave back for that instance — the skin ids, in the
|
|
56
|
-
* instance's own order.
|
|
57
|
-
*
|
|
58
|
-
* Same reasoning as {@link instance_of} and a stronger version of it: these ids belong to one
|
|
59
|
-
* renderer, and a restart voids every one of them. The object is replaced when that happens, so
|
|
60
|
-
* a driver that compares it against what it bound against notices in the same frame.
|
|
61
|
-
*
|
|
62
|
-
* @param {number} entity
|
|
63
|
-
* @returns {InstanceAnimationRegistration|null} `null` while there is nothing registered — no
|
|
64
|
-
* model yet, no device yet, or a renderer restart that has not been drained
|
|
65
|
-
*/
|
|
66
|
-
animation_of(entity: number): InstanceAnimationRegistration | null;
|
|
67
49
|
/**
|
|
68
50
|
* The entities of an entity's model that draw — one per primitive of the file. Each holds the
|
|
69
51
|
* `meshes` row `entity + 1`, which is what the visibility buffer writes for every pixel it
|
|
@@ -104,11 +86,9 @@ export class MeshSystem extends System<any> {
|
|
|
104
86
|
unlink(model: SGMesh, transform: Transform64, entity: number): void;
|
|
105
87
|
#private;
|
|
106
88
|
}
|
|
107
|
-
export type GPUSceneContext = import("../../shade/renderer/scene/GPUSceneContext.js").GPUSceneContext;
|
|
108
89
|
export type SceneBundle = import("../../shade/renderer/loader/SceneBundle.js").SceneBundle;
|
|
109
90
|
export type Prefab = import("./prefab/Prefab.js").Prefab;
|
|
110
91
|
export type PrefabInstance = import("./prefab/PrefabInstance.js").PrefabInstance;
|
|
111
|
-
export type InstanceAnimationRegistration = import("./register_instance_animation.js").InstanceAnimationRegistration;
|
|
112
92
|
export type GraphicsEngine = import("./GraphicsEngine.js").GraphicsEngine;
|
|
113
93
|
import { System } from "../ecs/System.js";
|
|
114
94
|
import { Transform64 } from "../ecs/transform/Transform64.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeshSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/MeshSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MeshSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/MeshSystem.js"],"names":[],"mappings":"AAiDA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAmDI;;;;OAIG;IACH,sBAJW,cAAc,SACd,KAAK,eACI,MAAM,KAAG,QAAQ,WAAW,CAAC,EAchD;IADG,qDAAyC;IAG7C;;OAEG;IACH,mBAEC;IAED;;;;;;;;;;;;;;OAcG;IACH,oBAJW,MAAM,GACJ,cAAc,GAAC,IAAI,CAW/B;IAED;;;;;;;;OAQG;IACH,yBAJW,MAAM,GACJ,UAAU,CAWtB;IAED;;;;;;;;;;;;OAYG;IACH,6BALW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,UACvC,MAAM,GACJ,OAAO,CAwCnB;IAED,2CAeC;IAED,4CAMC;IA8BD;;;;OAIG;IACH,YAJW,MAAM,aACN,WAAW,UACX,MAAM,QAkBhB;IAED;;;;OAIG;IACH,cAJW,MAAM,aACN,WAAW,UACX,MAAM,QAIhB;;CA8EJ;0BAvYY,OAAO,4CAA4C,EAAE,WAAW;qBAChE,OAAO,oBAAoB,EAAE,MAAM;6BACnC,OAAO,4BAA4B,EAAE,cAAc;6BACnD,OAAO,qBAAqB,EAAE,cAAc;uBAXlC,kBAAkB;4BACb,iCAAiC;uBAEtC,6CAA6C;sBAJ9C,qCAAqC"}
|