@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
|
@@ -9,63 +9,91 @@
|
|
|
9
9
|
* ## Joints by index, resolved once
|
|
10
10
|
*
|
|
11
11
|
* Every field below is an integer or a float. **No names survive into the
|
|
12
|
-
* runtime**, and that is §3.2's central commitment
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* around that would be the wrong answer. {@link joint} holds indices into
|
|
16
|
-
* `Skin#joints`, resolved at build time from `SceneBundleInstance#nodes`.
|
|
12
|
+
* runtime**, and that is §3.2's central commitment. {@link joint} holds indices
|
|
13
|
+
* into `Skin#joints`, resolved at build time; indices into a skin are stable
|
|
14
|
+
* across respawns where entity ids are not.
|
|
17
15
|
*
|
|
18
|
-
* {@link
|
|
16
|
+
* {@link particle_name} is the exception and it is build-time provenance: it is
|
|
19
17
|
* what a diagnostic prints when a proxy does not fit the model it was pointed
|
|
20
18
|
* at, and nothing on the step path reads it.
|
|
21
19
|
*
|
|
22
|
-
* ##
|
|
20
|
+
* ## Particles, and which of them cloth writes
|
|
23
21
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
22
|
+
* Every particle is a joint of the skin. Most are the garment's own — an artist
|
|
23
|
+
* made 8–20 cape joints and skinned the cape to them — and those are the ones
|
|
24
|
+
* cloth simulates and writes ({@link output} set). The rest are the **bones the
|
|
25
|
+
* garment hangs from**: the parent of each of the garment's root joints, which
|
|
26
|
+
* is not the garment's to move. They are particles all the same, because the
|
|
27
|
+
* links from them to the roots are the first links of the fabric, and what holds
|
|
28
|
+
* them is whatever holds anything — a `ClothPin`, on the bone itself:
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* ```js
|
|
31
|
+
* for (const group of built.groups) {
|
|
32
|
+
* skin.joints[group.joint].add(ClothPin.from({ cloth: character, particles: group.particles }));
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* A garment hanging from one bone is today's cape; one hanging from both
|
|
37
|
+
* shoulders and the spine is the same proxy with three such particles.
|
|
38
|
+
*
|
|
39
|
+
* ## The fabric is the proxy's
|
|
40
|
+
*
|
|
41
|
+
* {@link edge}, {@link skip} and {@link hinge} are the particle graph the rows
|
|
42
|
+
* are built from — a joint chain's links and the pairs two links apart, or a
|
|
43
|
+
* sheet's triangle edges and the hinges across them. {@link parent} is a
|
|
44
|
+
* different thing: the hierarchy the *output* is written against, which for a
|
|
45
|
+
* chain happens to run along the same links and for a sheet runs nowhere — every
|
|
46
|
+
* joint of a generated skin hangs straight off the frame.
|
|
47
|
+
*
|
|
48
|
+
* ## The frame is named, and it holds nothing
|
|
49
|
+
*
|
|
50
|
+
* {@link frame} is the joint the garment **rides**: the cloth is simulated in its
|
|
51
|
+
* frame, and its motion is what §7 P7's inertia and limits soften. It is chosen
|
|
52
|
+
* at build — the one bone a garment hangs from, or the nearest joint above all
|
|
53
|
+
* of them — and it decides nothing about what is held.
|
|
34
54
|
*
|
|
35
55
|
* ## The bind pose is baked, not read
|
|
36
56
|
*
|
|
37
|
-
* {@link rest_position} and {@link rest_rotation} are
|
|
38
|
-
*
|
|
39
|
-
* instance at seed. Reading them from the instance works exactly once: cloth
|
|
40
|
-
* takes ownership of
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* a per-seed capture (`remember_rest_pose`); a proxy can do better, because the
|
|
44
|
-
* bind pose is build data and does not have to be remembered at all.
|
|
57
|
+
* {@link rest_position} and {@link rest_rotation} are each particle's bind pose
|
|
58
|
+
* **in the frame joint's bind pose**, carried in the proxy rather than read from
|
|
59
|
+
* the instance at seed. Reading them from the instance works exactly once: cloth
|
|
60
|
+
* takes ownership of the joints' offsets the moment it starts writing, so a
|
|
61
|
+
* re-seed of a live garment would read the shape the solver left behind and call
|
|
62
|
+
* it the authored pose.
|
|
45
63
|
*
|
|
46
64
|
* @author Alex Goldring
|
|
47
65
|
* @copyright Company Named Limited (c) 2026
|
|
48
66
|
*/
|
|
49
67
|
export class ClothProxy {
|
|
50
68
|
/**
|
|
51
|
-
* @param {object} description
|
|
69
|
+
* @param {object} description every field but `name` and `particle_name` required
|
|
52
70
|
* @param {string} [description.name]
|
|
53
71
|
* @param {Int32Array|number[]} description.joint
|
|
54
|
-
* @param {
|
|
55
|
-
* @param {number} description.
|
|
72
|
+
* @param {Uint8Array|number[]} description.output
|
|
73
|
+
* @param {Int32Array|number[]} description.parent
|
|
74
|
+
* @param {Int32Array|number[]} description.edge
|
|
75
|
+
* @param {Int32Array|number[]} description.skip
|
|
76
|
+
* @param {Int32Array|number[]} description.hinge
|
|
77
|
+
* @param {Int32Array|number[]} description.triangle
|
|
78
|
+
* @param {number} description.frame
|
|
56
79
|
* @param {Float32Array|number[]} description.rest_position
|
|
57
80
|
* @param {Float32Array|number[]} description.rest_rotation
|
|
58
|
-
* @param {string[]} [description.
|
|
81
|
+
* @param {string[]} [description.particle_name]
|
|
59
82
|
* @returns {ClothProxy}
|
|
60
83
|
*/
|
|
61
|
-
static from({ name, joint,
|
|
84
|
+
static from({ name, joint, output, parent, edge, skip, hinge, triangle, frame, rest_position, rest_rotation, particle_name }: {
|
|
62
85
|
name?: string;
|
|
63
86
|
joint: Int32Array | number[];
|
|
64
|
-
|
|
65
|
-
|
|
87
|
+
output: Uint8Array | number[];
|
|
88
|
+
parent: Int32Array | number[];
|
|
89
|
+
edge: Int32Array | number[];
|
|
90
|
+
skip: Int32Array | number[];
|
|
91
|
+
hinge: Int32Array | number[];
|
|
92
|
+
triangle: Int32Array | number[];
|
|
93
|
+
frame: number;
|
|
66
94
|
rest_position: Float32Array | number[];
|
|
67
95
|
rest_rotation: Float32Array | number[];
|
|
68
|
-
|
|
96
|
+
particle_name?: string[];
|
|
69
97
|
}): ClothProxy;
|
|
70
98
|
/**
|
|
71
99
|
* Name, for diagnostics and for a tool listing the proxies an asset carries.
|
|
@@ -73,57 +101,79 @@ export class ClothProxy {
|
|
|
73
101
|
*/
|
|
74
102
|
name: string;
|
|
75
103
|
/**
|
|
76
|
-
* How many
|
|
104
|
+
* How many particles this proxy has.
|
|
77
105
|
* @type {number}
|
|
78
106
|
*/
|
|
79
|
-
|
|
107
|
+
particle_count: number;
|
|
80
108
|
/**
|
|
81
|
-
* Index into `Skin#joints` for each
|
|
109
|
+
* Index into `Skin#joints` for each particle.
|
|
82
110
|
* @type {Int32Array}
|
|
83
111
|
*/
|
|
84
112
|
joint: Int32Array;
|
|
85
113
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
114
|
+
* `1` for a garment joint cloth simulates and writes, `0` for a bone the
|
|
115
|
+
* garment hangs from, which cloth only reads.
|
|
116
|
+
* @type {Uint8Array}
|
|
117
|
+
*/
|
|
118
|
+
output: Uint8Array;
|
|
119
|
+
/**
|
|
120
|
+
* Parent of each particle's joint, as an index into this proxy's own
|
|
121
|
+
* particles, or `-1` for a joint whose parent is not one of them: a bone the
|
|
122
|
+
* garment hangs from, or — for a garment that writes it — a joint hanging
|
|
123
|
+
* straight off the frame joint.
|
|
88
124
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
125
|
+
* Parents before children, so one forward pass composes the whole forest —
|
|
126
|
+
* the same ordering `cloth_seed_subtree` gets from a breadth-first walk, and
|
|
127
|
+
* for the same reason.
|
|
92
128
|
* @type {Int32Array}
|
|
93
129
|
*/
|
|
94
|
-
|
|
130
|
+
parent: Int32Array;
|
|
95
131
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
*
|
|
132
|
+
* The fabric: particle pairs joined by a hard stretch row, 2 per edge.
|
|
133
|
+
* @type {Int32Array}
|
|
134
|
+
*/
|
|
135
|
+
edge: Int32Array;
|
|
136
|
+
/**
|
|
137
|
+
* A chain's bending: particle pairs two links apart, 2 per pair.
|
|
138
|
+
* @type {Int32Array}
|
|
139
|
+
*/
|
|
140
|
+
skip: Int32Array;
|
|
141
|
+
/**
|
|
142
|
+
* A surface's bending: the shared edge, then the wing opposite it in each
|
|
143
|
+
* of its two triangles, 4 per hinge — `cloth_bend_row`'s stencil.
|
|
144
|
+
* @type {Int32Array}
|
|
145
|
+
*/
|
|
146
|
+
hinge: Int32Array;
|
|
147
|
+
/**
|
|
148
|
+
* Triangles over the particles, 3 per triangle, for a garment that has a
|
|
149
|
+
* surface: what its joints' orientation is read off. Empty for a chain.
|
|
150
|
+
* @type {Int32Array}
|
|
151
|
+
*/
|
|
152
|
+
triangle: Int32Array;
|
|
153
|
+
/**
|
|
154
|
+
* Index into `Skin#joints` of the joint whose frame the garment is
|
|
155
|
+
* simulated in.
|
|
108
156
|
* @type {number}
|
|
109
157
|
*/
|
|
110
|
-
|
|
158
|
+
frame: number;
|
|
111
159
|
/**
|
|
112
|
-
* Each
|
|
160
|
+
* Each particle's bind-pose position in the frame joint's bind pose, 3 per
|
|
161
|
+
* particle.
|
|
113
162
|
* @type {Float32Array}
|
|
114
163
|
*/
|
|
115
164
|
rest_position: Float32Array;
|
|
116
165
|
/**
|
|
117
|
-
* Each
|
|
166
|
+
* Each particle's bind-pose orientation in the frame joint's bind pose, 4
|
|
167
|
+
* per particle.
|
|
118
168
|
* @type {Float32Array}
|
|
119
169
|
*/
|
|
120
170
|
rest_rotation: Float32Array;
|
|
121
171
|
/**
|
|
122
|
-
* Names, in
|
|
123
|
-
*
|
|
172
|
+
* Names, in particle order. Build-time provenance; nothing on the step path
|
|
173
|
+
* reads it.
|
|
124
174
|
* @type {string[]}
|
|
125
175
|
*/
|
|
126
|
-
|
|
176
|
+
particle_name: string[];
|
|
127
177
|
/**
|
|
128
178
|
* Whether this proxy can address the skin it is about to be used with.
|
|
129
179
|
*
|
|
@@ -134,10 +184,12 @@ export class ClothProxy {
|
|
|
134
184
|
* condition, and this is what turns it into a message naming the joint
|
|
135
185
|
* instead of a garment simulating somebody's spine.
|
|
136
186
|
*
|
|
137
|
-
* @param {
|
|
187
|
+
* @param {{joints: ArrayLike<number>}} skin a `MeshSkin`, or anything with joints in the order the proxy indexes
|
|
138
188
|
* @returns {string} empty when the proxy fits, otherwise what is wrong
|
|
139
189
|
*/
|
|
140
|
-
checkAgainst(skin:
|
|
190
|
+
checkAgainst(skin: {
|
|
191
|
+
joints: ArrayLike<number>;
|
|
192
|
+
}): string;
|
|
141
193
|
/**
|
|
142
194
|
* @readonly
|
|
143
195
|
* @type {boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClothProxy.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/ClothProxy.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"ClothProxy.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/ClothProxy.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH;IA8FI;;;;;;;;;;;;;;;OAeG;IACH;QAdgC,IAAI,GAAzB,MAAM;QAC2B,KAAK,EAAtC,UAAU,GAAC,MAAM,EAAE;QACc,MAAM,EAAvC,UAAU,GAAC,MAAM,EAAE;QACc,MAAM,EAAvC,UAAU,GAAC,MAAM,EAAE;QACc,IAAI,EAArC,UAAU,GAAC,MAAM,EAAE;QACc,IAAI,EAArC,UAAU,GAAC,MAAM,EAAE;QACc,KAAK,EAAtC,UAAU,GAAC,MAAM,EAAE;QACc,QAAQ,EAAzC,UAAU,GAAC,MAAM,EAAE;QACC,KAAK,EAAzB,MAAM;QAC6B,aAAa,EAAhD,YAAY,GAAC,MAAM,EAAE;QACc,aAAa,EAAhD,YAAY,GAAC,MAAM,EAAE;QACE,aAAa,GAApC,MAAM,EAAE;QACN,UAAU,CAsDtB;IAhKD;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,gBAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,OAFU,UAAU,CAEP;IAEb;;;;OAIG;IACH,QAFU,UAAU,CAEN;IAEd;;;;;;;;;;OAUG;IACH,QAFU,UAAU,CAEN;IAEd;;;OAGG;IACH,MAFU,UAAU,CAER;IAEZ;;;OAGG;IACH,MAFU,UAAU,CAER;IAEZ;;;;OAIG;IACH,OAFU,UAAU,CAEP;IAEb;;;;OAIG;IACH,UAFU,UAAU,CAEJ;IAEhB;;;;OAIG;IACH,OAFU,MAAM,CAEL;IAEX;;;;OAIG;IACH,eAFU,YAAY,CAED;IAErB;;;;OAIG;IACH,eAFU,YAAY,CAED;IAErB;;;;OAIG;IACH,eAFU,MAAM,EAAE,CAEC;IAwEnB;;;;;;;;;;;;OAYG;IACH,mBAHW;QAAC,MAAM,EAAE,UAAU,MAAM,CAAC,CAAA;KAAC,GACzB,MAAM,CAqBlB;IAGL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
|
|
@@ -11,39 +11,57 @@ import { assert } from "../../../../core/assert.js";
|
|
|
11
11
|
* ## Joints by index, resolved once
|
|
12
12
|
*
|
|
13
13
|
* Every field below is an integer or a float. **No names survive into the
|
|
14
|
-
* runtime**, and that is §3.2's central commitment
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* around that would be the wrong answer. {@link joint} holds indices into
|
|
18
|
-
* `Skin#joints`, resolved at build time from `SceneBundleInstance#nodes`.
|
|
14
|
+
* runtime**, and that is §3.2's central commitment. {@link joint} holds indices
|
|
15
|
+
* into `Skin#joints`, resolved at build time; indices into a skin are stable
|
|
16
|
+
* across respawns where entity ids are not.
|
|
19
17
|
*
|
|
20
|
-
* {@link
|
|
18
|
+
* {@link particle_name} is the exception and it is build-time provenance: it is
|
|
21
19
|
* what a diagnostic prints when a proxy does not fit the model it was pointed
|
|
22
20
|
* at, and nothing on the step path reads it.
|
|
23
21
|
*
|
|
24
|
-
* ##
|
|
22
|
+
* ## Particles, and which of them cloth writes
|
|
25
23
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
24
|
+
* Every particle is a joint of the skin. Most are the garment's own — an artist
|
|
25
|
+
* made 8–20 cape joints and skinned the cape to them — and those are the ones
|
|
26
|
+
* cloth simulates and writes ({@link output} set). The rest are the **bones the
|
|
27
|
+
* garment hangs from**: the parent of each of the garment's root joints, which
|
|
28
|
+
* is not the garment's to move. They are particles all the same, because the
|
|
29
|
+
* links from them to the roots are the first links of the fabric, and what holds
|
|
30
|
+
* them is whatever holds anything — a `ClothPin`, on the bone itself:
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* ```js
|
|
33
|
+
* for (const group of built.groups) {
|
|
34
|
+
* skin.joints[group.joint].add(ClothPin.from({ cloth: character, particles: group.particles }));
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* A garment hanging from one bone is today's cape; one hanging from both
|
|
39
|
+
* shoulders and the spine is the same proxy with three such particles.
|
|
40
|
+
*
|
|
41
|
+
* ## The fabric is the proxy's
|
|
42
|
+
*
|
|
43
|
+
* {@link edge}, {@link skip} and {@link hinge} are the particle graph the rows
|
|
44
|
+
* are built from — a joint chain's links and the pairs two links apart, or a
|
|
45
|
+
* sheet's triangle edges and the hinges across them. {@link parent} is a
|
|
46
|
+
* different thing: the hierarchy the *output* is written against, which for a
|
|
47
|
+
* chain happens to run along the same links and for a sheet runs nowhere — every
|
|
48
|
+
* joint of a generated skin hangs straight off the frame.
|
|
49
|
+
*
|
|
50
|
+
* ## The frame is named, and it holds nothing
|
|
51
|
+
*
|
|
52
|
+
* {@link frame} is the joint the garment **rides**: the cloth is simulated in its
|
|
53
|
+
* frame, and its motion is what §7 P7's inertia and limits soften. It is chosen
|
|
54
|
+
* at build — the one bone a garment hangs from, or the nearest joint above all
|
|
55
|
+
* of them — and it decides nothing about what is held.
|
|
36
56
|
*
|
|
37
57
|
* ## The bind pose is baked, not read
|
|
38
58
|
*
|
|
39
|
-
* {@link rest_position} and {@link rest_rotation} are
|
|
40
|
-
*
|
|
41
|
-
* instance at seed. Reading them from the instance works exactly once: cloth
|
|
42
|
-
* takes ownership of
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* a per-seed capture (`remember_rest_pose`); a proxy can do better, because the
|
|
46
|
-
* bind pose is build data and does not have to be remembered at all.
|
|
59
|
+
* {@link rest_position} and {@link rest_rotation} are each particle's bind pose
|
|
60
|
+
* **in the frame joint's bind pose**, carried in the proxy rather than read from
|
|
61
|
+
* the instance at seed. Reading them from the instance works exactly once: cloth
|
|
62
|
+
* takes ownership of the joints' offsets the moment it starts writing, so a
|
|
63
|
+
* re-seed of a live garment would read the shape the solver left behind and call
|
|
64
|
+
* it the authored pose.
|
|
47
65
|
*
|
|
48
66
|
* @author Alex Goldring
|
|
49
67
|
* @copyright Company Named Limited (c) 2026
|
|
@@ -57,110 +75,157 @@ export class ClothProxy {
|
|
|
57
75
|
name = "";
|
|
58
76
|
|
|
59
77
|
/**
|
|
60
|
-
* How many
|
|
78
|
+
* How many particles this proxy has.
|
|
61
79
|
* @type {number}
|
|
62
80
|
*/
|
|
63
|
-
|
|
81
|
+
particle_count = 0;
|
|
64
82
|
|
|
65
83
|
/**
|
|
66
|
-
* Index into `Skin#joints` for each
|
|
84
|
+
* Index into `Skin#joints` for each particle.
|
|
67
85
|
* @type {Int32Array}
|
|
68
86
|
*/
|
|
69
87
|
joint = null;
|
|
70
88
|
|
|
71
89
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
90
|
+
* `1` for a garment joint cloth simulates and writes, `0` for a bone the
|
|
91
|
+
* garment hangs from, which cloth only reads.
|
|
92
|
+
* @type {Uint8Array}
|
|
93
|
+
*/
|
|
94
|
+
output = null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Parent of each particle's joint, as an index into this proxy's own
|
|
98
|
+
* particles, or `-1` for a joint whose parent is not one of them: a bone the
|
|
99
|
+
* garment hangs from, or — for a garment that writes it — a joint hanging
|
|
100
|
+
* straight off the frame joint.
|
|
74
101
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
102
|
+
* Parents before children, so one forward pass composes the whole forest —
|
|
103
|
+
* the same ordering `cloth_seed_subtree` gets from a breadth-first walk, and
|
|
104
|
+
* for the same reason.
|
|
78
105
|
* @type {Int32Array}
|
|
79
106
|
*/
|
|
80
|
-
|
|
107
|
+
parent = null;
|
|
81
108
|
|
|
82
109
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
110
|
+
* The fabric: particle pairs joined by a hard stretch row, 2 per edge.
|
|
111
|
+
* @type {Int32Array}
|
|
112
|
+
*/
|
|
113
|
+
edge = null;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A chain's bending: particle pairs two links apart, 2 per pair.
|
|
117
|
+
* @type {Int32Array}
|
|
118
|
+
*/
|
|
119
|
+
skip = null;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A surface's bending: the shared edge, then the wing opposite it in each
|
|
123
|
+
* of its two triangles, 4 per hinge — `cloth_bend_row`'s stencil.
|
|
124
|
+
* @type {Int32Array}
|
|
125
|
+
*/
|
|
126
|
+
hinge = null;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Triangles over the particles, 3 per triangle, for a garment that has a
|
|
130
|
+
* surface: what its joints' orientation is read off. Empty for a chain.
|
|
131
|
+
* @type {Int32Array}
|
|
132
|
+
*/
|
|
133
|
+
triangle = null;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Index into `Skin#joints` of the joint whose frame the garment is
|
|
137
|
+
* simulated in.
|
|
95
138
|
* @type {number}
|
|
96
139
|
*/
|
|
97
|
-
|
|
140
|
+
frame = -1;
|
|
98
141
|
|
|
99
142
|
/**
|
|
100
|
-
* Each
|
|
143
|
+
* Each particle's bind-pose position in the frame joint's bind pose, 3 per
|
|
144
|
+
* particle.
|
|
101
145
|
* @type {Float32Array}
|
|
102
146
|
*/
|
|
103
147
|
rest_position = null;
|
|
104
148
|
|
|
105
149
|
/**
|
|
106
|
-
* Each
|
|
150
|
+
* Each particle's bind-pose orientation in the frame joint's bind pose, 4
|
|
151
|
+
* per particle.
|
|
107
152
|
* @type {Float32Array}
|
|
108
153
|
*/
|
|
109
154
|
rest_rotation = null;
|
|
110
155
|
|
|
111
156
|
/**
|
|
112
|
-
* Names, in
|
|
113
|
-
*
|
|
157
|
+
* Names, in particle order. Build-time provenance; nothing on the step path
|
|
158
|
+
* reads it.
|
|
114
159
|
* @type {string[]}
|
|
115
160
|
*/
|
|
116
|
-
|
|
161
|
+
particle_name = [];
|
|
117
162
|
|
|
118
163
|
/**
|
|
119
|
-
* @param {object} description
|
|
164
|
+
* @param {object} description every field but `name` and `particle_name` required
|
|
120
165
|
* @param {string} [description.name]
|
|
121
166
|
* @param {Int32Array|number[]} description.joint
|
|
122
|
-
* @param {
|
|
123
|
-
* @param {number} description.
|
|
167
|
+
* @param {Uint8Array|number[]} description.output
|
|
168
|
+
* @param {Int32Array|number[]} description.parent
|
|
169
|
+
* @param {Int32Array|number[]} description.edge
|
|
170
|
+
* @param {Int32Array|number[]} description.skip
|
|
171
|
+
* @param {Int32Array|number[]} description.hinge
|
|
172
|
+
* @param {Int32Array|number[]} description.triangle
|
|
173
|
+
* @param {number} description.frame
|
|
124
174
|
* @param {Float32Array|number[]} description.rest_position
|
|
125
175
|
* @param {Float32Array|number[]} description.rest_rotation
|
|
126
|
-
* @param {string[]} [description.
|
|
176
|
+
* @param {string[]} [description.particle_name]
|
|
127
177
|
* @returns {ClothProxy}
|
|
128
178
|
*/
|
|
129
179
|
static from({
|
|
130
180
|
name = "",
|
|
131
181
|
joint,
|
|
132
|
-
|
|
133
|
-
|
|
182
|
+
output,
|
|
183
|
+
parent,
|
|
184
|
+
edge,
|
|
185
|
+
skip,
|
|
186
|
+
hinge,
|
|
187
|
+
triangle,
|
|
188
|
+
frame,
|
|
134
189
|
rest_position,
|
|
135
190
|
rest_rotation,
|
|
136
|
-
|
|
191
|
+
particle_name = []
|
|
137
192
|
}) {
|
|
138
|
-
const
|
|
193
|
+
const particle_count = joint.length;
|
|
139
194
|
|
|
140
|
-
assert.equal(
|
|
141
|
-
assert.equal(
|
|
142
|
-
assert.equal(
|
|
143
|
-
assert.
|
|
195
|
+
assert.equal(output.length, particle_count, 'output.length');
|
|
196
|
+
assert.equal(parent.length, particle_count, 'parent.length');
|
|
197
|
+
assert.equal(rest_position.length, particle_count * 3, 'rest_position.length');
|
|
198
|
+
assert.equal(rest_rotation.length, particle_count * 4, 'rest_rotation.length');
|
|
199
|
+
assert.isNonNegativeInteger(frame, 'frame');
|
|
200
|
+
assert.equal(edge.length % 2, 0, 'edge.length is a whole number of pairs');
|
|
201
|
+
assert.equal(skip.length % 2, 0, 'skip.length is a whole number of pairs');
|
|
202
|
+
assert.equal(hinge.length % 4, 0, 'hinge.length is a whole number of quads');
|
|
203
|
+
assert.equal(triangle.length % 3, 0, 'triangle.length is a whole number of triples');
|
|
144
204
|
|
|
145
|
-
for (let i = 0; i <
|
|
146
|
-
// Parents before children: the composition down the
|
|
205
|
+
for (let i = 0; i < particle_count; i++) {
|
|
206
|
+
// Parents before children: the composition down the forest is one
|
|
147
207
|
// forward pass and there is nowhere for a cycle to hide.
|
|
148
208
|
assert.ok(
|
|
149
|
-
|
|
150
|
-
`ClothProxy
|
|
209
|
+
parent[i] < i,
|
|
210
|
+
`ClothProxy particle ${i} has parent ${parent[i]}, which is not before it`
|
|
151
211
|
);
|
|
152
212
|
}
|
|
153
213
|
|
|
154
214
|
const r = new ClothProxy();
|
|
155
215
|
|
|
156
216
|
r.name = name;
|
|
157
|
-
r.
|
|
217
|
+
r.particle_count = particle_count;
|
|
158
218
|
r.joint = Int32Array.from(joint);
|
|
159
|
-
r.
|
|
160
|
-
r.
|
|
219
|
+
r.output = Uint8Array.from(output);
|
|
220
|
+
r.parent = Int32Array.from(parent);
|
|
221
|
+
r.edge = Int32Array.from(edge);
|
|
222
|
+
r.skip = Int32Array.from(skip);
|
|
223
|
+
r.hinge = Int32Array.from(hinge);
|
|
224
|
+
r.triangle = Int32Array.from(triangle);
|
|
225
|
+
r.frame = frame;
|
|
161
226
|
r.rest_position = Float32Array.from(rest_position);
|
|
162
227
|
r.rest_rotation = Float32Array.from(rest_rotation);
|
|
163
|
-
r.
|
|
228
|
+
r.particle_name = particle_name.slice();
|
|
164
229
|
|
|
165
230
|
return r;
|
|
166
231
|
}
|
|
@@ -175,7 +240,7 @@ export class ClothProxy {
|
|
|
175
240
|
* condition, and this is what turns it into a message naming the joint
|
|
176
241
|
* instead of a garment simulating somebody's spine.
|
|
177
242
|
*
|
|
178
|
-
* @param {
|
|
243
|
+
* @param {{joints: ArrayLike<number>}} skin a `MeshSkin`, or anything with joints in the order the proxy indexes
|
|
179
244
|
* @returns {string} empty when the proxy fits, otherwise what is wrong
|
|
180
245
|
*/
|
|
181
246
|
checkAgainst(skin) {
|
|
@@ -185,14 +250,14 @@ export class ClothProxy {
|
|
|
185
250
|
|
|
186
251
|
const count = skin.joints.length;
|
|
187
252
|
|
|
188
|
-
if (this.
|
|
189
|
-
return `${this.name}:
|
|
253
|
+
if (this.frame >= count) {
|
|
254
|
+
return `${this.name}: frame is joint ${this.frame} of a skin with ${count}`;
|
|
190
255
|
}
|
|
191
256
|
|
|
192
|
-
for (let i = 0; i < this.
|
|
257
|
+
for (let i = 0; i < this.particle_count; i++) {
|
|
193
258
|
if (this.joint[i] >= count) {
|
|
194
|
-
return `${this.name}:
|
|
195
|
-
+ ` is
|
|
259
|
+
return `${this.name}: particle ${i} (${this.particle_name[i] ?? '?'})`
|
|
260
|
+
+ ` is joint ${this.joint[i]} of a skin with ${count}`;
|
|
196
261
|
}
|
|
197
262
|
}
|
|
198
263
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../../../graphics3/prefab/Prefab.js").Prefab} Prefab
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Each node's bind pose relative to the frame node's, composed from the
|
|
6
|
+
* prefab's local rest poses down from the frame, `[tx, ty, tz, qx, qy, qz, qw]`.
|
|
7
|
+
* Every node asked about hangs below the frame.
|
|
8
|
+
*
|
|
9
|
+
* Both proxy builders bake their rest pose this way — in the frame joint's own
|
|
10
|
+
* bind pose — so that a re-seed reads what was authored rather than what the
|
|
11
|
+
* solver left on the joints.
|
|
12
|
+
*
|
|
13
|
+
* Rigid, as every pose cloth holds is: a local scale is not applied. That is
|
|
14
|
+
* not a convention this can opt out of alone — the write-back is rigid too,
|
|
15
|
+
* and the GPU applies a parent's scale on top of what cloth writes, so a
|
|
16
|
+
* scaled bake would draw a scaled link twice over. A builder refuses a rig
|
|
17
|
+
* where it would matter, with {@link cloth_bind_scaled_above}.
|
|
18
|
+
*
|
|
19
|
+
* @author Alex Goldring
|
|
20
|
+
* @copyright Company Named Limited (c) 2026
|
|
21
|
+
*
|
|
22
|
+
* @param {Prefab} prefab
|
|
23
|
+
* @param {number} frame
|
|
24
|
+
* @returns {function(number): Float64Array}
|
|
25
|
+
*/
|
|
26
|
+
export function cloth_bind_in_frame(prefab: Prefab, frame: number): (arg0: number) => Float64Array;
|
|
27
|
+
/**
|
|
28
|
+
* The nearest node above `node`, up to and including the prefab's root, whose
|
|
29
|
+
* rest scale is not one; or -1.
|
|
30
|
+
*
|
|
31
|
+
* Cloth simulates and writes back rigid poses, and everything under a scaled
|
|
32
|
+
* node is drawn scaled: a link below one is simulated at its authored length and
|
|
33
|
+
* drawn at that times the scale, and a scale above the frame draws the whole
|
|
34
|
+
* garment at another size than the one its colliders meet. Measured, a 10 cm
|
|
35
|
+
* chain under a joint scaled by 2: simulated links 0.1, drawn 0.2. A node's own
|
|
36
|
+
* scale moves nothing cloth places, so it is not asked about.
|
|
37
|
+
*
|
|
38
|
+
* @param {Prefab} prefab
|
|
39
|
+
* @param {number} node
|
|
40
|
+
* @returns {number}
|
|
41
|
+
*/
|
|
42
|
+
export function cloth_bind_scaled_above(prefab: Prefab, node: number): number;
|
|
43
|
+
export type Prefab = import("../../../graphics3/prefab/Prefab.js").Prefab;
|
|
44
|
+
//# sourceMappingURL=cloth_bind_in_frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloth_bind_in_frame.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/cloth_bind_in_frame.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,4CAJW,MAAM,SACN,MAAM,UACK,MAAM,KAAG,YAAY,CAqC1C;AASD;;;;;;;;;;;;;;GAcG;AACH,gDAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAgBlB;qBAlGY,OAAO,qCAAqC,EAAE,MAAM"}
|