@woosh/meep-engine 3.40.0 → 3.41.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/package.json +1 -1
- 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/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/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/ecs/EntityManager.d.ts +9 -1
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +26 -27
- 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/speaker/VoiceSystem.d.ts +2 -2
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- 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/SERIALIZATION_COVERAGE.md +7 -3
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +1 -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/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/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/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/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/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/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/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/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
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { quat3_multiply } from "../../../core/geom/3d/quaternion/quat3_multiply.js";
|
|
2
|
+
import { quat3_shortest_arc } from "../../../core/geom/3d/quaternion/quat3_shortest_arc.js";
|
|
3
|
+
import { Ray3 } from "../../../core/geom/3d/ray/Ray3.js";
|
|
4
|
+
import { SphereShape3D } from "../../../core/geom/3d/shape/SphereShape3D.js";
|
|
5
|
+
import { v3_quaternion_apply } from "../../../core/geom/vec3/v3_quaternion_apply.js";
|
|
6
|
+
import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
|
|
7
|
+
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
8
|
+
import { Animation } from "../../ecs/animation/Animation.js";
|
|
9
|
+
import { GPUStateAuthority } from "../../ecs/gpu/GPUStateAuthority.js";
|
|
10
|
+
import { ParentEntity } from "../../ecs/parent/ParentEntity.js";
|
|
11
|
+
import { System } from "../../ecs/System.js";
|
|
12
|
+
import { TRANSFORM_ATTACHMENT_EVENT_CHANGE } from "../../ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.js";
|
|
13
|
+
import { TransformAttachment } from "../../ecs/transform-attachment/TransformAttachment.js";
|
|
14
|
+
import { T64WorldCache } from "../../ecs/transform/T64WorldCache.js";
|
|
15
|
+
import {
|
|
16
|
+
Transform64,
|
|
17
|
+
TRANSFORM64_ROTATION_OFFSET,
|
|
18
|
+
TRANSFORM64_SCALE_OFFSET,
|
|
19
|
+
TRANSFORM64_TRANSLATION_OFFSET
|
|
20
|
+
} from "../../ecs/transform/Transform64.js";
|
|
21
|
+
import { AnimationGraphController } from "../../graphics3/animation/AnimationGraphController.js";
|
|
22
|
+
import { collect_entity_playbacks } from "../../graphics3/pose/collect_entity_playbacks.js";
|
|
23
|
+
import { PhysicsSurfacePoint } from "../queries/PhysicsSurfacePoint.js";
|
|
24
|
+
import { Collider } from "./Collider.js";
|
|
25
|
+
import { ContactProbe } from "./ContactProbe.js";
|
|
26
|
+
import { PhysicsSystem } from "./PhysicsSystem.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* One linked probe and what its casts need.
|
|
30
|
+
*/
|
|
31
|
+
class ProbeRecord {
|
|
32
|
+
/**
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
35
|
+
entity = -1;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @type {ContactProbe|null}
|
|
39
|
+
*/
|
|
40
|
+
probe = null;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @type {TransformAttachment|null}
|
|
44
|
+
*/
|
|
45
|
+
attachment = null;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The sphere a non-zero radius casts.
|
|
49
|
+
* @type {SphereShape3D}
|
|
50
|
+
*/
|
|
51
|
+
sphere = SphereShape3D.from(1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const ray = new Ray3();
|
|
55
|
+
const surface = new PhysicsSurfacePoint();
|
|
56
|
+
|
|
57
|
+
const reference_world = new Transform64();
|
|
58
|
+
const parent_world = new Transform64();
|
|
59
|
+
|
|
60
|
+
const scratch_q = new Float64Array(4);
|
|
61
|
+
const scratch_arc = new Float64Array(4);
|
|
62
|
+
const scratch_v = new Float64Array(3);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The cast's sphere turns with nothing: its orientation is the identity.
|
|
66
|
+
* @type {Float64Array}
|
|
67
|
+
*/
|
|
68
|
+
const NO_TURN = Float64Array.of(0, 0, 0, 1);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Casts each {@link ContactProbe} and places its entity at what the cast meets.
|
|
72
|
+
*
|
|
73
|
+
* Runs in `update`, where the clips' times for the tick are set: a reference a clip drives is
|
|
74
|
+
* evaluated exactly (`T64WorldCache`), as the GPU draws it.
|
|
75
|
+
*
|
|
76
|
+
* **Register it before a system that reads where it puts its entities** and that writes
|
|
77
|
+
* `TransformAttachment` too, IK's among them. Both read and write `TransformAttachment`, so the
|
|
78
|
+
* order declared access derives leaves the two a cycle, and between them the scheduler keeps the
|
|
79
|
+
* order they were registered in.
|
|
80
|
+
*
|
|
81
|
+
* @author Alex Goldring
|
|
82
|
+
* @copyright Company Named Limited (c) 2026
|
|
83
|
+
*/
|
|
84
|
+
export class ContactProbeSystem extends System {
|
|
85
|
+
|
|
86
|
+
dependencies = [ContactProbe, TransformAttachment];
|
|
87
|
+
|
|
88
|
+
components_used = [
|
|
89
|
+
ResourceAccessSpecification.from(ContactProbe, ResourceAccessKind.Read | ResourceAccessKind.Write),
|
|
90
|
+
ResourceAccessSpecification.from(TransformAttachment, ResourceAccessKind.Read | ResourceAccessKind.Write),
|
|
91
|
+
ResourceAccessSpecification.from(Transform64, ResourceAccessKind.Read),
|
|
92
|
+
ResourceAccessSpecification.from(GPUStateAuthority, ResourceAccessKind.Read),
|
|
93
|
+
ResourceAccessSpecification.from(ParentEntity, ResourceAccessKind.Read),
|
|
94
|
+
ResourceAccessSpecification.from(Collider, ResourceAccessKind.Read),
|
|
95
|
+
ResourceAccessSpecification.from(Animation, ResourceAccessKind.Read),
|
|
96
|
+
ResourceAccessSpecification.from(AnimationGraphController, ResourceAccessKind.Read),
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @type {ProbeRecord[]}
|
|
101
|
+
*/
|
|
102
|
+
#records = [];
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The root of the probe being cast: colliders whose lifetime leads to it are passed through.
|
|
106
|
+
* @type {number}
|
|
107
|
+
*/
|
|
108
|
+
#owner = -1;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* {@link #accept}, bound once.
|
|
112
|
+
* @type {function(number, Collider):boolean}
|
|
113
|
+
*/
|
|
114
|
+
#filter = (entity, collider) => this.#accept(entity);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Exact worlds per model, for one tick.
|
|
118
|
+
* @type {Map<number, T64WorldCache>}
|
|
119
|
+
*/
|
|
120
|
+
#caches = new Map();
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @type {T64WorldCache[]}
|
|
124
|
+
*/
|
|
125
|
+
#cache_list = [];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @type {Map<number, PosePlayback[]>}
|
|
129
|
+
*/
|
|
130
|
+
#playbacks = new Map();
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Which models' playbacks were collected this tick.
|
|
134
|
+
* @type {Set<number>}
|
|
135
|
+
*/
|
|
136
|
+
#collected = new Set();
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @param {ContactProbe} probe
|
|
140
|
+
* @param {TransformAttachment} attachment
|
|
141
|
+
* @param {number} entity
|
|
142
|
+
*/
|
|
143
|
+
link(probe, attachment, entity) {
|
|
144
|
+
const record = new ProbeRecord();
|
|
145
|
+
|
|
146
|
+
record.entity = entity;
|
|
147
|
+
record.probe = probe;
|
|
148
|
+
record.attachment = attachment;
|
|
149
|
+
|
|
150
|
+
this.#records.push(record);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @param {ContactProbe} probe
|
|
155
|
+
* @param {TransformAttachment} attachment
|
|
156
|
+
* @param {number} entity
|
|
157
|
+
*/
|
|
158
|
+
unlink(probe, attachment, entity) {
|
|
159
|
+
const records = this.#records;
|
|
160
|
+
|
|
161
|
+
for (let i = 0; i < records.length; i++) {
|
|
162
|
+
if (records[i].entity === entity) {
|
|
163
|
+
records.splice(i, 1);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
update(time_delta_seconds) {
|
|
170
|
+
const em = this.entityManager;
|
|
171
|
+
const dataset = em.dataset;
|
|
172
|
+
|
|
173
|
+
if (dataset === null || dataset === undefined) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const physics = em.getSystem(PhysicsSystem);
|
|
178
|
+
|
|
179
|
+
if (physics === null) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const caches = this.#cache_list;
|
|
184
|
+
|
|
185
|
+
for (let i = 0; i < caches.length; i++) {
|
|
186
|
+
caches[i].invalidate();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
this.#collected.clear();
|
|
190
|
+
|
|
191
|
+
const records = this.#records;
|
|
192
|
+
|
|
193
|
+
for (let i = 0; i < records.length; i++) {
|
|
194
|
+
this.#cast(records[i], physics, dataset);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @param {number} entity
|
|
200
|
+
* @returns {boolean} whether the cast may stop at this body
|
|
201
|
+
*/
|
|
202
|
+
#accept(entity) {
|
|
203
|
+
return root_of(this.entityManager.dataset, entity) !== this.#owner;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {ProbeRecord} record
|
|
208
|
+
* @param {PhysicsSystem} physics
|
|
209
|
+
* @param {EntityComponentDataset} dataset
|
|
210
|
+
*/
|
|
211
|
+
#cast(record, physics, dataset) {
|
|
212
|
+
const probe = record.probe;
|
|
213
|
+
const reference = probe.reference;
|
|
214
|
+
|
|
215
|
+
if (!dataset.entityExists(reference)) {
|
|
216
|
+
probe.hit = false;
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.#world_of(reference_world, reference);
|
|
221
|
+
|
|
222
|
+
const ox = reference_world[TRANSFORM64_TRANSLATION_OFFSET] + probe.offset[0];
|
|
223
|
+
const oy = reference_world[TRANSFORM64_TRANSLATION_OFFSET + 1] + probe.offset[1];
|
|
224
|
+
const oz = reference_world[TRANSFORM64_TRANSLATION_OFFSET + 2] + probe.offset[2];
|
|
225
|
+
|
|
226
|
+
const dx = probe.direction[0], dy = probe.direction[1], dz = probe.direction[2];
|
|
227
|
+
|
|
228
|
+
ray.setOrigin(ox, oy, oz);
|
|
229
|
+
ray.setDirection(dx, dy, dz);
|
|
230
|
+
ray.tMax = probe.distance;
|
|
231
|
+
|
|
232
|
+
this.#owner = root_of(dataset, record.entity);
|
|
233
|
+
|
|
234
|
+
let hit;
|
|
235
|
+
|
|
236
|
+
if (probe.radius === 0) {
|
|
237
|
+
hit = physics.raycast(ray, surface, this.#filter);
|
|
238
|
+
} else {
|
|
239
|
+
record.sphere.radius = probe.radius;
|
|
240
|
+
|
|
241
|
+
hit = physics.shapeCast(ray, record.sphere, NO_TURN, surface, this.#filter);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
probe.hit = hit;
|
|
245
|
+
|
|
246
|
+
// where the entity goes, and how it is turned, in world
|
|
247
|
+
let px, py, pz;
|
|
248
|
+
|
|
249
|
+
const rx = reference_world[TRANSFORM64_ROTATION_OFFSET];
|
|
250
|
+
const ry = reference_world[TRANSFORM64_ROTATION_OFFSET + 1];
|
|
251
|
+
const rz = reference_world[TRANSFORM64_ROTATION_OFFSET + 2];
|
|
252
|
+
const rw = reference_world[TRANSFORM64_ROTATION_OFFSET + 3];
|
|
253
|
+
|
|
254
|
+
if (hit) {
|
|
255
|
+
const nx = surface.normal[0], ny = surface.normal[1], nz = surface.normal[2];
|
|
256
|
+
|
|
257
|
+
// a sphere's centre stands off the surface by its radius
|
|
258
|
+
px = surface.position[0] - nx * probe.radius;
|
|
259
|
+
py = surface.position[1] - ny * probe.radius;
|
|
260
|
+
pz = surface.position[2] - nz * probe.radius;
|
|
261
|
+
|
|
262
|
+
// the reference, tilted so that its up is the surface's
|
|
263
|
+
quat3_shortest_arc(scratch_arc, 0, 0, 1, 0, nx, ny, nz);
|
|
264
|
+
quat3_multiply(scratch_q, 0, scratch_arc[0], scratch_arc[1], scratch_arc[2], scratch_arc[3], rx, ry, rz, rw);
|
|
265
|
+
} else {
|
|
266
|
+
px = reference_world[TRANSFORM64_TRANSLATION_OFFSET];
|
|
267
|
+
py = reference_world[TRANSFORM64_TRANSLATION_OFFSET + 1];
|
|
268
|
+
pz = reference_world[TRANSFORM64_TRANSLATION_OFFSET + 2];
|
|
269
|
+
|
|
270
|
+
scratch_q[0] = rx;
|
|
271
|
+
scratch_q[1] = ry;
|
|
272
|
+
scratch_q[2] = rz;
|
|
273
|
+
scratch_q[3] = rw;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
this.#place(record, px, py, pz, dataset);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Write the entity's offset so its world pose is `p` turned by `scratch_q`.
|
|
281
|
+
*
|
|
282
|
+
* @param {ProbeRecord} record
|
|
283
|
+
* @param {number} px
|
|
284
|
+
* @param {number} py
|
|
285
|
+
* @param {number} pz
|
|
286
|
+
* @param {EntityComponentDataset} dataset
|
|
287
|
+
*/
|
|
288
|
+
#place(record, px, py, pz, dataset) {
|
|
289
|
+
const parent = record.attachment.parent;
|
|
290
|
+
|
|
291
|
+
this.#world_of(parent_world, parent);
|
|
292
|
+
|
|
293
|
+
// conj(R_p)
|
|
294
|
+
const cx = -parent_world[TRANSFORM64_ROTATION_OFFSET];
|
|
295
|
+
const cy = -parent_world[TRANSFORM64_ROTATION_OFFSET + 1];
|
|
296
|
+
const cz = -parent_world[TRANSFORM64_ROTATION_OFFSET + 2];
|
|
297
|
+
const cw = parent_world[TRANSFORM64_ROTATION_OFFSET + 3];
|
|
298
|
+
|
|
299
|
+
// uniform scale, as TransformAttachment composes
|
|
300
|
+
const inverse_scale = 1 / parent_world[TRANSFORM64_SCALE_OFFSET];
|
|
301
|
+
|
|
302
|
+
v3_quaternion_apply(
|
|
303
|
+
scratch_v, 0,
|
|
304
|
+
(px - parent_world[TRANSFORM64_TRANSLATION_OFFSET]) * inverse_scale,
|
|
305
|
+
(py - parent_world[TRANSFORM64_TRANSLATION_OFFSET + 1]) * inverse_scale,
|
|
306
|
+
(pz - parent_world[TRANSFORM64_TRANSLATION_OFFSET + 2]) * inverse_scale,
|
|
307
|
+
cx, cy, cz, cw
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
quat3_multiply(scratch_arc, 0, cx, cy, cz, cw, scratch_q[0], scratch_q[1], scratch_q[2], scratch_q[3]);
|
|
311
|
+
|
|
312
|
+
const local = record.attachment.transform;
|
|
313
|
+
|
|
314
|
+
local.setTranslation(scratch_v[0], scratch_v[1], scratch_v[2]);
|
|
315
|
+
local.setRotation(scratch_arc[0], scratch_arc[1], scratch_arc[2], scratch_arc[3]);
|
|
316
|
+
local.updateMatrix();
|
|
317
|
+
|
|
318
|
+
dataset.sendEvent(record.entity, TRANSFORM_ATTACHMENT_EVENT_CHANGE);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* The entity's world pose this tick, exactly, under its own model's clips.
|
|
323
|
+
*
|
|
324
|
+
* @param {Transform64} result
|
|
325
|
+
* @param {number} entity
|
|
326
|
+
*/
|
|
327
|
+
#world_of(result, entity) {
|
|
328
|
+
const dataset = this.entityManager.dataset;
|
|
329
|
+
|
|
330
|
+
const model = model_of(dataset, entity);
|
|
331
|
+
|
|
332
|
+
let cache = this.#caches.get(model);
|
|
333
|
+
|
|
334
|
+
if (cache === undefined) {
|
|
335
|
+
cache = new T64WorldCache();
|
|
336
|
+
this.#caches.set(model, cache);
|
|
337
|
+
this.#cache_list.push(cache);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
let playbacks = this.#playbacks.get(model);
|
|
341
|
+
|
|
342
|
+
if (playbacks === undefined) {
|
|
343
|
+
playbacks = [];
|
|
344
|
+
this.#playbacks.set(model, playbacks);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (!this.#collected.has(model)) {
|
|
348
|
+
this.#collected.add(model);
|
|
349
|
+
|
|
350
|
+
playbacks.length = 0;
|
|
351
|
+
|
|
352
|
+
collect_entity_playbacks(playbacks, this.entityManager, model);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
cache.evaluate(result, dataset, entity, playbacks);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* The entity whose clips drive `entity`: the model its lifetime belongs to, or itself.
|
|
361
|
+
*
|
|
362
|
+
* @param {EntityComponentDataset} dataset
|
|
363
|
+
* @param {number} entity
|
|
364
|
+
* @returns {number}
|
|
365
|
+
*/
|
|
366
|
+
function model_of(dataset, entity) {
|
|
367
|
+
const owner = dataset.getComponent(entity, ParentEntity);
|
|
368
|
+
|
|
369
|
+
if (owner === undefined || owner === null) {
|
|
370
|
+
return entity;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return owner.entity;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* The top of the lifetime chain an entity belongs to.
|
|
378
|
+
*
|
|
379
|
+
* @param {EntityComponentDataset} dataset
|
|
380
|
+
* @param {number} entity
|
|
381
|
+
* @returns {number}
|
|
382
|
+
*/
|
|
383
|
+
function root_of(dataset, entity) {
|
|
384
|
+
let e = entity;
|
|
385
|
+
|
|
386
|
+
for (let guard = 0; guard < 1024; guard++) {
|
|
387
|
+
const owner = dataset.getComponent(e, ParentEntity);
|
|
388
|
+
|
|
389
|
+
if (owner === undefined || owner === null || owner.entity < 0) {
|
|
390
|
+
return e;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
e = owner.entity;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return e;
|
|
397
|
+
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* origin} becomes system-managed in this case.
|
|
21
21
|
*
|
|
22
22
|
* NOTE on layout: sibling physics ECS code lives under `engine/ecs/*` (see
|
|
23
|
-
* `engine/ecs/ik/
|
|
23
|
+
* `engine/ecs/ik/IKGoalSystem.js`). This component is placed inside the
|
|
24
24
|
* fluid package because edits to the ECS folder were out-of-scope when it was first
|
|
25
25
|
* written. Moving it under `engine/ecs/fluid/` later is a pure relocation.
|
|
26
26
|
*/
|
|
@@ -24,7 +24,7 @@ import { FluidField } from "../FluidField.js";
|
|
|
24
24
|
* origin} becomes system-managed in this case.
|
|
25
25
|
*
|
|
26
26
|
* NOTE on layout: sibling physics ECS code lives under `engine/ecs/*` (see
|
|
27
|
-
* `engine/ecs/ik/
|
|
27
|
+
* `engine/ecs/ik/IKGoalSystem.js`). This component is placed inside the
|
|
28
28
|
* fluid package because edits to the ECS folder were out-of-scope when it was first
|
|
29
29
|
* written. Moving it under `engine/ecs/fluid/` later is a pure relocation.
|
|
30
30
|
*/
|
|
@@ -66,11 +66,11 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
66
66
|
/**
|
|
67
67
|
* @param {FluidComponent} fluid
|
|
68
68
|
*/
|
|
69
|
-
static "__#
|
|
69
|
+
static "__#426@#refresh_masks"(fluid: FluidComponent): void;
|
|
70
70
|
/**
|
|
71
71
|
* @param {FluidComponent} fluid
|
|
72
72
|
*/
|
|
73
|
-
static "__#
|
|
73
|
+
static "__#426@#clear_field"(fluid: FluidComponent): void;
|
|
74
74
|
/**
|
|
75
75
|
* Mark every cell of `fluid` whose centre lies within `inflation` of the
|
|
76
76
|
* posed shape as solid. Iteration is clipped to the shape's world AABB
|
|
@@ -82,7 +82,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
82
82
|
* @param {number} inflation world-units SDF threshold
|
|
83
83
|
* @param {Float64Array} point length-3 scratch
|
|
84
84
|
*/
|
|
85
|
-
static "__#
|
|
85
|
+
static "__#426@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
|
|
86
86
|
/**
|
|
87
87
|
* Write the obstacle's translation velocity onto every face of every cell
|
|
88
88
|
* it voxelized — the moving-wall boundary condition. Runs AFTER the mask
|
|
@@ -102,7 +102,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
102
102
|
* @param {number} wvy
|
|
103
103
|
* @param {number} wvz
|
|
104
104
|
*/
|
|
105
|
-
static "__#
|
|
105
|
+
static "__#426@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
|
|
106
106
|
constructor();
|
|
107
107
|
dependencies: (typeof FluidObstacle)[];
|
|
108
108
|
components_used: (ResourceAccessSpecification<typeof Transform64> | ResourceAccessSpecification<typeof RigidBody> | ResourceAccessSpecification<typeof Collider> | ResourceAccessSpecification<typeof FluidComponent> | ResourceAccessSpecification<typeof FluidObstacle>)[];
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One tree for {@link frame_fabrik_solve} to pose: its joints, as the animation left them, the goals
|
|
3
|
+
* pulling on them, and, once solved, where they went.
|
|
4
|
+
*
|
|
5
|
+
* Every array is sized once, at construction, for the most joints and goals the problem will ever
|
|
6
|
+
* hold; a solve allocates nothing. Joints are indices into the problem, not entities: the problem
|
|
7
|
+
* knows nothing about where its tree came from.
|
|
8
|
+
*
|
|
9
|
+
* The caller fills the inputs and {@link joint_count} / {@link goal_count}; the fields under "solver
|
|
10
|
+
* state" belong to the solver, which overwrites them on every solve.
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export class FrameFabrikProblem {
|
|
16
|
+
/**
|
|
17
|
+
* @param {number} joint_capacity the most joints a solve will be given
|
|
18
|
+
* @param {number} goal_capacity the most goals a solve will be given
|
|
19
|
+
*/
|
|
20
|
+
constructor(joint_capacity: number, goal_capacity: number);
|
|
21
|
+
/**
|
|
22
|
+
* @readonly
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
25
|
+
readonly joint_capacity: number;
|
|
26
|
+
/**
|
|
27
|
+
* @readonly
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
readonly goal_capacity: number;
|
|
31
|
+
/**
|
|
32
|
+
* How many joints this solve poses.
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
35
|
+
joint_count: number;
|
|
36
|
+
/**
|
|
37
|
+
* How many goals pull on them.
|
|
38
|
+
* @type {number}
|
|
39
|
+
*/
|
|
40
|
+
goal_count: number;
|
|
41
|
+
/**
|
|
42
|
+
* Each joint's parent, as an index into this problem, or -1 for a joint whose parent the solve
|
|
43
|
+
* does not pose: its parent's frame is fixed, as animated. Every parent comes before its
|
|
44
|
+
* children, `joint_parent[i] < i`.
|
|
45
|
+
* @type {Int32Array}
|
|
46
|
+
*/
|
|
47
|
+
joint_parent: Int32Array;
|
|
48
|
+
/**
|
|
49
|
+
* Where each joint is as animated, in world. Packed `[x, y, z]` per joint.
|
|
50
|
+
* @type {Float64Array}
|
|
51
|
+
*/
|
|
52
|
+
base_position: Float64Array;
|
|
53
|
+
/**
|
|
54
|
+
* How each joint is turned as animated, in world, a unit quaternion. Packed `[x, y, z, w]` per
|
|
55
|
+
* joint.
|
|
56
|
+
* @type {Float64Array}
|
|
57
|
+
*/
|
|
58
|
+
base_rotation: Float64Array;
|
|
59
|
+
/**
|
|
60
|
+
* How each joint is turned relative to its parent as animated, a unit quaternion: the parent's
|
|
61
|
+
* {@link base_rotation} composed with it is the joint's. For a joint whose parent is not posed,
|
|
62
|
+
* relative to that parent, whose frame it gives the solve. Packed `[x, y, z, w]` per joint.
|
|
63
|
+
* @type {Float64Array}
|
|
64
|
+
*/
|
|
65
|
+
base_local_rotation: Float64Array;
|
|
66
|
+
/**
|
|
67
|
+
* 1 for a joint whose turn relative to its parent is limited, by {@link limit_basis_a},
|
|
68
|
+
* {@link limit_basis_b}, {@link limit_lower} and {@link limit_upper}; 0 for one that turns
|
|
69
|
+
* freely.
|
|
70
|
+
* @type {Uint8Array}
|
|
71
|
+
*/
|
|
72
|
+
joint_limited: Uint8Array;
|
|
73
|
+
/**
|
|
74
|
+
* The limit's frame in the parent's, a unit quaternion: a physics `Joint`'s `localBasisA`.
|
|
75
|
+
* Packed `[x, y, z, w]` per joint.
|
|
76
|
+
* @type {Float64Array}
|
|
77
|
+
*/
|
|
78
|
+
limit_basis_a: Float64Array;
|
|
79
|
+
/**
|
|
80
|
+
* The limit's frame in the joint's own, a unit quaternion: a physics `Joint`'s `localBasisB`.
|
|
81
|
+
* Packed `[x, y, z, w]` per joint.
|
|
82
|
+
* @type {Float64Array}
|
|
83
|
+
*/
|
|
84
|
+
limit_basis_b: Float64Array;
|
|
85
|
+
/**
|
|
86
|
+
* Lower bounds of the turn of frame B relative to frame A, as `swing_twist_error_array`
|
|
87
|
+
* measures it: `[twist about X, swing Y, swing Z]` per joint, radians. `-Infinity` for an
|
|
88
|
+
* axis that turns freely, 0 for a locked one.
|
|
89
|
+
* @type {Float64Array}
|
|
90
|
+
*/
|
|
91
|
+
limit_lower: Float64Array;
|
|
92
|
+
/**
|
|
93
|
+
* Upper bounds, as {@link limit_lower}.
|
|
94
|
+
* @type {Float64Array}
|
|
95
|
+
*/
|
|
96
|
+
limit_upper: Float64Array;
|
|
97
|
+
/**
|
|
98
|
+
* The joint each goal pulls on.
|
|
99
|
+
* @type {Int32Array}
|
|
100
|
+
*/
|
|
101
|
+
goal_effector: Int32Array;
|
|
102
|
+
/**
|
|
103
|
+
* The highest joint each goal turns: its effector or an ancestor of it. The goal's path runs
|
|
104
|
+
* from the effector up to here. This joint turns and never moves.
|
|
105
|
+
* @type {Int32Array}
|
|
106
|
+
*/
|
|
107
|
+
goal_root: Int32Array;
|
|
108
|
+
/**
|
|
109
|
+
* How hard each goal pulls, 0..1. 0 gives the pose the solve gives without the goal, and the
|
|
110
|
+
* pose is continuous in it.
|
|
111
|
+
* @type {Float64Array}
|
|
112
|
+
*/
|
|
113
|
+
goal_weight: Float64Array;
|
|
114
|
+
/**
|
|
115
|
+
* The joint each goal's target hangs below, or -1 for a target the solve does not move. A
|
|
116
|
+
* target hanging below a joint is carried by that joint's frame as the solve turns it, read
|
|
117
|
+
* afresh on every iteration.
|
|
118
|
+
* @type {Int32Array}
|
|
119
|
+
*/
|
|
120
|
+
goal_target_joint: Int32Array;
|
|
121
|
+
/**
|
|
122
|
+
* Where each goal wants its effector, in world, as animated: the frame of
|
|
123
|
+
* {@link goal_target_joint} carries it from there. Packed `[x, y, z]` per goal.
|
|
124
|
+
* @type {Float64Array}
|
|
125
|
+
*/
|
|
126
|
+
goal_target: Float64Array;
|
|
127
|
+
/**
|
|
128
|
+
* The solved pose: where each joint went, in world. Packed `[x, y, z]` per joint.
|
|
129
|
+
* @type {Float64Array}
|
|
130
|
+
*/
|
|
131
|
+
solved_position: Float64Array;
|
|
132
|
+
/**
|
|
133
|
+
* The solved pose: how each joint is turned, in world. Packed `[x, y, z, w]` per joint.
|
|
134
|
+
* @type {Float64Array}
|
|
135
|
+
*/
|
|
136
|
+
solved_rotation: Float64Array;
|
|
137
|
+
/**
|
|
138
|
+
* Each joint's place in its parent's frame, as animated: the rigid offset the solve keeps.
|
|
139
|
+
* @type {Float64Array}
|
|
140
|
+
*/
|
|
141
|
+
_offset: Float64Array;
|
|
142
|
+
/**
|
|
143
|
+
* The weight of the link from each joint's parent to it: the heaviest goal whose path holds
|
|
144
|
+
* both ends. 0 for a link no path holds.
|
|
145
|
+
* @type {Float64Array}
|
|
146
|
+
*/
|
|
147
|
+
_link_weight: Float64Array;
|
|
148
|
+
/**
|
|
149
|
+
* Children of joint `i` are `_child[_child_start[i] .. _child_start[i + 1]]`.
|
|
150
|
+
* @type {Int32Array}
|
|
151
|
+
*/
|
|
152
|
+
_child_start: Int32Array;
|
|
153
|
+
/**
|
|
154
|
+
* @type {Int32Array}
|
|
155
|
+
*/
|
|
156
|
+
_child: Int32Array;
|
|
157
|
+
/**
|
|
158
|
+
* How many goals of non-zero weight have the joint on their path.
|
|
159
|
+
* @type {Int32Array}
|
|
160
|
+
*/
|
|
161
|
+
_path_count: Int32Array;
|
|
162
|
+
/**
|
|
163
|
+
* 1 for a joint some goal's path holds below that goal's root.
|
|
164
|
+
* @type {Uint8Array}
|
|
165
|
+
*/
|
|
166
|
+
_interior: Uint8Array;
|
|
167
|
+
/**
|
|
168
|
+
* 1 for a joint that turns and never moves: a goal's root no path holds below its own root.
|
|
169
|
+
* @type {Uint8Array}
|
|
170
|
+
*/
|
|
171
|
+
_root_only: Uint8Array;
|
|
172
|
+
/**
|
|
173
|
+
* The goal whose effector the joint is, or -1.
|
|
174
|
+
* @type {Int32Array}
|
|
175
|
+
*/
|
|
176
|
+
_effector_goal: Int32Array;
|
|
177
|
+
/**
|
|
178
|
+
* The joint whose frame carries each goal's effector when the goal does not pull: the deepest
|
|
179
|
+
* joint of its path another goal's path holds too, else its root's parent (-1 when that is
|
|
180
|
+
* not posed).
|
|
181
|
+
* @type {Int32Array}
|
|
182
|
+
*/
|
|
183
|
+
_goal_anchor: Int32Array;
|
|
184
|
+
/**
|
|
185
|
+
* The effector in its anchor's frame, as animated. Packed `[x, y, z]` per goal.
|
|
186
|
+
* @type {Float64Array}
|
|
187
|
+
*/
|
|
188
|
+
_goal_anchor_offset: Float64Array;
|
|
189
|
+
/**
|
|
190
|
+
* Each target in its target joint's frame, as animated. Packed `[x, y, z]` per goal.
|
|
191
|
+
* @type {Float64Array}
|
|
192
|
+
*/
|
|
193
|
+
_goal_target_local: Float64Array;
|
|
194
|
+
/**
|
|
195
|
+
* This iteration's target for each effector. Packed `[x, y, z]` per goal.
|
|
196
|
+
* @type {Float64Array}
|
|
197
|
+
*/
|
|
198
|
+
_target: Float64Array;
|
|
199
|
+
/**
|
|
200
|
+
* Where each joint was before this iteration, to measure how far the iteration moved it.
|
|
201
|
+
* @type {Float64Array}
|
|
202
|
+
*/
|
|
203
|
+
_previous: Float64Array;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=FrameFabrikProblem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameFabrikProblem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH;IAEI;;;OAGG;IACH,4BAHW,MAAM,iBACN,MAAM,EA+NhB;IAzNG;;;OAGG;IACH,yBAFU,MAAM,CAEoB;IAEpC;;;OAGG;IACH,wBAFU,MAAM,CAEkB;IAElC;;;OAGG;IACH,aAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,YAFU,MAAM,CAEG;IAEnB;;;;;OAKG;IACH,cAFU,UAAU,CAE8B;IAElD;;;OAGG;IACH,eAFU,YAAY,CAEmC;IAEzD;;;;OAIG;IACH,eAFU,YAAY,CAEmC;IAEzD;;;;;OAKG;IACH,qBAFU,YAAY,CAEyC;IAE/D;;;;;OAKG;IACH,eAFU,UAAU,CAE+B;IAEnD;;;;OAIG;IACH,eAFU,YAAY,CAEmC;IAEzD;;;;OAIG;IACH,eAFU,YAAY,CAEmC;IAEzD;;;;;OAKG;IACH,aAFU,YAAY,CAEiC;IAEvD;;;OAGG;IACH,aAFU,YAAY,CAEiC;IAEvD;;;OAGG;IACH,eAFU,UAAU,CAE8B;IAElD;;;;OAIG;IACH,WAFU,UAAU,CAE0B;IAE9C;;;;OAIG;IACH,aAFU,YAAY,CAE4B;IAElD;;;;;OAKG;IACH,mBAFU,UAAU,CAEkC;IAEtD;;;;OAIG;IACH,aAFU,YAAY,CAEgC;IAEtD;;;OAGG;IACH,iBAFU,YAAY,CAEqC;IAE3D;;;OAGG;IACH,iBAFU,YAAY,CAEqC;IAI3D;;;OAGG;IACH,SAFU,YAAY,CAE6B;IAEnD;;;;OAIG;IACH,cAFU,YAAY,CAE8B;IAEpD;;;OAGG;IACH,cAFU,UAAU,CAEkC;IAEtD;;OAEG;IACH,QAFU,UAAU,CAEwB;IAE5C;;;OAGG;IACH,aAFU,UAAU,CAE6B;IAEjD;;;OAGG;IACH,WAFU,UAAU,CAE2B;IAE/C;;;OAGG;IACH,YAFU,UAAU,CAE4B;IAEhD;;;OAGG;IACH,gBAFU,UAAU,CAEgC;IAEpD;;;;;OAKG;IACH,cAFU,UAAU,CAE6B;IAEjD;;;OAGG;IACH,qBAFU,YAAY,CAEwC;IAE9D;;;OAGG;IACH,oBAFU,YAAY,CAEuC;IAE7D;;;OAGG;IACH,SAFU,YAAY,CAE4B;IAElD;;;OAGG;IACH,WAFU,YAAY,CAE+B;CAE5D"}
|