@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
|
@@ -47,6 +47,26 @@ export class GPUStateAuthority {
|
|
|
47
47
|
* @type {number}
|
|
48
48
|
*/
|
|
49
49
|
flags: number;
|
|
50
|
+
/**
|
|
51
|
+
* Bitwise OR of the {@link GPUStateAuthorityFlags} a CPU writer holds against the GPU: a cloth
|
|
52
|
+
* simulating a cape joint's offset, while a clip may be bound to the same joint.
|
|
53
|
+
*
|
|
54
|
+
* Two writers want one component, and a hold is how the CPU one wins. A held bit is never set
|
|
55
|
+
* in {@link flags}: holding clears it, and a GPU writer's grant does not set it while the hold
|
|
56
|
+
* lasts. Whoever writes on the GPU hears of the hold (see
|
|
57
|
+
* {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE}) and stops, and takes the component back when it
|
|
58
|
+
* ends. So {@link flags} stays the one statement of who writes, and what is held is why the GPU
|
|
59
|
+
* does not.
|
|
60
|
+
*
|
|
61
|
+
* One holder per component: a second CPU writer of the same component is the same race in
|
|
62
|
+
* another place, and holding twice is an error.
|
|
63
|
+
*
|
|
64
|
+
* Read it through {@link gpu_authority_held} and write it through {@link gpu_authority_hold} /
|
|
65
|
+
* {@link gpu_authority_unhold}.
|
|
66
|
+
*
|
|
67
|
+
* @type {number}
|
|
68
|
+
*/
|
|
69
|
+
held: number;
|
|
50
70
|
}
|
|
51
71
|
export namespace GPUStateAuthority {
|
|
52
72
|
let typeName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUStateAuthority.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/GPUStateAuthority.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;
|
|
1
|
+
{"version":3,"file":"GPUStateAuthority.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/GPUStateAuthority.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IAiCI;;;OAGG;IACH,oBAHW,MAAM,GACJ,iBAAiB,CAQ7B;IA1CD;;;;;;;;OAQG;IACH,OAFU,MAAM,CAEN;IAEV;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAFU,MAAM,CAEP;CAaZ;;kBAIS,MAAM;sBASN,OAAO"}
|
|
@@ -43,6 +43,27 @@ export class GPUStateAuthority {
|
|
|
43
43
|
*/
|
|
44
44
|
flags = 0;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Bitwise OR of the {@link GPUStateAuthorityFlags} a CPU writer holds against the GPU: a cloth
|
|
48
|
+
* simulating a cape joint's offset, while a clip may be bound to the same joint.
|
|
49
|
+
*
|
|
50
|
+
* Two writers want one component, and a hold is how the CPU one wins. A held bit is never set
|
|
51
|
+
* in {@link flags}: holding clears it, and a GPU writer's grant does not set it while the hold
|
|
52
|
+
* lasts. Whoever writes on the GPU hears of the hold (see
|
|
53
|
+
* {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE}) and stops, and takes the component back when it
|
|
54
|
+
* ends. So {@link flags} stays the one statement of who writes, and what is held is why the GPU
|
|
55
|
+
* does not.
|
|
56
|
+
*
|
|
57
|
+
* One holder per component: a second CPU writer of the same component is the same race in
|
|
58
|
+
* another place, and holding twice is an error.
|
|
59
|
+
*
|
|
60
|
+
* Read it through {@link gpu_authority_held} and write it through {@link gpu_authority_hold} /
|
|
61
|
+
* {@link gpu_authority_unhold}.
|
|
62
|
+
*
|
|
63
|
+
* @type {number}
|
|
64
|
+
*/
|
|
65
|
+
held = 0;
|
|
66
|
+
|
|
46
67
|
/**
|
|
47
68
|
* @param {number} [flags]
|
|
48
69
|
* @returns {GPUStateAuthority}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sent on an entity when a CPU writer takes or gives back a component it holds against the GPU —
|
|
3
|
+
* see {@link GPUStateAuthority#held}. The payload is the entity.
|
|
4
|
+
*
|
|
5
|
+
* What a GPU writer listens for on the entities it drives: a hold means stop writing, and the end of
|
|
6
|
+
* one means it may take the component back. Read the state off the entity rather than off the
|
|
7
|
+
* event; one event names both transitions.
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export const GPU_AUTHORITY_EVENT_HOLD_CHANGE: "@gpu_authority/hold_change";
|
|
13
|
+
//# sourceMappingURL=GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,2EAA4E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sent on an entity when a CPU writer takes or gives back a component it holds against the GPU —
|
|
3
|
+
* see {@link GPUStateAuthority#held}. The payload is the entity.
|
|
4
|
+
*
|
|
5
|
+
* What a GPU writer listens for on the entities it drives: a hold means stop writing, and the end of
|
|
6
|
+
* one means it may take the component back. Read the state off the entity rather than off the
|
|
7
|
+
* event; one event names both transitions.
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export const GPU_AUTHORITY_EVENT_HOLD_CHANGE = "@gpu_authority/hold_change";
|
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
* declaration site that was missed, and adding the component here to paper over it is exactly the
|
|
7
7
|
* structural churn the declaration exists to avoid.
|
|
8
8
|
*
|
|
9
|
+
* **A component a CPU writer holds is not granted** (see {@link GPUStateAuthority#held}). The hold
|
|
10
|
+
* is the reason, stated on the same component, and the GPU side takes the bit when the hold ends —
|
|
11
|
+
* {@link gpu_authority_unhold} says so on the entity. A clip binding a cloth's cape joint grants
|
|
12
|
+
* the joint's world and not its offset.
|
|
13
|
+
*
|
|
9
14
|
* @param {EntityComponentDataset} dataset
|
|
10
15
|
* @param {number} entity
|
|
11
16
|
* @param {number} flags one or more {@link GPUStateAuthorityFlags}
|
|
12
17
|
* @returns {boolean} whether anything changed — `false` when the GPU already owned all of them
|
|
18
|
+
* that are not held
|
|
13
19
|
*/
|
|
14
20
|
export function gpu_authority_grant(dataset: EntityComponentDataset, entity: number, flags: number): boolean;
|
|
15
21
|
//# sourceMappingURL=gpu_authority_grant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu_authority_grant.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_grant.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"gpu_authority_grant.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_grant.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,6EALW,MAAM,SACN,MAAM,GACJ,OAAO,CAuBnB"}
|
|
@@ -10,10 +10,16 @@ import { GPU_STATE_AUTHORITY_FLAGS_ALL, gpu_state_authority_flag_names } from ".
|
|
|
10
10
|
* declaration site that was missed, and adding the component here to paper over it is exactly the
|
|
11
11
|
* structural churn the declaration exists to avoid.
|
|
12
12
|
*
|
|
13
|
+
* **A component a CPU writer holds is not granted** (see {@link GPUStateAuthority#held}). The hold
|
|
14
|
+
* is the reason, stated on the same component, and the GPU side takes the bit when the hold ends —
|
|
15
|
+
* {@link gpu_authority_unhold} says so on the entity. A clip binding a cloth's cape joint grants
|
|
16
|
+
* the joint's world and not its offset.
|
|
17
|
+
*
|
|
13
18
|
* @param {EntityComponentDataset} dataset
|
|
14
19
|
* @param {number} entity
|
|
15
20
|
* @param {number} flags one or more {@link GPUStateAuthorityFlags}
|
|
16
21
|
* @returns {boolean} whether anything changed — `false` when the GPU already owned all of them
|
|
22
|
+
* that are not held
|
|
17
23
|
*/
|
|
18
24
|
export function gpu_authority_grant(dataset, entity, flags) {
|
|
19
25
|
assert.defined(dataset, 'dataset');
|
|
@@ -26,7 +32,7 @@ export function gpu_authority_grant(dataset, entity, flags) {
|
|
|
26
32
|
assert.ok(authority !== undefined && authority !== null, `entity ${entity} has no GPUStateAuthority — it must be declared at creation, see gpu_authority_declare`);
|
|
27
33
|
|
|
28
34
|
const before = authority.flags;
|
|
29
|
-
const after = before | flags;
|
|
35
|
+
const after = before | (flags & ~authority.held);
|
|
30
36
|
|
|
31
37
|
if (after === before) {
|
|
32
38
|
return false;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does a CPU writer hold component X of entity E against the GPU? See
|
|
3
|
+
* {@link GPUStateAuthority#held}.
|
|
4
|
+
*
|
|
5
|
+
* Asks for **all** of `flags`, as {@link gpu_authority_has} does. No component means nothing is
|
|
6
|
+
* held.
|
|
7
|
+
*
|
|
8
|
+
* @param {EntityComponentDataset} dataset
|
|
9
|
+
* @param {number} entity
|
|
10
|
+
* @param {number} flags one or more {@link GPUStateAuthorityFlags}
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
export function gpu_authority_held(dataset: EntityComponentDataset, entity: number, flags: number): boolean;
|
|
14
|
+
//# sourceMappingURL=gpu_authority_held.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu_authority_held.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_held.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,4EAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAUnB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GPUStateAuthority } from "./GPUStateAuthority.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Does a CPU writer hold component X of entity E against the GPU? See
|
|
5
|
+
* {@link GPUStateAuthority#held}.
|
|
6
|
+
*
|
|
7
|
+
* Asks for **all** of `flags`, as {@link gpu_authority_has} does. No component means nothing is
|
|
8
|
+
* held.
|
|
9
|
+
*
|
|
10
|
+
* @param {EntityComponentDataset} dataset
|
|
11
|
+
* @param {number} entity
|
|
12
|
+
* @param {number} flags one or more {@link GPUStateAuthorityFlags}
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
export function gpu_authority_held(dataset, entity, flags) {
|
|
16
|
+
const authority = dataset.getComponent(entity, GPUStateAuthority);
|
|
17
|
+
|
|
18
|
+
if (authority === undefined || authority === null) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (authority.held & flags) === flags;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Take these components for a CPU writer, against whatever writes them on the GPU, for as long as
|
|
3
|
+
* the hold lasts.
|
|
4
|
+
*
|
|
5
|
+
* A revoke says the GPU stopped writing. A hold says the CPU needs the component **whether or not
|
|
6
|
+
* the GPU wants it**: a cloth over a cape whose clip keys the same joints. The bits clear, the GPU
|
|
7
|
+
* side cannot grant them back until {@link gpu_authority_unhold}, and
|
|
8
|
+
* {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE} tells a GPU writer already driving the entity to stop.
|
|
9
|
+
*
|
|
10
|
+
* Declares the entity if it never was. A hold is a claim and has to be visible on the entity; an
|
|
11
|
+
* entity no clip has ever been able to target carries no {@link GPUStateAuthority}, and a clip that
|
|
12
|
+
* binds it later must find the hold there. Seeding a garment is that entity's moment, as binding is
|
|
13
|
+
* for a joint attached under an animated one.
|
|
14
|
+
*
|
|
15
|
+
* **Holding does not seed a value.** The component holds what the CPU last wrote, which for a joint
|
|
16
|
+
* a clip was resolving is not this frame's pose; the holder writes its own before anything reads it.
|
|
17
|
+
*
|
|
18
|
+
* @param {EntityComponentDataset} dataset
|
|
19
|
+
* @param {number} entity
|
|
20
|
+
* @param {number} flags one or more {@link GPUStateAuthorityFlags}, none of them already held
|
|
21
|
+
*/
|
|
22
|
+
export function gpu_authority_hold(dataset: EntityComponentDataset, entity: number, flags: number): void;
|
|
23
|
+
//# sourceMappingURL=gpu_authority_hold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu_authority_hold.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_hold.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,4EAHW,MAAM,SACN,MAAM,QAgBhB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { GPU_AUTHORITY_EVENT_HOLD_CHANGE } from "./GPU_AUTHORITY_EVENT_HOLD_CHANGE.js";
|
|
3
|
+
import { GPU_STATE_AUTHORITY_FLAGS_ALL, gpu_state_authority_flag_names } from "./GPUStateAuthorityFlags.js";
|
|
4
|
+
import { gpu_authority_declare } from "./gpu_authority_declare.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Take these components for a CPU writer, against whatever writes them on the GPU, for as long as
|
|
8
|
+
* the hold lasts.
|
|
9
|
+
*
|
|
10
|
+
* A revoke says the GPU stopped writing. A hold says the CPU needs the component **whether or not
|
|
11
|
+
* the GPU wants it**: a cloth over a cape whose clip keys the same joints. The bits clear, the GPU
|
|
12
|
+
* side cannot grant them back until {@link gpu_authority_unhold}, and
|
|
13
|
+
* {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE} tells a GPU writer already driving the entity to stop.
|
|
14
|
+
*
|
|
15
|
+
* Declares the entity if it never was. A hold is a claim and has to be visible on the entity; an
|
|
16
|
+
* entity no clip has ever been able to target carries no {@link GPUStateAuthority}, and a clip that
|
|
17
|
+
* binds it later must find the hold there. Seeding a garment is that entity's moment, as binding is
|
|
18
|
+
* for a joint attached under an animated one.
|
|
19
|
+
*
|
|
20
|
+
* **Holding does not seed a value.** The component holds what the CPU last wrote, which for a joint
|
|
21
|
+
* a clip was resolving is not this frame's pose; the holder writes its own before anything reads it.
|
|
22
|
+
*
|
|
23
|
+
* @param {EntityComponentDataset} dataset
|
|
24
|
+
* @param {number} entity
|
|
25
|
+
* @param {number} flags one or more {@link GPUStateAuthorityFlags}, none of them already held
|
|
26
|
+
*/
|
|
27
|
+
export function gpu_authority_hold(dataset, entity, flags) {
|
|
28
|
+
assert.defined(dataset, 'dataset');
|
|
29
|
+
assert.isNonNegativeInteger(entity, 'entity');
|
|
30
|
+
assert.isNonNegativeInteger(flags, 'flags');
|
|
31
|
+
assert.equal(flags & ~GPU_STATE_AUTHORITY_FLAGS_ALL, 0, `flags (${gpu_state_authority_flag_names(flags)}) contains bits GPUStateAuthorityFlags does not assign`);
|
|
32
|
+
|
|
33
|
+
const authority = gpu_authority_declare(dataset, entity);
|
|
34
|
+
|
|
35
|
+
assert.equal(authority.held & flags, 0, `entity ${entity} is already held for ${gpu_state_authority_flag_names(authority.held & flags)}: two CPU writers of one component`);
|
|
36
|
+
|
|
37
|
+
authority.held |= flags;
|
|
38
|
+
authority.flags &= ~flags;
|
|
39
|
+
|
|
40
|
+
dataset.sendEvent(entity, GPU_AUTHORITY_EVENT_HOLD_CHANGE, entity);
|
|
41
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End a CPU writer's hold on these components — the reverse of {@link gpu_authority_hold}.
|
|
3
|
+
*
|
|
4
|
+
* **Grants nothing.** Whether the GPU writes the component now is not the holder's to say: a clip
|
|
5
|
+
* may have bound the joint during the hold, or left it. The event tells whatever drives the entity
|
|
6
|
+
* on the GPU, and that writer takes the component back if it still wants it. With nothing driving
|
|
7
|
+
* it, it stays the CPU's, holding what the holder last wrote.
|
|
8
|
+
*
|
|
9
|
+
* @param {EntityComponentDataset} dataset
|
|
10
|
+
* @param {number} entity
|
|
11
|
+
* @param {number} flags one or more {@link GPUStateAuthorityFlags}, every one of them held
|
|
12
|
+
*/
|
|
13
|
+
export function gpu_authority_unhold(dataset: EntityComponentDataset, entity: number, flags: number): void;
|
|
14
|
+
//# sourceMappingURL=gpu_authority_unhold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu_authority_unhold.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_unhold.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,8EAHW,MAAM,SACN,MAAM,QAgBhB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { GPU_AUTHORITY_EVENT_HOLD_CHANGE } from "./GPU_AUTHORITY_EVENT_HOLD_CHANGE.js";
|
|
3
|
+
import { GPUStateAuthority } from "./GPUStateAuthority.js";
|
|
4
|
+
import { GPU_STATE_AUTHORITY_FLAGS_ALL, gpu_state_authority_flag_names } from "./GPUStateAuthorityFlags.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* End a CPU writer's hold on these components — the reverse of {@link gpu_authority_hold}.
|
|
8
|
+
*
|
|
9
|
+
* **Grants nothing.** Whether the GPU writes the component now is not the holder's to say: a clip
|
|
10
|
+
* may have bound the joint during the hold, or left it. The event tells whatever drives the entity
|
|
11
|
+
* on the GPU, and that writer takes the component back if it still wants it. With nothing driving
|
|
12
|
+
* it, it stays the CPU's, holding what the holder last wrote.
|
|
13
|
+
*
|
|
14
|
+
* @param {EntityComponentDataset} dataset
|
|
15
|
+
* @param {number} entity
|
|
16
|
+
* @param {number} flags one or more {@link GPUStateAuthorityFlags}, every one of them held
|
|
17
|
+
*/
|
|
18
|
+
export function gpu_authority_unhold(dataset, entity, flags) {
|
|
19
|
+
assert.defined(dataset, 'dataset');
|
|
20
|
+
assert.isNonNegativeInteger(entity, 'entity');
|
|
21
|
+
assert.isNonNegativeInteger(flags, 'flags');
|
|
22
|
+
assert.equal(flags & ~GPU_STATE_AUTHORITY_FLAGS_ALL, 0, `flags (${gpu_state_authority_flag_names(flags)}) contains bits GPUStateAuthorityFlags does not assign`);
|
|
23
|
+
|
|
24
|
+
const authority = dataset.getComponent(entity, GPUStateAuthority);
|
|
25
|
+
|
|
26
|
+
assert.ok(authority !== undefined && authority !== null, `entity ${entity} has no GPUStateAuthority, so nothing holds it`);
|
|
27
|
+
assert.equal(authority.held & flags, flags, `entity ${entity} is not held for ${gpu_state_authority_flag_names(flags & ~authority.held)}`);
|
|
28
|
+
|
|
29
|
+
authority.held &= ~flags;
|
|
30
|
+
|
|
31
|
+
dataset.sendEvent(entity, GPU_AUTHORITY_EVENT_HOLD_CHANGE, entity);
|
|
32
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A goal for the bone it sits on, the effector: bring it to where its target entity is, turning the
|
|
3
|
+
* bones from it up to {@link chain_root}. {@link IKGoalSystem} solves it.
|
|
4
|
+
*
|
|
5
|
+
* The tree is the {@link TransformAttachment} hierarchy, and the goal's path runs from the effector
|
|
6
|
+
* up to its chain root. A link of the path turns; the chain root turns and never moves. Joint limits
|
|
7
|
+
* are the physics `Joint` on each bone of the path.
|
|
8
|
+
*
|
|
9
|
+
* - The references are entities and are fixed while the component is attached: remove it and add it
|
|
10
|
+
* back to change them.
|
|
11
|
+
* - The goal removes itself when its target or any bone of its path is destroyed.
|
|
12
|
+
* - Weights are 0..1. Position weight 0 gives the pose the bones would have without the goal, and the
|
|
13
|
+
* pose is continuous in it. Rotation weight 0 leaves the effector's rotation riding its chain; 1
|
|
14
|
+
* gives it the target's.
|
|
15
|
+
*
|
|
16
|
+
* Bones are spawned with their model and never saved, and an entity id means nothing in a save, so
|
|
17
|
+
* neither is this.
|
|
18
|
+
*
|
|
19
|
+
* @author Alex Goldring
|
|
20
|
+
* @copyright Company Named Limited (c) 2026
|
|
21
|
+
*/
|
|
22
|
+
export class IKGoal {
|
|
23
|
+
/**
|
|
24
|
+
* @param {{target:number, chain_root:number, position_weight:number, rotation_weight:number}} options
|
|
25
|
+
* every field required
|
|
26
|
+
* @returns {IKGoal}
|
|
27
|
+
*/
|
|
28
|
+
static from({ target, chain_root, position_weight, rotation_weight }: {
|
|
29
|
+
target: number;
|
|
30
|
+
chain_root: number;
|
|
31
|
+
position_weight: number;
|
|
32
|
+
rotation_weight: number;
|
|
33
|
+
}): IKGoal;
|
|
34
|
+
/**
|
|
35
|
+
* The entity whose world pose the effector is brought to.
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
target: number;
|
|
39
|
+
/**
|
|
40
|
+
* The highest bone the goal turns: the effector itself or one of its ancestors.
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
chain_root: number;
|
|
44
|
+
/**
|
|
45
|
+
* How far toward the target the effector is pulled, 0..1.
|
|
46
|
+
* @type {number}
|
|
47
|
+
*/
|
|
48
|
+
position_weight: number;
|
|
49
|
+
/**
|
|
50
|
+
* How far toward the target's rotation the effector is turned, 0..1.
|
|
51
|
+
* @type {number}
|
|
52
|
+
*/
|
|
53
|
+
rotation_weight: number;
|
|
54
|
+
}
|
|
55
|
+
export namespace IKGoal {
|
|
56
|
+
let typeName: string;
|
|
57
|
+
let serializable: boolean;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=IKGoal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IKGoal.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKGoal.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAyBI;;;;OAIG;IACH,sEAJW;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,UAAU,EAAC,MAAM,CAAC;QAAC,eAAe,EAAC,MAAM,CAAC;QAAC,eAAe,EAAC,MAAM,CAAA;KAAC,GAEhF,MAAM,CAkBlB;IA7CD;;;OAGG;IACH,QAFU,MAAM,CAEJ;IAEZ;;;OAGG;IACH,YAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,MAAM,CAEI;CAwBvB;;kBAIS,MAAM;sBAMN,OAAO"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A goal for the bone it sits on, the effector: bring it to where its target entity is, turning the
|
|
5
|
+
* bones from it up to {@link chain_root}. {@link IKGoalSystem} solves it.
|
|
6
|
+
*
|
|
7
|
+
* The tree is the {@link TransformAttachment} hierarchy, and the goal's path runs from the effector
|
|
8
|
+
* up to its chain root. A link of the path turns; the chain root turns and never moves. Joint limits
|
|
9
|
+
* are the physics `Joint` on each bone of the path.
|
|
10
|
+
*
|
|
11
|
+
* - The references are entities and are fixed while the component is attached: remove it and add it
|
|
12
|
+
* back to change them.
|
|
13
|
+
* - The goal removes itself when its target or any bone of its path is destroyed.
|
|
14
|
+
* - Weights are 0..1. Position weight 0 gives the pose the bones would have without the goal, and the
|
|
15
|
+
* pose is continuous in it. Rotation weight 0 leaves the effector's rotation riding its chain; 1
|
|
16
|
+
* gives it the target's.
|
|
17
|
+
*
|
|
18
|
+
* Bones are spawned with their model and never saved, and an entity id means nothing in a save, so
|
|
19
|
+
* neither is this.
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2026
|
|
23
|
+
*/
|
|
24
|
+
export class IKGoal {
|
|
25
|
+
/**
|
|
26
|
+
* The entity whose world pose the effector is brought to.
|
|
27
|
+
* @type {number}
|
|
28
|
+
*/
|
|
29
|
+
target = -1;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The highest bone the goal turns: the effector itself or one of its ancestors.
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
35
|
+
chain_root = -1;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* How far toward the target the effector is pulled, 0..1.
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
position_weight = 0;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* How far toward the target's rotation the effector is turned, 0..1.
|
|
45
|
+
* @type {number}
|
|
46
|
+
*/
|
|
47
|
+
rotation_weight = 0;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {{target:number, chain_root:number, position_weight:number, rotation_weight:number}} options
|
|
51
|
+
* every field required
|
|
52
|
+
* @returns {IKGoal}
|
|
53
|
+
*/
|
|
54
|
+
static from({ target, chain_root, position_weight, rotation_weight }) {
|
|
55
|
+
assert.isNonNegativeInteger(target, 'target');
|
|
56
|
+
assert.isNonNegativeInteger(chain_root, 'chain_root');
|
|
57
|
+
assert.isNumber(position_weight, 'position_weight');
|
|
58
|
+
assert.isNumber(rotation_weight, 'rotation_weight');
|
|
59
|
+
assert.ok(position_weight >= 0 && position_weight <= 1, 'position_weight is within 0..1');
|
|
60
|
+
assert.ok(rotation_weight >= 0 && rotation_weight <= 1, 'rotation_weight is within 0..1');
|
|
61
|
+
|
|
62
|
+
const goal = new IKGoal();
|
|
63
|
+
|
|
64
|
+
goal.target = target;
|
|
65
|
+
goal.chain_root = chain_root;
|
|
66
|
+
goal.position_weight = position_weight;
|
|
67
|
+
goal.rotation_weight = rotation_weight;
|
|
68
|
+
|
|
69
|
+
return goal;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @readonly
|
|
75
|
+
* @type {string}
|
|
76
|
+
*/
|
|
77
|
+
IKGoal.typeName = "IKGoal";
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Entity ids are transient and bones are never saved: serialization is not applicable.
|
|
81
|
+
* @type {boolean}
|
|
82
|
+
*/
|
|
83
|
+
IKGoal.serializable = false;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brings bones to their goals ({@link IKGoal}): frame FABRIK over the connected paths of a model, or,
|
|
3
|
+
* for a lone path of three bones, the analytic two-bone solve.
|
|
4
|
+
*
|
|
5
|
+
* **IK holds the bones it poses** (`gpu_authority_hold` on their {@link TransformAttachment}), as
|
|
6
|
+
* cloth holds a cape's. The animation manager mutes every clip binding that names a held bone, and
|
|
7
|
+
* everything downstream — the GPU hierarchy, `t64_evaluate_world`, sockets, cloth anchors — reads the
|
|
8
|
+
* held offset, which IK writes every tick. Nothing downstream knows IK exists.
|
|
9
|
+
*
|
|
10
|
+
* - **Link:** a goal's path is held bone by bone, each offset captured, and the animated pose
|
|
11
|
+
* written at once, so no frame shows the bind pose.
|
|
12
|
+
* - **Every tick:** each bone's animated local pose is evaluated from its clips with the captured
|
|
13
|
+
* offset as its rest (`pose_evaluate_local`, never a held offset, which is IK's own answer), the
|
|
14
|
+
* paths are solved, and each held bone's whole local pose is written: translation, rotation and
|
|
15
|
+
* scale, since a hold mutes every channel.
|
|
16
|
+
* - **Unlink:** the captured offset is written back and the hold ended, for every bone no other goal
|
|
17
|
+
* still needs.
|
|
18
|
+
*
|
|
19
|
+
* A goal is rejected, holding nothing, for a chain root that is not the effector or an ancestor of
|
|
20
|
+
* it, a chain root that is no bone, a target that is gone or hangs below the goal's own path, a
|
|
21
|
+
* two-bone path whose knee has no bend side, and a cycle of groups each waiting on another. Each is a
|
|
22
|
+
* real branch and an assert, because asserts are stripped in production.
|
|
23
|
+
*
|
|
24
|
+
* A target hanging below another goal's bones in the same group is read from the solver's frames on
|
|
25
|
+
* every iteration. One hanging below another group's bones waits for that group to solve and write.
|
|
26
|
+
*
|
|
27
|
+
* Declared access: IK reads {@link Animation} and {@link AnimationGraphController}, which their
|
|
28
|
+
* drivers write, so it runs after the drivers have set this tick's clip times. A system that places a
|
|
29
|
+
* target through its own `TransformAttachment` (a physics contact probe) reads and writes that
|
|
30
|
+
* component as IK does: declared access leaves the two a cycle, and the scheduler keeps their
|
|
31
|
+
* registration order, so register it first.
|
|
32
|
+
*
|
|
33
|
+
* @author Alex Goldring
|
|
34
|
+
* @copyright Company Named Limited (c) 2026
|
|
35
|
+
*/
|
|
36
|
+
export class IKGoalSystem extends System<any> {
|
|
37
|
+
constructor();
|
|
38
|
+
dependencies: (typeof TransformAttachment | typeof IKGoal)[];
|
|
39
|
+
components_used: (ResourceAccessSpecification<typeof Transform64> | ResourceAccessSpecification<typeof AnimationGraphController> | ResourceAccessSpecification<typeof Animation> | ResourceAccessSpecification<typeof IKGoal> | ResourceAccessSpecification<typeof TransformAttachment> | ResourceAccessSpecification<typeof GPUStateAuthority> | ResourceAccessSpecification<typeof ParentEntity> | ResourceAccessSpecification<typeof Joint>)[];
|
|
40
|
+
/**
|
|
41
|
+
* The most iterations a frame FABRIK solve runs.
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
max_iterations: number;
|
|
45
|
+
/**
|
|
46
|
+
* A frame FABRIK solve stops once an iteration moves no bone this far, in world units.
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
tolerance: number;
|
|
50
|
+
/**
|
|
51
|
+
* @param {IKGoal} goal
|
|
52
|
+
* @param {TransformAttachment} attachment
|
|
53
|
+
* @param {number} entity
|
|
54
|
+
*/
|
|
55
|
+
link(goal: IKGoal, attachment: TransformAttachment, entity: number): void;
|
|
56
|
+
/**
|
|
57
|
+
* @param {IKGoal} goal
|
|
58
|
+
* @param {TransformAttachment} attachment
|
|
59
|
+
* @param {number} entity
|
|
60
|
+
*/
|
|
61
|
+
unlink(goal: IKGoal, attachment: TransformAttachment, entity: number): void;
|
|
62
|
+
update(time_delta_seconds: any): void;
|
|
63
|
+
#private;
|
|
64
|
+
}
|
|
65
|
+
import { System } from "../System.js";
|
|
66
|
+
import { TransformAttachment } from "../transform-attachment/TransformAttachment.js";
|
|
67
|
+
import { IKGoal } from "./IKGoal.js";
|
|
68
|
+
import { Transform64 } from "../transform/Transform64.js";
|
|
69
|
+
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
70
|
+
import { AnimationGraphController } from "../../graphics3/animation/AnimationGraphController.js";
|
|
71
|
+
import { Animation } from "../animation/Animation.js";
|
|
72
|
+
import { GPUStateAuthority } from "../gpu/GPUStateAuthority.js";
|
|
73
|
+
import { ParentEntity } from "../parent/ParentEntity.js";
|
|
74
|
+
import { Joint } from "../../physics/ecs/Joint.js";
|
|
75
|
+
//# sourceMappingURL=IKGoalSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IKGoalSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKGoalSystem.js"],"names":[],"mappings":"AAyOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;;IAEI,6DAA6C;IAE7C,kbASE;IAEF;;;OAGG;IACH,gBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,WAFU,MAAM,CAEC;IAkDjB;;;;OAIG;IACH,WAJW,MAAM,cACN,mBAAmB,UACnB,MAAM,QAgChB;IAED;;;;OAIG;IACH,aAJW,MAAM,cACN,mBAAmB,UACnB,MAAM,QAkBhB;IAED,sCA+BC;;CA6nBJ;uBA1hCsB,cAAc;oCAED,gDAAgD;uBAQ7D,aAAa;4BAD7B,6BAA6B;4CA1BQ,oDAAoD;yCAEvD,uDAAuD;0BAQtE,2BAA2B;kCAEnB,6BAA6B;6BAIlC,2BAA2B;sBAPlC,4BAA4B"}
|