@woosh/meep-engine 3.40.0 → 3.42.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-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/selection/editor_pick.d.ts.map +1 -1
- package/editor/selection/editor_pick.js +2 -1
- package/editor/tools/TransformToolV2.d.ts.map +1 -1
- package/editor/tools/TransformToolV2.js +7 -1
- package/editor/tools/engine/ToolEngine.d.ts.map +1 -1
- package/editor/tools/engine/ToolEngine.js +10 -0
- package/editor/tools/v2/TransformControls.d.ts.map +1 -1
- package/editor/tools/v2/TransformControls.js +7 -20
- package/editor/tools/v2/handle/gizmo_drag_plane.d.ts.map +1 -1
- package/editor/tools/v2/handle/gizmo_drag_plane.js +4 -0
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.js +3 -1
- package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeGraphView.js +28 -12
- package/package.json +1 -1
- package/samples/engine/first-scene/index.html +4 -1
- package/samples/engine/first-scene/main.js +14 -9
- package/src/core/binary/utf8/utf8_decode.js +3 -3
- package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.js +112 -113
- package/src/core/bvh2/bvh3/ebvh_nodes_sort_sah_local4.js +2 -2
- package/src/core/cache/wtinylfu/benchmark/CacheWTinylfu.bench.md +14 -14
- package/src/core/collection/RingBuffer.d.ts.map +1 -1
- package/src/core/collection/RingBuffer.js +4 -0
- package/src/core/collection/array/array_contains_duplicates.d.ts.map +1 -1
- package/src/core/collection/array/array_contains_duplicates.js +2 -1
- package/src/core/collection/array/array_copy.d.ts.map +1 -1
- package/src/core/collection/array/array_copy.js +23 -0
- package/src/core/collection/array/typed/sparse_typed_array_hash.d.ts +2 -2
- package/src/core/collection/array/typed/sparse_typed_array_hash.d.ts.map +1 -1
- package/src/core/collection/array/typed/sparse_typed_array_hash.js +9 -8
- package/src/core/collection/array/typed/uint16_array_hash.d.ts +2 -2
- package/src/core/collection/array/typed/uint16_array_hash.js +4 -4
- package/src/core/collection/array/typed/uint8_array_hash.d.ts +2 -2
- package/src/core/collection/array/typed/uint8_array_hash.js +4 -4
- package/src/core/collection/array/weightedRandomFromArray.d.ts +1 -0
- package/src/core/collection/array/weightedRandomFromArray.d.ts.map +1 -1
- package/src/core/collection/array/weightedRandomFromArray.js +9 -1
- package/src/core/collection/heap/BinaryHeap.d.ts.map +1 -1
- package/src/core/collection/heap/BinaryHeap.js +4 -0
- package/src/core/collection/list/List.d.ts.map +1 -1
- package/src/core/collection/list/List.js +4 -2
- package/src/core/collection/set/ArraySet.js +1 -1
- package/src/core/collection/set/HashSet.d.ts +1 -1
- package/src/core/collection/set/HashSet.d.ts.map +1 -1
- package/src/core/collection/set/HashSet.js +4 -2
- package/src/core/debug/matchers/IsEqual.js +1 -1
- package/src/core/debug/matchers/IsIterableContaining.d.ts.map +1 -1
- package/src/core/debug/matchers/IsIterableContaining.js +61 -74
- package/src/core/events/signal/SignalBinding.js +101 -101
- package/src/core/function/extractFunctionBody.js +13 -13
- package/src/core/function/objectsEqual.d.ts.map +1 -1
- package/src/core/function/objectsEqual.js +15 -14
- package/src/core/geom/3d/frustum/frustum3_compute_closest_point.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/frustum3_compute_closest_point.js +207 -172
- package/src/core/geom/3d/gjk/gjk_epa_penetration.d.ts.map +1 -1
- package/src/core/geom/3d/gjk/gjk_epa_penetration.js +5 -4
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.js +8 -2
- package/src/core/geom/3d/quaternion/swing_twist_clamp.d.ts +24 -0
- package/src/core/geom/3d/quaternion/swing_twist_clamp.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/swing_twist_clamp.js +62 -0
- package/src/core/geom/3d/quaternion/swing_twist_compose.d.ts +15 -0
- package/src/core/geom/3d/quaternion/swing_twist_compose.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/swing_twist_compose.js +36 -0
- package/src/core/geom/3d/quaternion/swing_twist_error.d.ts +39 -0
- package/src/core/geom/3d/quaternion/swing_twist_error.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/swing_twist_error.js +85 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts +20 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/tri3_ray_intersection.js +182 -0
- package/src/core/geom/vec3/v3_rigid_align_paired_unit_vectors.d.ts +11 -6
- package/src/core/geom/vec3/v3_rigid_align_paired_unit_vectors.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_rigid_align_paired_unit_vectors.js +27 -13
- package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.d.ts +25 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.d.ts.map +1 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.js +166 -0
- package/src/core/math/linalg/eigen/matrix_top_eigenvector_power_iteration.d.ts +5 -3
- package/src/core/math/linalg/eigen/matrix_top_eigenvector_power_iteration.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_top_eigenvector_power_iteration.js +5 -3
- package/src/core/math/noise/curl_noise_3dt.d.ts.map +1 -1
- package/src/core/math/noise/curl_noise_3dt.js +20 -10
- package/src/core/math/noise/sdnoise.d.ts +16 -5
- package/src/core/math/noise/sdnoise.d.ts.map +1 -1
- package/src/core/math/noise/sdnoise.js +43 -9
- package/src/core/math/spline/spline3_hermite_nearest_point.d.ts +16 -1
- package/src/core/math/spline/spline3_hermite_nearest_point.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_nearest_point.js +44 -3
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +6 -2
- package/src/engine/animation/curve/AnimationCurve.d.ts +3 -0
- package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +6 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +9 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +26 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +2 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/AbilitySet.js +9 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/LedgeGrab.js +6 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/Slide.js +1 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts +4 -1
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/WallRun.js +13 -1
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +1 -1
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +6 -5
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +3 -3
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +9 -8
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +13 -4
- package/src/engine/ecs/EntityManager.d.ts +9 -1
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +44 -42
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +2 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.js +1 -0
- package/src/engine/ecs/fow/FogOfWarRevealerSystem.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWarRevealerSystem.js +3 -0
- package/src/engine/ecs/gpu/GPUStateAuthority.d.ts +20 -0
- package/src/engine/ecs/gpu/GPUStateAuthority.d.ts.map +1 -1
- package/src/engine/ecs/gpu/GPUStateAuthority.js +21 -0
- package/src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts +13 -0
- package/src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts.map +1 -0
- package/src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.js +12 -0
- package/src/engine/ecs/gpu/gpu_authority_grant.d.ts +6 -0
- package/src/engine/ecs/gpu/gpu_authority_grant.d.ts.map +1 -1
- package/src/engine/ecs/gpu/gpu_authority_grant.js +7 -1
- package/src/engine/ecs/gpu/gpu_authority_held.d.ts +14 -0
- package/src/engine/ecs/gpu/gpu_authority_held.d.ts.map +1 -0
- package/src/engine/ecs/gpu/gpu_authority_held.js +23 -0
- package/src/engine/ecs/gpu/gpu_authority_hold.d.ts +23 -0
- package/src/engine/ecs/gpu/gpu_authority_hold.d.ts.map +1 -0
- package/src/engine/ecs/gpu/gpu_authority_hold.js +41 -0
- package/src/engine/ecs/gpu/gpu_authority_unhold.d.ts +14 -0
- package/src/engine/ecs/gpu/gpu_authority_unhold.d.ts.map +1 -0
- package/src/engine/ecs/gpu/gpu_authority_unhold.js +32 -0
- package/src/engine/ecs/ik/IKGoal.d.ts +59 -0
- package/src/engine/ecs/ik/IKGoal.d.ts.map +1 -0
- package/src/engine/ecs/ik/IKGoal.js +83 -0
- package/src/engine/ecs/ik/IKGoalSystem.d.ts +75 -0
- package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -0
- package/src/engine/ecs/ik/IKGoalSystem.js +1456 -0
- package/src/engine/ecs/ik/PLAN.md +179 -0
- package/src/engine/ecs/parent/EntityNode.js +3 -3
- package/src/engine/ecs/speaker/VoiceSystem.d.ts +2 -2
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- package/src/engine/ecs/speaker/VoiceSystem.js +4 -0
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +5 -5
- package/src/engine/ecs/storage/BinaryBufferSerializer.d.ts.map +1 -1
- package/src/engine/ecs/storage/BinaryBufferSerializer.js +4 -5
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +3 -2
- package/src/engine/ecs/storage/binary/SERIALIZATION_COVERAGE.md +7 -3
- package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter2.js +1 -1
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +8 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +9 -2
- package/src/engine/ecs/system/orderSystemsByDeclaredAccess.d.ts +33 -0
- package/src/engine/ecs/system/orderSystemsByDeclaredAccess.d.ts.map +1 -0
- package/src/engine/ecs/system/orderSystemsByDeclaredAccess.js +282 -0
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +5 -2
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +3 -0
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +1 -0
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +13 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +1 -0
- package/src/engine/ecs/transform/T64WorldCache.js +139 -139
- package/src/engine/ecs/transform/t64_evaluate_local.d.ts +25 -0
- package/src/engine/ecs/transform/t64_evaluate_local.d.ts.map +1 -0
- package/src/engine/ecs/transform/t64_evaluate_local.js +35 -0
- package/src/engine/ecs/transform/t64_evaluate_world.d.ts +5 -3
- package/src/engine/ecs/transform/t64_evaluate_world.d.ts.map +1 -1
- package/src/engine/ecs/transform/t64_evaluate_world.js +128 -126
- package/src/engine/graphics/ecs/light/LightSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/LightSerializationAdapter.js +13 -1
- package/src/engine/graphics/ecs/light/LightSerializationUpgrader_0_1.d.ts +5 -0
- package/src/engine/graphics/ecs/light/LightSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/graphics/ecs/light/LightSerializationUpgrader_0_1.js +27 -0
- package/src/engine/graphics/ecs/water/Water.d.ts +11 -0
- package/src/engine/graphics/ecs/water/Water.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/Water.js +17 -0
- package/src/engine/graphics/ecs/water/WaterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSerializationAdapter.js +3 -1
- package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_4_5.d.ts +9 -0
- package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_4_5.d.ts.map +1 -0
- package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_4_5.js +24 -0
- package/src/engine/graphics/ecs/water/WaterWaves.d.ts +30 -9
- package/src/engine/graphics/ecs/water/WaterWaves.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterWaves.js +41 -9
- package/src/engine/graphics/ecs/water/WaterWavesSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterWavesSerializationAdapter.js +30 -26
- package/src/engine/graphics/ecs/water/WaterWavesSerializationUpgrader_0_1.d.ts +6 -0
- package/src/engine/graphics/ecs/water/WaterWavesSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/graphics/ecs/water/WaterWavesSerializationUpgrader_0_1.js +22 -0
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_raycast.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_raycast.js +3 -5
- package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts +20 -0
- package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts.map +1 -1
- package/src/engine/graphics/texture/3d/scs3d_sample_linear3.js +36 -0
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +2 -0
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.js +337 -329
- package/src/engine/graphics3/AnimationSystem.d.ts +2 -0
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem.js +360 -352
- package/src/engine/graphics3/WaterSystem.d.ts +12 -3
- package/src/engine/graphics3/WaterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/WaterSystem.js +78 -46
- package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
- package/src/engine/input/devices/PointerDevice.js +29 -4
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -0
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +14 -3
- package/src/engine/physics/cloth/MEASUREMENTS.md +130 -0
- package/src/engine/physics/cloth/PLAN.md +16 -1
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +5 -6
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +5 -6
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +4 -7
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.js +4 -7
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +4 -3
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.js +4 -3
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothWorld.js +10 -0
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +24 -24
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +46 -43
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back.js +1 -1
- package/src/engine/physics/constraint/solve_constraints.d.ts +0 -35
- package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
- package/src/engine/physics/constraint/solve_constraints.js +1 -83
- package/src/engine/physics/ecs/ContactProbe.d.ts +73 -0
- package/src/engine/physics/ecs/ContactProbe.d.ts.map +1 -0
- package/src/engine/physics/ecs/ContactProbe.js +103 -0
- package/src/engine/physics/ecs/ContactProbeSystem.d.ts +44 -0
- package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/ContactProbeSystem.js +397 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +1 -1
- package/src/engine/physics/fluid/ecs/FluidComponent.js +1 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.js +12 -3
- package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.js +8 -2
- package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.d.ts +19 -0
- package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.js +41 -2
- package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.js +9 -3
- package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.js +26 -10
- package/src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.d.ts +205 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.d.ts.map +1 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.js +245 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_limit_from_joint.d.ts +21 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_limit_from_joint.d.ts.map +1 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_limit_from_joint.js +63 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts +33 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +874 -0
- package/src/engine/physics/inverse_kinematics/joint_hinge_mid_axis.d.ts +27 -0
- package/src/engine/physics/inverse_kinematics/joint_hinge_mid_axis.d.ts.map +1 -0
- package/src/engine/physics/inverse_kinematics/joint_hinge_mid_axis.js +77 -0
- package/src/engine/physics/inverse_kinematics/two_bone_path_solve.d.ts +36 -0
- package/src/engine/physics/inverse_kinematics/two_bone_path_solve.d.ts.map +1 -0
- package/src/engine/physics/inverse_kinematics/two_bone_path_solve.js +97 -0
- package/src/engine/physics/inverse_kinematics/two_joint_ik.d.ts +33 -11
- package/src/engine/physics/inverse_kinematics/two_joint_ik.d.ts.map +1 -1
- package/src/engine/physics/inverse_kinematics/two_joint_ik.js +158 -67
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts +3 -6
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +22 -9
- package/src/engine/ui/DraggableAspect.d.ts +5 -1
- package/src/engine/ui/DraggableAspect.d.ts.map +1 -1
- package/src/engine/ui/DraggableAspect.js +61 -4
- package/src/format/image/avif/heif/ItemProperty.d.ts +1 -1
- package/src/format/image/avif/heif/ItemProperty.js +1 -1
- package/src/format/image/png/chunk/png_chunk_decode_iTXt.d.ts.map +1 -1
- package/src/format/image/png/chunk/png_chunk_decode_iTXt.js +17 -6
- package/src/shade/device/mock/SoftwareGPUDevice.d.ts +2 -4
- package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUDevice.js +20 -13
- package/src/shade/playground/skinned_blas_refit/sweep_views.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/sweep_views.js +2 -1
- package/src/shade/playground/water_refraction/README.md +10 -11
- package/src/shade/playground/water_refraction/main.js +9 -8
- package/src/shade/playground/water_refraction/world.js +1 -1
- package/src/shade/playground/water_surface/README.md +43 -0
- package/src/shade/playground/water_surface/index.html +30 -0
- package/src/shade/playground/water_surface/main.d.ts +2 -0
- package/src/shade/playground/water_surface/main.d.ts.map +1 -0
- package/src/shade/playground/water_surface/main.js +154 -0
- package/src/shade/playground/water_surface/world.d.ts +44 -0
- package/src/shade/playground/water_surface/world.d.ts.map +1 -0
- package/src/shade/playground/water_surface/world.js +160 -0
- package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.js +10 -1
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +10 -4
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +251 -23
- package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.d.ts +12 -4
- package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.d.ts.map +1 -1
- package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js +12 -4
- package/src/shade/renderer/animation/chunk_pose_accumulator.d.ts.map +1 -1
- package/src/shade/renderer/animation/chunk_pose_accumulator.js +14 -1
- package/src/shade/renderer/animation/pose/PoseChannelIndex.d.ts +78 -0
- package/src/shade/renderer/animation/pose/PoseChannelIndex.d.ts.map +1 -0
- package/src/shade/renderer/animation/pose/PoseChannelIndex.js +274 -0
- package/src/shade/renderer/animation/pose/PosePlayback.d.ts +40 -3
- package/src/shade/renderer/animation/pose/PosePlayback.d.ts.map +1 -1
- package/src/shade/renderer/animation/pose/PosePlayback.js +77 -3
- package/src/shade/renderer/animation/pose/pose_evaluate_local.d.ts +21 -3
- package/src/shade/renderer/animation/pose/pose_evaluate_local.d.ts.map +1 -1
- package/src/shade/renderer/animation/pose/pose_evaluate_local.js +79 -11
- package/src/shade/renderer/animation/shader_animation_apply.js +1 -1
- package/src/shade/renderer/animation/shader_animation_pose_resolve.d.ts +3 -2
- package/src/shade/renderer/animation/shader_animation_pose_resolve.d.ts.map +1 -1
- package/src/shade/renderer/animation/shader_animation_pose_resolve.js +187 -176
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +5 -0
- package/src/shade/renderer/binding/BufferBinding.js +2 -2
- package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/GPUTypedTable.js +5 -3
- package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.d.ts +10 -3
- package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.js +17 -9
- package/src/shade/renderer/camera/orbital/OrbitalCameraInput.d.ts +3 -0
- package/src/shade/renderer/camera/orbital/OrbitalCameraInput.d.ts.map +1 -1
- package/src/shade/renderer/camera/orbital/OrbitalCameraInput.js +16 -0
- package/src/shade/renderer/camera/orbital/OrbitalCameraRig.d.ts +2 -0
- package/src/shade/renderer/camera/orbital/OrbitalCameraRig.d.ts.map +1 -1
- package/src/shade/renderer/camera/orbital/OrbitalCameraRig.js +11 -0
- package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts +1 -1
- package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.js +9 -3
- package/src/shade/renderer/geometry/util/geometry_simplify_redundant_topology.d.ts.map +1 -1
- package/src/shade/renderer/geometry/util/geometry_simplify_redundant_topology.js +2 -2
- package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.js +85 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +12 -6
- package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +7 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.js +3 -1
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/object_property/chunk_write_object_property.d.ts +3 -1
- package/src/shade/renderer/object_property/chunk_write_object_property.d.ts.map +1 -1
- package/src/shade/renderer/object_property/chunk_write_object_property.js +5 -2
- package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts +4 -0
- package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts.map +1 -1
- package/src/shade/renderer/object_property/chunk_write_object_property_node3d.js +6 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.js +2 -1
- package/src/shade/renderer/scene/optimization/geometry/geometry_deduplicate.d.ts +1 -1
- package/src/shade/renderer/scene/optimization/geometry/geometry_deduplicate.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/geometry/geometry_deduplicate.js +135 -73
- package/src/shade/renderer/scene/optimization/geometry/internal/cover_greedy.d.ts +7 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/cover_greedy.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/cover_greedy.js +29 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/face_neighbourhood_hash.d.ts +19 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/face_neighbourhood_hash.d.ts.map +1 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/face_neighbourhood_hash.js +167 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/neighbourhood_anchor_index.d.ts +25 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/neighbourhood_anchor_index.d.ts.map +1 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/neighbourhood_anchor_index.js +124 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.d.ts +19 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.d.ts.map +1 -0
- package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.js +48 -0
- package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts +17 -1
- package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
- package/src/shade/renderer/scene/rows/GPUSceneRows.js +29 -3
- package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128_inverse.d.ts +13 -0
- package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128_inverse.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128_inverse.js +42 -0
- package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128x4_inverse_workgroup.d.ts +15 -0
- package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128x4_inverse_workgroup.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128x4_inverse_workgroup.js +39 -0
- package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.d.ts.map +1 -1
- package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.js +2 -0
- package/src/shade/renderer/water/GPUWaterRenderer.d.ts +15 -0
- package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
- package/src/shade/renderer/water/GPUWaterRenderer.js +110 -30
- package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts +16 -8
- package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
- package/src/shade/renderer/water/medium/GPUWaterBodies.js +31 -26
- package/src/shade/renderer/water/medium/shader_water_meshlets.d.ts +0 -1
- package/src/shade/renderer/water/medium/shader_water_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/water/medium/shader_water_meshlets.js +1 -39
- package/src/shade/renderer/water/shader_water.d.ts +0 -1
- package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water.js +201 -72
- package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts +70 -0
- package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/GPUWaterSurface.js +199 -0
- package/src/shade/renderer/water/surface/WATER_WAVE_RECORD_STRUCT.d.ts +5 -2
- package/src/shade/renderer/water/surface/WATER_WAVE_RECORD_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/WATER_WAVE_RECORD_STRUCT.js +32 -12
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +22 -0
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +217 -0
- package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts +65 -11
- package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/graph_water_tessellation.js +163 -28
- package/src/shade/renderer/water/surface/lod/WATER_LOD.d.ts +51 -0
- package/src/shade/renderer/water/surface/lod/WATER_LOD.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/lod/WATER_LOD.js +95 -0
- package/src/shade/renderer/water/surface/lod/chunk_water_lod.d.ts +10 -0
- package/src/shade/renderer/water/surface/lod/chunk_water_lod.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/lod/chunk_water_lod.js +127 -0
- package/src/shade/renderer/water/surface/lod/chunk_water_lod_cell.d.ts +17 -0
- package/src/shade/renderer/water/surface/lod/chunk_water_lod_cell.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/lod/chunk_water_lod_cell.js +246 -0
- package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts +118 -0
- package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/lod/shader_water_lod.js +727 -0
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts +60 -0
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +228 -0
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +17 -0
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +49 -0
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +22 -0
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +143 -0
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +15 -0
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +121 -0
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +83 -0
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +502 -0
- package/src/shade/renderer/water/surface/shader_water_cull.d.ts +42 -0
- package/src/shade/renderer/water/surface/shader_water_cull.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/shader_water_cull.js +269 -0
- package/src/shade/renderer/water/surface/shader_water_waves_combine.d.ts +15 -0
- package/src/shade/renderer/water/surface/shader_water_waves_combine.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/shader_water_waves_combine.js +73 -0
- package/src/shade/renderer/water/surface/shader_water_waves_derive.d.ts +11 -0
- package/src/shade/renderer/water/surface/shader_water_waves_derive.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/shader_water_waves_derive.js +78 -0
- package/src/shade/renderer/water/surface/spectrum/GPUWaterSpectrum.d.ts +35 -0
- package/src/shade/renderer/water/surface/spectrum/GPUWaterSpectrum.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/spectrum/GPUWaterSpectrum.js +103 -0
- package/src/shade/renderer/water/surface/spectrum/WATER_BAND_STATE.d.ts +22 -0
- package/src/shade/renderer/water/surface/spectrum/WATER_BAND_STATE.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/spectrum/WATER_BAND_STATE.js +57 -0
- package/src/shade/renderer/water/surface/spectrum/WATER_SPECTRUM.d.ts +22 -0
- package/src/shade/renderer/water/surface/spectrum/WATER_SPECTRUM.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/spectrum/WATER_SPECTRUM.js +25 -0
- package/src/shade/renderer/water/surface/spectrum/chunk_water_jonswap.d.ts +14 -0
- package/src/shade/renderer/water/surface/spectrum/chunk_water_jonswap.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/spectrum/chunk_water_jonswap.js +48 -0
- package/src/shade/renderer/water/surface/spectrum/chunk_water_spectrum.d.ts +23 -0
- package/src/shade/renderer/water/surface/spectrum/chunk_water_spectrum.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/spectrum/chunk_water_spectrum.js +169 -0
- package/src/shade/renderer/water/surface/spectrum/shader_water_spectrum.d.ts +26 -0
- package/src/shade/renderer/water/surface/spectrum/shader_water_spectrum.d.ts.map +1 -0
- package/src/shade/renderer/water/surface/spectrum/shader_water_spectrum.js +161 -0
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +18 -6
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +11 -3
- package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts +0 -28
- package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts.map +0 -1
- package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.js +0 -86
- package/src/engine/ecs/ik/IKConstraint.d.ts +0 -52
- package/src/engine/ecs/ik/IKConstraint.d.ts.map +0 -1
- package/src/engine/ecs/ik/IKConstraint.js +0 -95
- package/src/engine/ecs/ik/IKProblem.d.ts +0 -45
- package/src/engine/ecs/ik/IKProblem.d.ts.map +0 -1
- package/src/engine/ecs/ik/IKProblem.js +0 -58
- package/src/engine/ecs/ik/IKSolver.d.ts +0 -8
- package/src/engine/ecs/ik/IKSolver.d.ts.map +0 -1
- package/src/engine/ecs/ik/IKSolver.js +0 -9
- package/src/engine/ecs/ik/InverseKinematics.d.ts +0 -48
- package/src/engine/ecs/ik/InverseKinematics.d.ts.map +0 -1
- package/src/engine/ecs/ik/InverseKinematics.js +0 -119
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts +0 -19
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts.map +0 -1
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.js +0 -72
- package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts +0 -54
- package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts.map +0 -1
- package/src/engine/ecs/ik/InverseKinematicsSystem.js +0 -212
- package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.d.ts +0 -8
- package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.d.ts.map +0 -1
- package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.js +0 -153
- package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.d.ts +0 -5
- package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.d.ts.map +0 -1
- package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.js +0 -120
- package/src/engine/ecs/ik/ik_bone_chain.d.ts +0 -64
- package/src/engine/ecs/ik/ik_bone_chain.d.ts.map +0 -1
- package/src/engine/ecs/ik/ik_bone_chain.js +0 -142
- package/src/engine/ecs/ik/ik_probe_terrain_contact.d.ts +0 -42
- package/src/engine/ecs/ik/ik_probe_terrain_contact.d.ts.map +0 -1
- package/src/engine/ecs/ik/ik_probe_terrain_contact.js +0 -123
- package/src/engine/ecs/ik/ik_write_local_rotation.d.ts +0 -18
- package/src/engine/ecs/ik/ik_write_local_rotation.d.ts.map +0 -1
- package/src/engine/ecs/ik/ik_write_local_rotation.js +0 -32
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +0 -29
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +0 -1
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +0 -44
- package/src/shade/renderer/water/medium/shader_water_bodies_derive.d.ts +0 -4
- package/src/shade/renderer/water/medium/shader_water_bodies_derive.d.ts.map +0 -1
- package/src/shade/renderer/water/medium/shader_water_bodies_derive.js +0 -32
- package/src/shade/renderer/water/surface/GPUWaterWaveSimulation.d.ts +0 -25
- package/src/shade/renderer/water/surface/GPUWaterWaveSimulation.d.ts.map +0 -1
- package/src/shade/renderer/water/surface/GPUWaterWaveSimulation.js +0 -128
- package/src/shade/renderer/water/surface/chunk_water_tessellation.d.ts +0 -9
- package/src/shade/renderer/water/surface/chunk_water_tessellation.d.ts.map +0 -1
- package/src/shade/renderer/water/surface/chunk_water_tessellation.js +0 -144
- package/src/shade/renderer/water/surface/chunk_water_wave.d.ts +0 -13
- package/src/shade/renderer/water/surface/chunk_water_wave.d.ts.map +0 -1
- package/src/shade/renderer/water/surface/chunk_water_wave.js +0 -40
- package/src/shade/renderer/water/surface/shader_water_tiles.d.ts +0 -4
- package/src/shade/renderer/water/surface/shader_water_tiles.d.ts.map +0 -1
- package/src/shade/renderer/water/surface/shader_water_tiles.js +0 -123
- package/src/shade/renderer/water/surface/shader_water_wave_batch.d.ts +0 -6
- package/src/shade/renderer/water/surface/shader_water_wave_batch.d.ts.map +0 -1
- package/src/shade/renderer/water/surface/shader_water_wave_batch.js +0 -85
- package/src/shade/renderer/water/surface/shader_water_wave_domain.d.ts +0 -6
- package/src/shade/renderer/water/surface/shader_water_wave_domain.d.ts.map +0 -1
- package/src/shade/renderer/water/surface/shader_water_wave_domain.js +0 -83
|
@@ -18,12 +18,15 @@ import { POSE_ACCUMULATOR_SLOT_BYTES } from "./POSE_ACCUMULATOR_LAYOUT.js";
|
|
|
18
18
|
import { GPUStateAuthorityFlags } from "../../../engine/ecs/gpu/GPUStateAuthorityFlags.js";
|
|
19
19
|
import { gpu_authority_grant } from "../../../engine/ecs/gpu/gpu_authority_grant.js";
|
|
20
20
|
import { gpu_authority_revoke } from "../../../engine/ecs/gpu/gpu_authority_revoke.js";
|
|
21
|
+
import { gpu_authority_held } from "../../../engine/ecs/gpu/gpu_authority_held.js";
|
|
22
|
+
import { GPU_AUTHORITY_EVENT_HOLD_CHANGE } from "../../../engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.js";
|
|
21
23
|
import { row_of_entity } from "../scene/rows/GPUSceneRows.js";
|
|
22
24
|
import { gpu_authority_declare } from "../../../engine/ecs/gpu/gpu_authority_declare.js";
|
|
23
25
|
import { TransformAttachment } from "../../../engine/ecs/transform-attachment/TransformAttachment.js";
|
|
24
26
|
import { TRANSFORM_ATTACHMENT_EVENT_CHANGE } from "../../../engine/ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.js";
|
|
25
27
|
import { Transform64 } from "../../../engine/ecs/transform/Transform64.js";
|
|
26
28
|
import { pose_evaluate_local } from "./pose/pose_evaluate_local.js";
|
|
29
|
+
import { PosePlayback } from "./pose/PosePlayback.js";
|
|
27
30
|
import {
|
|
28
31
|
shader_animation_apply,
|
|
29
32
|
WORKGROUP_SIZE as ANIMATION_APPLY_WORKGROUP_SIZE,
|
|
@@ -61,12 +64,45 @@ const SEED = new Transform64();
|
|
|
61
64
|
* The one playback a released joint is evaluated against: the clip that just left it, at the
|
|
62
65
|
* time and weight it was last set to.
|
|
63
66
|
*
|
|
64
|
-
* @type {
|
|
67
|
+
* @type {PosePlayback}
|
|
65
68
|
*/
|
|
66
|
-
const SEED_PLAYBACK =
|
|
69
|
+
const SEED_PLAYBACK = new PosePlayback();
|
|
67
70
|
|
|
68
71
|
const SEED_PLAYBACKS = [SEED_PLAYBACK];
|
|
69
72
|
|
|
73
|
+
/**
|
|
74
|
+
* The pose an entity rests at: the rest the CPU twin is handed for it (`pose_evaluate_local`'s
|
|
75
|
+
* `rest`, chosen as `t64_evaluate_world` and `T64WorldCache` choose it) — its offset from its
|
|
76
|
+
* parent, or its own pose when it is attached to nothing.
|
|
77
|
+
*
|
|
78
|
+
* @param {EntityComponentDataset} dataset
|
|
79
|
+
* @param {number} entity
|
|
80
|
+
* @returns {Transform64}
|
|
81
|
+
*/
|
|
82
|
+
function rest_of(dataset, entity) {
|
|
83
|
+
const attachment = dataset.getComponent(entity, TransformAttachment);
|
|
84
|
+
|
|
85
|
+
return attachment !== undefined && attachment !== null && dataset.entityExists(attachment.parent)
|
|
86
|
+
? attachment.transform
|
|
87
|
+
: dataset.getComponent(entity, Transform64);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The rotation an entity rests at, `[x, y, z, w]` — see {@link rest_of}. Read when a clip binds
|
|
92
|
+
* the entity, which is when its offset becomes the GPU's: this side writes no local pose into a
|
|
93
|
+
* driven entity's row after that. And read again when a CPU writer's hold on it ends, which is
|
|
94
|
+
* when its offset becomes the GPU's again — see {@link GPUAnimationManager#unmute}.
|
|
95
|
+
*
|
|
96
|
+
* @param {EntityComponentDataset} dataset
|
|
97
|
+
* @param {number} entity
|
|
98
|
+
* @returns {number[]}
|
|
99
|
+
*/
|
|
100
|
+
function rest_rotation_of(dataset, entity) {
|
|
101
|
+
const rest = rest_of(dataset, entity);
|
|
102
|
+
|
|
103
|
+
return [rest.rotation_x, rest.rotation_y, rest.rotation_z, rest.rotation_w];
|
|
104
|
+
}
|
|
105
|
+
|
|
70
106
|
/*
|
|
71
107
|
Generated writers for the rows a registration adds as a run. Through `add_run` every row is a
|
|
72
108
|
reflective walk of its type, and a run is one row per keyframe, binding or joint where a chain
|
|
@@ -96,6 +132,35 @@ const CLIP_BINDINGS_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT,
|
|
|
96
132
|
*/
|
|
97
133
|
const CLIP_FLAGS_WORD = ANIMATION_CLIP_STATE_STRUCT.get('flags').offset / 4;
|
|
98
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Word of a clip record holding the first row of its bindings — where a target's binding is found.
|
|
137
|
+
*/
|
|
138
|
+
const CLIP_BINDINGS_FIRST_WORD = ANIMATION_CLIP_STATE_STRUCT.get('bindings_first').offset / 4;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* A binding's `instance` alone: what muting a held target's binding writes.
|
|
142
|
+
*/
|
|
143
|
+
const BINDING_INSTANCE_WRITER = generate_record_writer(ANIMATION_TRACK_BINDING_STRUCT, ['instance']);
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Scratch record for {@link BINDING_INSTANCE_WRITER}.
|
|
147
|
+
*
|
|
148
|
+
* @type {{instance: number}}
|
|
149
|
+
*/
|
|
150
|
+
const BINDING_INSTANCE = { instance: 0 };
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A binding's `instance` and `rest_rotation`: what unmuting it when its target's hold ends writes.
|
|
154
|
+
*/
|
|
155
|
+
const BINDING_UNMUTE_WRITER = generate_record_writer(ANIMATION_TRACK_BINDING_STRUCT, ['instance', 'rest_rotation']);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Scratch record for {@link BINDING_UNMUTE_WRITER}.
|
|
159
|
+
*
|
|
160
|
+
* @type {{instance: number, rest_rotation: number[]}}
|
|
161
|
+
*/
|
|
162
|
+
const BINDING_UNMUTE = { instance: 0, rest_rotation: [0, 0, 0, 1] };
|
|
163
|
+
|
|
99
164
|
/**
|
|
100
165
|
* Word of a skin record holding its first joint row — where its matrices start.
|
|
101
166
|
*/
|
|
@@ -261,12 +326,14 @@ export class GPUAnimationManager {
|
|
|
261
326
|
#skin_matrix_count = 0;
|
|
262
327
|
|
|
263
328
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
329
|
+
* The bound clips that drive each entity, by entity — counted by the list's length, and named
|
|
330
|
+
* so that a hold can find the bindings to mute. An entity's local TRS is the GPU's while the
|
|
331
|
+
* list is not empty and no CPU writer holds it: the first clip to bind grants
|
|
332
|
+
* `GPUStateAuthority`'s TransformAttachment bit, the last to unbind revokes it and marks the
|
|
333
|
+
* row so the CPU writes the rest pose back. Stated on the entity, never inferred from the
|
|
334
|
+
* bindings.
|
|
268
335
|
*
|
|
269
|
-
* @type {Map<number, number>}
|
|
336
|
+
* @type {Map<number, number[]>}
|
|
270
337
|
*/
|
|
271
338
|
#clips_driving = new Map();
|
|
272
339
|
|
|
@@ -296,7 +363,9 @@ export class GPUAnimationManager {
|
|
|
296
363
|
*
|
|
297
364
|
* Lazily allocated on first {@link ensure_pose_accumulator_capacity};
|
|
298
365
|
* grows by doubling. Grow destroys the old buffer — since resolve
|
|
299
|
-
*
|
|
366
|
+
* drains every sum and dirty mask, and the rest rotations are stored
|
|
367
|
+
* afresh by the contributions of the frame that reads them, no copy
|
|
368
|
+
* is needed on grow.
|
|
300
369
|
*
|
|
301
370
|
* @type {GPUBuffer|null}
|
|
302
371
|
*/
|
|
@@ -511,9 +580,10 @@ export class GPUAnimationManager {
|
|
|
511
580
|
* by the per-frame dispatch driver after `scene.build` has
|
|
512
581
|
* stabilised the transforms-table size for the frame.
|
|
513
582
|
*
|
|
514
|
-
* Grow destroys the previous GPU buffer; resolve
|
|
515
|
-
*
|
|
516
|
-
*
|
|
583
|
+
* Grow destroys the previous GPU buffer; resolve drains every sum
|
|
584
|
+
* and dirty mask at the end of each frame, and a slot's rest
|
|
585
|
+
* rotation is stored afresh by every frame that reads it, so there's
|
|
586
|
+
* nothing to copy across the realloc.
|
|
517
587
|
*
|
|
518
588
|
* @param {number} row_count
|
|
519
589
|
*/
|
|
@@ -685,11 +755,15 @@ export class GPUAnimationManager {
|
|
|
685
755
|
* playing, not looping). The clip is inert at creation — call
|
|
686
756
|
* {@link start} to begin GPU-side time advancement.
|
|
687
757
|
*
|
|
758
|
+
* Each binding states its target's `rest_rotation`, `[x, y, z, w]`: what a Node3D target's
|
|
759
|
+
* rotation resolves to in a frame where every rotation contributed to it sums to nothing. Only
|
|
760
|
+
* a Node3D rotation binding reads it; {@link register_clip} takes it from the target entity.
|
|
761
|
+
*
|
|
688
762
|
* @param {{
|
|
689
763
|
* time?: number,
|
|
690
764
|
* time_start?: number,
|
|
691
765
|
* time_end?: number,
|
|
692
|
-
* bindings: Array<{ track: number, instance: number, property: number }>,
|
|
766
|
+
* bindings: Array<{ track: number, instance: number, property: number, rest_rotation: ArrayLike<number> }>,
|
|
693
767
|
* }} clip
|
|
694
768
|
* @returns {number} clip id (index into the `animation_clips` table)
|
|
695
769
|
*/
|
|
@@ -724,8 +798,15 @@ export class GPUAnimationManager {
|
|
|
724
798
|
assert.isNonNegativeInteger(b.track, `clip.bindings[${i}].track`);
|
|
725
799
|
assert.isNonNegativeInteger(b.instance, `clip.bindings[${i}].instance`);
|
|
726
800
|
assert.isNonNegativeInteger(b.property, `clip.bindings[${i}].property`);
|
|
801
|
+
assert.equal(b.rest_rotation.length, 4, `clip.bindings[${i}].rest_rotation.length`);
|
|
727
802
|
|
|
728
|
-
rows[i] = {
|
|
803
|
+
rows[i] = {
|
|
804
|
+
track: b.track,
|
|
805
|
+
instance: b.instance,
|
|
806
|
+
property: b.property,
|
|
807
|
+
clip: clip_id,
|
|
808
|
+
rest_rotation: b.rest_rotation
|
|
809
|
+
};
|
|
729
810
|
}
|
|
730
811
|
|
|
731
812
|
const bindings_first = this.#database.get('animation_bindings').add_run_records(rows, BINDING_WRITER);
|
|
@@ -1194,6 +1275,7 @@ export class GPUAnimationManager {
|
|
|
1194
1275
|
*/
|
|
1195
1276
|
#try_complete_clip(pending) {
|
|
1196
1277
|
const rows = this.#scene_context.rows;
|
|
1278
|
+
const dataset = rows.dataset;
|
|
1197
1279
|
const channels = pending.channels;
|
|
1198
1280
|
const clip_id = pending.clip_id;
|
|
1199
1281
|
|
|
@@ -1208,9 +1290,15 @@ export class GPUAnimationManager {
|
|
|
1208
1290
|
|
|
1209
1291
|
bindings[i] = {
|
|
1210
1292
|
track: ch.track,
|
|
1211
|
-
|
|
1293
|
+
// a target a CPU writer holds is bound muted: see #mute
|
|
1294
|
+
instance: gpu_authority_held(dataset, target, GPUStateAuthorityFlags.TransformAttachment)
|
|
1295
|
+
? GPU_DATABASE_NULL
|
|
1296
|
+
: row_of_entity(target),
|
|
1212
1297
|
property: ch.property,
|
|
1213
1298
|
clip: clip_id,
|
|
1299
|
+
// a held target's rest is the holder's pose of the moment, taken again when the
|
|
1300
|
+
// hold ends: see #unmute
|
|
1301
|
+
rest_rotation: rest_rotation_of(rows.dataset, target),
|
|
1214
1302
|
};
|
|
1215
1303
|
}
|
|
1216
1304
|
|
|
@@ -1227,8 +1315,9 @@ export class GPUAnimationManager {
|
|
|
1227
1315
|
|
|
1228
1316
|
/**
|
|
1229
1317
|
* Hand the entities a clip drives to the GPU: the first clip to bind an entity grants its
|
|
1230
|
-
* TransformAttachment authority
|
|
1231
|
-
* and it is the GPU's until the last
|
|
1318
|
+
* TransformAttachment authority — unless a CPU writer holds it, which the grant leaves be.
|
|
1319
|
+
* Listed per entity, because two clips can drive one joint and it is the GPU's until the last
|
|
1320
|
+
* of them leaves.
|
|
1232
1321
|
*
|
|
1233
1322
|
* @param {number} clip_id
|
|
1234
1323
|
* @param {Array<{target: number}>} channels
|
|
@@ -1249,9 +1338,13 @@ export class GPUAnimationManager {
|
|
|
1249
1338
|
|
|
1250
1339
|
targets.push(target);
|
|
1251
1340
|
|
|
1252
|
-
|
|
1341
|
+
let clips = driving.get(target);
|
|
1342
|
+
|
|
1343
|
+
if (clips === undefined) {
|
|
1344
|
+
clips = [];
|
|
1345
|
+
|
|
1346
|
+
driving.set(target, clips);
|
|
1253
1347
|
|
|
1254
|
-
if (count === 0) {
|
|
1255
1348
|
/*
|
|
1256
1349
|
The first clip to drive a joint takes its offset, and with it the joint's world
|
|
1257
1350
|
and every world below: the hierarchy pass composes the subtree from the rows, and
|
|
@@ -1264,15 +1357,22 @@ export class GPUAnimationManager {
|
|
|
1264
1357
|
GPUStateAuthorityFlags.TransformAttachment | GPUStateAuthorityFlags.Transform64
|
|
1265
1358
|
);
|
|
1266
1359
|
|
|
1360
|
+
// The offset as it stands is the clip's rest, and the row's on every axis it does
|
|
1361
|
+
// not key: an announcement still waiting for the flush is skipped once the bit is set.
|
|
1362
|
+
rows.mark_handover(target);
|
|
1363
|
+
|
|
1267
1364
|
rows.for_each_descendant(target, descendant => {
|
|
1268
1365
|
// a prefab declares its animated subtree; an entity attached under a joint
|
|
1269
1366
|
// from elsewhere is declared here, at the one moment it is taken
|
|
1270
1367
|
gpu_authority_declare(dataset, descendant);
|
|
1271
1368
|
gpu_authority_grant(dataset, descendant, GPUStateAuthorityFlags.Transform64);
|
|
1272
1369
|
});
|
|
1370
|
+
|
|
1371
|
+
// A CPU writer may hold the offset now or later; it says so on the entity.
|
|
1372
|
+
dataset.addEntityEventListener(target, GPU_AUTHORITY_EVENT_HOLD_CHANGE, this.#hold_changed, this);
|
|
1273
1373
|
}
|
|
1274
1374
|
|
|
1275
|
-
|
|
1375
|
+
clips.push(clip_id);
|
|
1276
1376
|
}
|
|
1277
1377
|
|
|
1278
1378
|
this.#targets_by_clip.set(clip_id, targets);
|
|
@@ -1331,11 +1431,11 @@ export class GPUAnimationManager {
|
|
|
1331
1431
|
|
|
1332
1432
|
for (let i = 0; i < targets.length; i++) {
|
|
1333
1433
|
const target = targets[i];
|
|
1334
|
-
const
|
|
1434
|
+
const clips = driving.get(target);
|
|
1335
1435
|
|
|
1336
|
-
|
|
1337
|
-
driving.set(target, count);
|
|
1436
|
+
clips.splice(clips.indexOf(clip_id), 1);
|
|
1338
1437
|
|
|
1438
|
+
if (clips.length > 0) {
|
|
1339
1439
|
continue;
|
|
1340
1440
|
}
|
|
1341
1441
|
|
|
@@ -1345,6 +1445,8 @@ export class GPUAnimationManager {
|
|
|
1345
1445
|
continue;
|
|
1346
1446
|
}
|
|
1347
1447
|
|
|
1448
|
+
dataset.removeEntityEventListener(target, GPU_AUTHORITY_EVENT_HOLD_CHANGE, this.#hold_changed, this);
|
|
1449
|
+
|
|
1348
1450
|
/*
|
|
1349
1451
|
The joint's offset comes back to the CPU seeded with the pose the clip left it in,
|
|
1350
1452
|
evaluated at the clip's own last time and weight — what the accumulator last
|
|
@@ -1352,10 +1454,22 @@ export class GPUAnimationManager {
|
|
|
1352
1454
|
snapping to the rest pose. Then the world of the joint and of everything under it
|
|
1353
1455
|
that no other clip still drives from above, and the announcement that recomposes
|
|
1354
1456
|
the returned subtree on this side and marks the row.
|
|
1457
|
+
|
|
1458
|
+
Unless a CPU writer holds the offset — a cloth simulating a cape joint the clip also
|
|
1459
|
+
keyed. Then the offset was never the clip's to hand back, and what the holder last
|
|
1460
|
+
wrote stands, after the hold as well: nothing binds the joint to take it back when the
|
|
1461
|
+
hold ends, so it stays the CPU's wherever the holder left it. That is the seed's own
|
|
1462
|
+
rule rather than an exception to it. The seed carries on from what is on screen, and a
|
|
1463
|
+
held joint shows its holder: the clip has been muted since the hold began, or since it
|
|
1464
|
+
bound, so its last pose is one the joint has not shown since, and seeding it would
|
|
1465
|
+
snap the joint there until the holder's next write put its own back. A holder that
|
|
1466
|
+
wants another offset left behind — one it captured — writes it before it lets go.
|
|
1355
1467
|
*/
|
|
1356
1468
|
const attachment = dataset.getComponent(target, TransformAttachment);
|
|
1357
1469
|
|
|
1358
|
-
|
|
1470
|
+
const held = gpu_authority_held(dataset, target, GPUStateAuthorityFlags.TransformAttachment);
|
|
1471
|
+
|
|
1472
|
+
if (!held && attachment !== undefined && attachment !== null && shadow !== undefined) {
|
|
1359
1473
|
SEED_PLAYBACK.clip = shadow.clip;
|
|
1360
1474
|
SEED_PLAYBACK.time = shadow.time;
|
|
1361
1475
|
SEED_PLAYBACK.weight = shadow.weight;
|
|
@@ -1388,6 +1502,120 @@ export class GPUAnimationManager {
|
|
|
1388
1502
|
}
|
|
1389
1503
|
}
|
|
1390
1504
|
|
|
1505
|
+
/**
|
|
1506
|
+
* A CPU writer took or gave back the offset of an entity a clip drives — see
|
|
1507
|
+
* `GPUStateAuthority#held`. Listened for on every driven entity, from the first clip that binds
|
|
1508
|
+
* it to the last that leaves.
|
|
1509
|
+
*
|
|
1510
|
+
* Taken: every binding naming the entity is muted, and the hold has already cleared the bit,
|
|
1511
|
+
* so from the next frame the row is the holder's offset and nothing else; the row is marked so
|
|
1512
|
+
* the flush carries it whether or not the holder has announced a write yet. Given back with a
|
|
1513
|
+
* clip still bound: unmuted with the rest the holder left, the row marked so that offset goes
|
|
1514
|
+
* up with it (`GPUSceneRows#mark_handover`), and the joint is the clip's again.
|
|
1515
|
+
*
|
|
1516
|
+
* @param {number} _event the entity, as {@link gpu_authority_hold} sends it
|
|
1517
|
+
* @param {number} entity
|
|
1518
|
+
*/
|
|
1519
|
+
#hold_changed(_event, entity) {
|
|
1520
|
+
const rows = this.#scene_context.rows;
|
|
1521
|
+
const dataset = rows.dataset;
|
|
1522
|
+
|
|
1523
|
+
if (gpu_authority_held(dataset, entity, GPUStateAuthorityFlags.TransformAttachment)) {
|
|
1524
|
+
this.#mute(entity);
|
|
1525
|
+
|
|
1526
|
+
rows.mark_local(entity);
|
|
1527
|
+
} else {
|
|
1528
|
+
this.#unmute(entity, dataset);
|
|
1529
|
+
|
|
1530
|
+
rows.mark_handover(entity);
|
|
1531
|
+
|
|
1532
|
+
gpu_authority_grant(dataset, entity, GPUStateAuthorityFlags.TransformAttachment);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Point every binding that names `entity` — in every clip driving it — at
|
|
1538
|
+
* {@link GPU_DATABASE_NULL}.
|
|
1539
|
+
*
|
|
1540
|
+
* **The bit does not stop a clip on the GPU.** No pass reads `GPUStateAuthority`: the apply
|
|
1541
|
+
* pass adds every binding into its target's accumulator slot and the resolve writes the row,
|
|
1542
|
+
* after the CPU's flush, every frame, whatever its weight. So a held joint whose bindings still
|
|
1543
|
+
* named its row would show the clip and not its holder. A muted binding names no object —
|
|
1544
|
+
* `write_object_property` writes nothing for the type bits of {@link GPU_DATABASE_NULL} —
|
|
1545
|
+
* so its target's slot stays empty and the resolve leaves the row as the flush wrote it. The
|
|
1546
|
+
* rest of the clip plays as before.
|
|
1547
|
+
*
|
|
1548
|
+
* Only the `instance` word of each binding is written.
|
|
1549
|
+
*
|
|
1550
|
+
* @param {number} entity
|
|
1551
|
+
*/
|
|
1552
|
+
#mute(entity) {
|
|
1553
|
+
BINDING_INSTANCE.instance = GPU_DATABASE_NULL;
|
|
1554
|
+
|
|
1555
|
+
this.#write_bindings(entity, BINDING_INSTANCE, BINDING_INSTANCE_WRITER);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* The reverse of {@link #mute}, when the hold ends: every binding naming `entity` names its row
|
|
1560
|
+
* again, and carries the rest the entity has now.
|
|
1561
|
+
*
|
|
1562
|
+
* The rest a binding took when it bound is not the rest any more. The holder wrote the offset
|
|
1563
|
+
* all through the hold and leaves it where it leaves it — its last pose, or one it captured and
|
|
1564
|
+
* put back — and that offset is the rest the CPU twin reads from here on. A binding that bound
|
|
1565
|
+
* before the hold took the rest from before it; one that bound during it, muted, took the
|
|
1566
|
+
* holder's pose of that moment. Either would resolve a rotation summing to nothing somewhere the
|
|
1567
|
+
* twin does not, and a socket would sit off the drawn mesh.
|
|
1568
|
+
*
|
|
1569
|
+
* @param {number} entity
|
|
1570
|
+
* @param {EntityComponentDataset} dataset
|
|
1571
|
+
*/
|
|
1572
|
+
#unmute(entity, dataset) {
|
|
1573
|
+
const rest = rest_of(dataset, entity);
|
|
1574
|
+
const rest_rotation = BINDING_UNMUTE.rest_rotation;
|
|
1575
|
+
|
|
1576
|
+
BINDING_UNMUTE.instance = row_of_entity(entity);
|
|
1577
|
+
|
|
1578
|
+
rest_rotation[0] = rest.rotation_x;
|
|
1579
|
+
rest_rotation[1] = rest.rotation_y;
|
|
1580
|
+
rest_rotation[2] = rest.rotation_z;
|
|
1581
|
+
rest_rotation[3] = rest.rotation_w;
|
|
1582
|
+
|
|
1583
|
+
this.#write_bindings(entity, BINDING_UNMUTE, BINDING_UNMUTE_WRITER);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* Write `fields` into every binding that names `entity`, in every clip driving it. A binding's
|
|
1588
|
+
* place in its clip's run is its channel's, so the clip's own channels say which rows of the
|
|
1589
|
+
* run to touch.
|
|
1590
|
+
*
|
|
1591
|
+
* @param {number} entity
|
|
1592
|
+
* @param {object} fields
|
|
1593
|
+
* @param {GPURecordWriter} writer
|
|
1594
|
+
*/
|
|
1595
|
+
#write_bindings(entity, fields, writer) {
|
|
1596
|
+
const clips = this.#clips_driving.get(entity);
|
|
1597
|
+
|
|
1598
|
+
if (clips === undefined) {
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
const clips_table = this.#database.get('animation_clips');
|
|
1603
|
+
const bindings = this.#database.get('animation_bindings');
|
|
1604
|
+
|
|
1605
|
+
for (let c = 0; c < clips.length; c++) {
|
|
1606
|
+
const clip_id = clips[c];
|
|
1607
|
+
|
|
1608
|
+
const first = clips_table.get_word(clip_id, CLIP_BINDINGS_FIRST_WORD);
|
|
1609
|
+
const channels = this.#playback_by_clip.get(clip_id).clip.channels;
|
|
1610
|
+
|
|
1611
|
+
for (let i = 0; i < channels.length; i++) {
|
|
1612
|
+
if (channels[i].target === entity) {
|
|
1613
|
+
bindings.set_fields(first + i, fields, writer);
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1391
1619
|
/**
|
|
1392
1620
|
* Drop a clip from the manager: its row, and with it the run of its bindings — the clip's range
|
|
1393
1621
|
* owns the run, so the table removes it. Tolerates the clip still being pending (drains it from
|
|
@@ -11,15 +11,22 @@
|
|
|
11
11
|
* Per-axis dirty bits live in a single dirty u32 (atomicOr to set,
|
|
12
12
|
* atomicLoad in resolve, atomicStore(0) to clear).
|
|
13
13
|
*
|
|
14
|
-
* Layout in u32 indices (slot stride = 16 u32s = 64 bytes —
|
|
15
|
-
* tail padding
|
|
14
|
+
* Layout in u32 indices (slot stride = 16 u32s = 64 bytes — one u32 of
|
|
15
|
+
* tail padding gives the slot a power-of-two stride so addressing is a
|
|
16
16
|
* shift, not a multiply):
|
|
17
17
|
*
|
|
18
18
|
* [0..3] translation.xyz (3 atomic<u32>, f32 bitcast)
|
|
19
19
|
* [3..7] rotation.xyzw (4 atomic<u32>, f32 bitcast)
|
|
20
20
|
* [7..10] scale.xyz (3 atomic<u32>, f32 bitcast)
|
|
21
21
|
* [10] dirty_mask (atomic<u32>, see flag bits below)
|
|
22
|
-
* [11..
|
|
22
|
+
* [11..15] rest_rotation.xyzw (4 atomic<u32>, f32 bitcast)
|
|
23
|
+
* [15] padding
|
|
24
|
+
*
|
|
25
|
+
* `rest_rotation` is not a sum. Every rotation contribution stores its
|
|
26
|
+
* target's rest rotation there, whatever its weight, and the resolve
|
|
27
|
+
* writes it to the row when the rotation sum has length zero. It is not
|
|
28
|
+
* drained: a row is only rotation-dirty in a frame some contribution
|
|
29
|
+
* stored it afresh.
|
|
23
30
|
*
|
|
24
31
|
* `dirty_mask` bit layout:
|
|
25
32
|
* bits 0–2: translation x/y/z written this frame
|
|
@@ -35,7 +42,7 @@
|
|
|
35
42
|
*/
|
|
36
43
|
/**
|
|
37
44
|
* u32-stride per pose-accumulator slot. Picked to be a power of two so
|
|
38
|
-
* `row << 4` works as the slot offset.
|
|
45
|
+
* `row << 4` works as the slot offset. 15 u32s are used, 1 is padding.
|
|
39
46
|
* @type {number}
|
|
40
47
|
*/
|
|
41
48
|
export const POSE_ACCUMULATOR_STRIDE: number;
|
|
@@ -51,6 +58,7 @@ export const POSE_ACCUMULATOR_OFFSET_TRANSLATION: 0;
|
|
|
51
58
|
export const POSE_ACCUMULATOR_OFFSET_ROTATION: 3;
|
|
52
59
|
export const POSE_ACCUMULATOR_OFFSET_SCALE: 7;
|
|
53
60
|
export const POSE_ACCUMULATOR_OFFSET_DIRTY: 10;
|
|
61
|
+
export const POSE_ACCUMULATOR_OFFSET_REST_ROTATION: 11;
|
|
54
62
|
/**
|
|
55
63
|
* Dirty-mask bit layout. Per-axis for T/S, single bit for R.
|
|
56
64
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POSE_ACCUMULATOR_LAYOUT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"POSE_ACCUMULATOR_LAYOUT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;GAIG;AACH,sCAFU,MAAM,CAE0B;AAE1C;;;;;GAKG;AACH,0CAFU,MAAM,CAEuD;AAEvE,gDAAgD;AAChD,oDAAqD;AACrD,iDAAkD;AAClD,8CAA+C;AAC/C,+CAAgD;AAChD,uDAAwD;AAExD;;GAEG;AACH,mCAAoC;AACpC,mCAAoC;AACpC,mCAAoC;AACpC,kCAAmC;AACnC,mCAAoC;AACpC,mCAAoC;AACpC,mCAAoC"}
|
|
@@ -11,15 +11,22 @@
|
|
|
11
11
|
* Per-axis dirty bits live in a single dirty u32 (atomicOr to set,
|
|
12
12
|
* atomicLoad in resolve, atomicStore(0) to clear).
|
|
13
13
|
*
|
|
14
|
-
* Layout in u32 indices (slot stride = 16 u32s = 64 bytes —
|
|
15
|
-
* tail padding
|
|
14
|
+
* Layout in u32 indices (slot stride = 16 u32s = 64 bytes — one u32 of
|
|
15
|
+
* tail padding gives the slot a power-of-two stride so addressing is a
|
|
16
16
|
* shift, not a multiply):
|
|
17
17
|
*
|
|
18
18
|
* [0..3] translation.xyz (3 atomic<u32>, f32 bitcast)
|
|
19
19
|
* [3..7] rotation.xyzw (4 atomic<u32>, f32 bitcast)
|
|
20
20
|
* [7..10] scale.xyz (3 atomic<u32>, f32 bitcast)
|
|
21
21
|
* [10] dirty_mask (atomic<u32>, see flag bits below)
|
|
22
|
-
* [11..
|
|
22
|
+
* [11..15] rest_rotation.xyzw (4 atomic<u32>, f32 bitcast)
|
|
23
|
+
* [15] padding
|
|
24
|
+
*
|
|
25
|
+
* `rest_rotation` is not a sum. Every rotation contribution stores its
|
|
26
|
+
* target's rest rotation there, whatever its weight, and the resolve
|
|
27
|
+
* writes it to the row when the rotation sum has length zero. It is not
|
|
28
|
+
* drained: a row is only rotation-dirty in a frame some contribution
|
|
29
|
+
* stored it afresh.
|
|
23
30
|
*
|
|
24
31
|
* `dirty_mask` bit layout:
|
|
25
32
|
* bits 0–2: translation x/y/z written this frame
|
|
@@ -36,7 +43,7 @@
|
|
|
36
43
|
|
|
37
44
|
/**
|
|
38
45
|
* u32-stride per pose-accumulator slot. Picked to be a power of two so
|
|
39
|
-
* `row << 4` works as the slot offset.
|
|
46
|
+
* `row << 4` works as the slot offset. 15 u32s are used, 1 is padding.
|
|
40
47
|
* @type {number}
|
|
41
48
|
*/
|
|
42
49
|
export const POSE_ACCUMULATOR_STRIDE = 16;
|
|
@@ -54,6 +61,7 @@ export const POSE_ACCUMULATOR_OFFSET_TRANSLATION = 0;
|
|
|
54
61
|
export const POSE_ACCUMULATOR_OFFSET_ROTATION = 3;
|
|
55
62
|
export const POSE_ACCUMULATOR_OFFSET_SCALE = 7;
|
|
56
63
|
export const POSE_ACCUMULATOR_OFFSET_DIRTY = 10;
|
|
64
|
+
export const POSE_ACCUMULATOR_OFFSET_REST_ROTATION = 11;
|
|
57
65
|
|
|
58
66
|
/**
|
|
59
67
|
* Dirty-mask bit layout. Per-axis for T/S, single bit for R.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_pose_accumulator.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/chunk_pose_accumulator.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_pose_accumulator.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/chunk_pose_accumulator.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;GAgBG;AACH,qCAFU,SAAS,CAwGgB;0BAzIT,iCAAiC"}
|
|
@@ -2,6 +2,7 @@ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
|
2
2
|
import { chunk_atomic_add_f32_storage } from "../shader/chunk/atomic/chunk_atomic_add_f32_storage.js";
|
|
3
3
|
import {
|
|
4
4
|
POSE_ACCUMULATOR_OFFSET_DIRTY,
|
|
5
|
+
POSE_ACCUMULATOR_OFFSET_REST_ROTATION,
|
|
5
6
|
POSE_ACCUMULATOR_OFFSET_ROTATION,
|
|
6
7
|
POSE_ACCUMULATOR_OFFSET_SCALE,
|
|
7
8
|
POSE_ACCUMULATOR_OFFSET_TRANSLATION,
|
|
@@ -40,6 +41,7 @@ const POSE_OFFSET_TRANSLATION: u32 = ${POSE_ACCUMULATOR_OFFSET_TRANSLATION}u;
|
|
|
40
41
|
const POSE_OFFSET_ROTATION: u32 = ${POSE_ACCUMULATOR_OFFSET_ROTATION}u;
|
|
41
42
|
const POSE_OFFSET_SCALE: u32 = ${POSE_ACCUMULATOR_OFFSET_SCALE}u;
|
|
42
43
|
const POSE_OFFSET_DIRTY: u32 = ${POSE_ACCUMULATOR_OFFSET_DIRTY}u;
|
|
44
|
+
const POSE_OFFSET_REST_ROTATION: u32 = ${POSE_ACCUMULATOR_OFFSET_REST_ROTATION}u;
|
|
43
45
|
|
|
44
46
|
const POSE_DIRTY_TX: u32 = ${POSE_DIRTY_TX}u;
|
|
45
47
|
const POSE_DIRTY_TY: u32 = ${POSE_DIRTY_TY}u;
|
|
@@ -75,7 +77,7 @@ fn pose_accumulator_add_translation(row: u32, value: vec3<f32>, mask: u32) {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
fn pose_accumulator_add_rotation(row: u32, value: vec4<f32>, mask: u32, weight: f32) {
|
|
80
|
+
fn pose_accumulator_add_rotation(row: u32, value: vec4<f32>, mask: u32, weight: f32, rest: vec4<f32>) {
|
|
79
81
|
// Rotation tracks normally cover all four channels (quaternion is one
|
|
80
82
|
// unit). Channels missing from the mask must default to the identity
|
|
81
83
|
// quaternion (0, 0, 0, 1): the evaluator leaves them at 0, which is
|
|
@@ -100,6 +102,17 @@ fn pose_accumulator_add_rotation(row: u32, value: vec4<f32>, mask: u32, weight:
|
|
|
100
102
|
atomic_add_f32_storage(&pose_accumulator[base + 1u], value.y);
|
|
101
103
|
atomic_add_f32_storage(&pose_accumulator[base + 2u], value.z);
|
|
102
104
|
atomic_add_f32_storage(&pose_accumulator[base + 3u], w);
|
|
105
|
+
|
|
106
|
+
// The target's rest rotation, stored rather than added, by every contribution whatever its
|
|
107
|
+
// weight: the resolve writes it when the sum has length zero, which is every clip rotating the
|
|
108
|
+
// joint playing at weight zero, and by then the row holds the last clip's pose rather than the
|
|
109
|
+
// rest. Every binding of one target carries the same rest, so concurrent stores agree.
|
|
110
|
+
let rest_base = pose_accumulator_slot_base(row) + POSE_OFFSET_REST_ROTATION;
|
|
111
|
+
atomicStore(&pose_accumulator[rest_base + 0u], bitcast<u32>(rest.x));
|
|
112
|
+
atomicStore(&pose_accumulator[rest_base + 1u], bitcast<u32>(rest.y));
|
|
113
|
+
atomicStore(&pose_accumulator[rest_base + 2u], bitcast<u32>(rest.z));
|
|
114
|
+
atomicStore(&pose_accumulator[rest_base + 3u], bitcast<u32>(rest.w));
|
|
115
|
+
|
|
103
116
|
atomicOr(&pose_accumulator[pose_accumulator_slot_base(row) + POSE_OFFSET_DIRTY], POSE_DIRTY_R);
|
|
104
117
|
}
|
|
105
118
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../ShadeAnimationChannel.js").ShadeAnimationChannel} ShadeAnimationChannel
|
|
3
|
+
* @typedef {import("../ShadeAnimationClip.js").ShadeAnimationClip} ShadeAnimationClip
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* What {@link PoseChannelIndex#group_of} answers for an entity the clip has no track for.
|
|
7
|
+
*
|
|
8
|
+
* @type {number}
|
|
9
|
+
*/
|
|
10
|
+
export const POSE_CHANNEL_GROUP_NONE: number;
|
|
11
|
+
/**
|
|
12
|
+
* A clip's channels grouped by the entity each names, for the CPU pose twin to look one entity up
|
|
13
|
+
* in, rather than scan the whole clip for it once per level of every query.
|
|
14
|
+
*
|
|
15
|
+
* The groups are laid end to end in one array, each in the clip's own order, with a table of where
|
|
16
|
+
* each starts and a {@link Uint32Map} from entity to group: on a 70-joint clip of 210 channels it
|
|
17
|
+
* holds a few KiB, against the ~25 KiB of the clip itself, and nothing in it is handed out to be
|
|
18
|
+
* written. Read it with {@link group_of}, {@link first}, {@link end} and {@link channel}.
|
|
19
|
+
*
|
|
20
|
+
* Built once per clip ({@link of}) and checked, not rebuilt, each time a playback takes the clip
|
|
21
|
+
* again.
|
|
22
|
+
*
|
|
23
|
+
* @author Alex Goldring
|
|
24
|
+
* @copyright Company Named Limited (c) 2026
|
|
25
|
+
*/
|
|
26
|
+
export class PoseChannelIndex {
|
|
27
|
+
/**
|
|
28
|
+
* The clip's index, as the clip holds its channels now: the one built before when it still
|
|
29
|
+
* holds, a new one otherwise.
|
|
30
|
+
*
|
|
31
|
+
* @param {ShadeAnimationClip} clip
|
|
32
|
+
* @returns {PoseChannelIndex}
|
|
33
|
+
*/
|
|
34
|
+
static of(clip: ShadeAnimationClip): PoseChannelIndex;
|
|
35
|
+
/**
|
|
36
|
+
* @param {ShadeAnimationChannel[]} channels a clip's channels
|
|
37
|
+
*/
|
|
38
|
+
constructor(channels: ShadeAnimationChannel[]);
|
|
39
|
+
/**
|
|
40
|
+
* The group of channels naming `entity`, or {@link POSE_CHANNEL_GROUP_NONE} where the clip has no
|
|
41
|
+
* track for it — which is most entities for most clips.
|
|
42
|
+
*
|
|
43
|
+
* @param {number} entity
|
|
44
|
+
* @returns {number}
|
|
45
|
+
*/
|
|
46
|
+
group_of(entity: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* @param {number} group
|
|
49
|
+
* @returns {number} the position of the group's first channel
|
|
50
|
+
*/
|
|
51
|
+
first(group: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* @param {number} group
|
|
54
|
+
* @returns {number} one past the position of the group's last channel
|
|
55
|
+
*/
|
|
56
|
+
end(group: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* @param {number} position from {@link first} up to {@link end}
|
|
59
|
+
* @returns {ShadeAnimationChannel}
|
|
60
|
+
*/
|
|
61
|
+
channel(position: number): ShadeAnimationChannel;
|
|
62
|
+
/**
|
|
63
|
+
* Whether this still describes `channels`: every channel naming an entity is where this put it
|
|
64
|
+
* — the same channel, naming the same entity, in the same order among that entity's — and there
|
|
65
|
+
* are as many as there were. A walk of the clip without allocation.
|
|
66
|
+
*
|
|
67
|
+
* @param {ShadeAnimationChannel[]} channels
|
|
68
|
+
* @returns {boolean}
|
|
69
|
+
*/
|
|
70
|
+
holds(channels: ShadeAnimationChannel[]): boolean;
|
|
71
|
+
#private;
|
|
72
|
+
}
|
|
73
|
+
export namespace PoseChannelIndex {
|
|
74
|
+
let EMPTY: PoseChannelIndex;
|
|
75
|
+
}
|
|
76
|
+
export type ShadeAnimationChannel = import("../ShadeAnimationChannel.js").ShadeAnimationChannel;
|
|
77
|
+
export type ShadeAnimationClip = import("../ShadeAnimationClip.js").ShadeAnimationClip;
|
|
78
|
+
//# sourceMappingURL=PoseChannelIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoseChannelIndex.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/animation/pose/PoseChannelIndex.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;GAIG;AACH,sCAFU,MAAM,CAEyC;AAmCzD;;;;;;;;;;;;;;GAcG;AACH;IAsLI;;;;;;OAMG;IACH,gBAHW,kBAAkB,GAChB,gBAAgB,CAe5B;IA7KD;;OAEG;IACH,sBAFW,qBAAqB,EAAE,EA0DjC;IAED;;;;;;OAMG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,aAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,WAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,kBAHW,MAAM,GACJ,qBAAqB,CAIjC;IAED;;;;;;;OAOG;IACH,gBAHW,qBAAqB,EAAE,GACrB,OAAO,CAiDnB;;CAuBJ;;eAMS,gBAAgB;;oCA5Qb,OAAO,6BAA6B,EAAE,qBAAqB;iCAC3D,OAAO,0BAA0B,EAAE,kBAAkB"}
|