@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,124 @@
|
|
|
1
|
+
import { array_quick_sort_by_lookup_uint } from "../../../../../../core/collection/array/array_quick_sort_by_lookup_uint.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Words per anchor in the array {@link neighbourhood_anchor_index} returns.
|
|
5
|
+
* @type {number}
|
|
6
|
+
*/
|
|
7
|
+
export const ANCHOR_STRIDE = 4;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Pair up triangles whose {@link face_neighbourhood_hash} values are equal, within a geometry or across
|
|
11
|
+
* two: each pair is a place where a copy may sit, for growth to confirm or throw out.
|
|
12
|
+
*
|
|
13
|
+
* Within one hash, every triangle is paired with the first, in input order (geometry, then triangle) -
|
|
14
|
+
* not every triangle with every other. A copy that matches the first is found from it, and one that
|
|
15
|
+
* does not still gets the first's canonical piece by another anchor; pairing them all only repeats
|
|
16
|
+
* growth that the first pair already did. On Sponza through scene_optimize's meshlet round trip,
|
|
17
|
+
* pairing them all grew 172k times against 41k, and shared fewer triangles: 144.5k against 145.8k.
|
|
18
|
+
*
|
|
19
|
+
* A hash shared by more than `seed_budget` triangles keeps the first `seed_budget` of them, so a
|
|
20
|
+
* featureless region repeated thousands of times does not swamp what follows.
|
|
21
|
+
*
|
|
22
|
+
* @param {Uint32Array[]} hash_streams one per geometry, one hash per triangle
|
|
23
|
+
* @param {number} seed_budget most triangles kept per hash, >= 2
|
|
24
|
+
* @returns {Uint32Array} {@link ANCHOR_STRIDE} words per anchor: a geometry, a triangle of it, b geometry,
|
|
25
|
+
* a triangle of it. The `a` side is the earlier of the two in input order.
|
|
26
|
+
*/
|
|
27
|
+
export function neighbourhood_anchor_index(hash_streams, seed_budget) {
|
|
28
|
+
let total = 0;
|
|
29
|
+
|
|
30
|
+
for (const stream of hash_streams) {
|
|
31
|
+
total += stream.length;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// every triangle of every geometry, numbered in input order
|
|
35
|
+
const hash = new Uint32Array(total);
|
|
36
|
+
const geometry_of = new Uint32Array(total);
|
|
37
|
+
const offset_of = new Uint32Array(hash_streams.length);
|
|
38
|
+
|
|
39
|
+
let cursor = 0;
|
|
40
|
+
|
|
41
|
+
for (let g = 0; g < hash_streams.length; g++) {
|
|
42
|
+
const stream = hash_streams[g];
|
|
43
|
+
|
|
44
|
+
offset_of[g] = cursor;
|
|
45
|
+
hash.set(stream, cursor);
|
|
46
|
+
geometry_of.fill(g, cursor, cursor + stream.length);
|
|
47
|
+
|
|
48
|
+
cursor += stream.length;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const order = new Uint32Array(total);
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i < total; i++) {
|
|
54
|
+
order[i] = i;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
array_quick_sort_by_lookup_uint(order, hash, 0, total - 1);
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
Each shared hash's triangles, filed under the first of them in input order: where its run starts in
|
|
61
|
+
`order`, and how many of the run are kept. -1 for a triangle that is first of no run.
|
|
62
|
+
*/
|
|
63
|
+
const run_of_first = new Int32Array(total).fill(-1);
|
|
64
|
+
const kept_of_first = new Uint32Array(total);
|
|
65
|
+
|
|
66
|
+
let anchor_count = 0;
|
|
67
|
+
|
|
68
|
+
for (let run_start = 0; run_start < total;) {
|
|
69
|
+
let run_end = run_start + 1;
|
|
70
|
+
|
|
71
|
+
while (run_end < total && hash[order[run_end]] === hash[order[run_start]]) {
|
|
72
|
+
run_end++;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (run_end - run_start > 1) {
|
|
76
|
+
// the sort leaves equal hashes in no particular order; input order decides who is first and who is kept
|
|
77
|
+
order.subarray(run_start, run_end).sort();
|
|
78
|
+
|
|
79
|
+
const kept = Math.min(run_end - run_start, seed_budget);
|
|
80
|
+
|
|
81
|
+
run_of_first[order[run_start]] = run_start;
|
|
82
|
+
kept_of_first[order[run_start]] = kept;
|
|
83
|
+
|
|
84
|
+
anchor_count += kept - 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
run_start = run_end;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
Emitted in input order of each run's first triangle, so growth meets the anchors geometry by geometry,
|
|
92
|
+
triangle by triangle. Growth claims the triangles it covers and later anchors inside them are skipped,
|
|
93
|
+
so the order decides which matches are grown: in the order the sort left the hashes, Sponza through
|
|
94
|
+
scene_optimize's meshlet round trip shared 125.7k triangles, against 145.8k in this one.
|
|
95
|
+
*/
|
|
96
|
+
const anchors = new Uint32Array(anchor_count * ANCHOR_STRIDE);
|
|
97
|
+
|
|
98
|
+
let written = 0;
|
|
99
|
+
|
|
100
|
+
for (let first = 0; first < total; first++) {
|
|
101
|
+
const run_start = run_of_first[first];
|
|
102
|
+
|
|
103
|
+
if (run_start === -1) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const first_geometry = geometry_of[first];
|
|
108
|
+
const first_triangle = first - offset_of[first_geometry];
|
|
109
|
+
|
|
110
|
+
const kept = kept_of_first[first];
|
|
111
|
+
|
|
112
|
+
for (let i = 1; i < kept; i++) {
|
|
113
|
+
const other = order[run_start + i];
|
|
114
|
+
const other_geometry = geometry_of[other];
|
|
115
|
+
|
|
116
|
+
anchors[written++] = first_geometry;
|
|
117
|
+
anchors[written++] = first_triangle;
|
|
118
|
+
anchors[written++] = other_geometry;
|
|
119
|
+
anchors[written++] = other - offset_of[other_geometry];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return anchors;
|
|
124
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lay triangle `face_b` of B on triangle `face_a` of A corner to corner, keeping the winding: corner `k`
|
|
3
|
+
* of A on corner `(k + offset) % 3` of B. Writes the three pairs into `out` (vertex of A → vertex of B)
|
|
4
|
+
* when every pair carries equal attributes.
|
|
5
|
+
*
|
|
6
|
+
* A triangle lies on another in three ways that keep the winding. Attributes usually rule out two; where
|
|
7
|
+
* they leave more than one, the caller grows from each in turn and lets positions decide.
|
|
8
|
+
*
|
|
9
|
+
* @param {Map<number, number>} out cleared first; left empty when the offset does not fit
|
|
10
|
+
* @param {import("./vertex_attributes_equal.js").VertexAttributePairs} attributes
|
|
11
|
+
* @param {BinaryTopology} topology_a
|
|
12
|
+
* @param {BinaryTopology} topology_b
|
|
13
|
+
* @param {number} face_a
|
|
14
|
+
* @param {number} face_b
|
|
15
|
+
* @param {number} offset 0, 1 or 2
|
|
16
|
+
* @returns {boolean} whether `out` holds a correspondence
|
|
17
|
+
*/
|
|
18
|
+
export function seed_correspondence_from_face_pair(out: Map<number, number>, attributes: import("./vertex_attributes_equal.js").VertexAttributePairs, topology_a: BinaryTopology, topology_b: BinaryTopology, face_a: number, face_b: number, offset: number): boolean;
|
|
19
|
+
//# sourceMappingURL=seed_correspondence_from_face_pair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed_correspondence_from_face_pair.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;GAgBG;AACH,wDATW,IAAI,MAAM,EAAE,MAAM,CAAC,cACnB,OAAO,8BAA8B,EAAE,oBAAoB,kEAG3D,MAAM,UACN,MAAM,UACN,MAAM,GACJ,OAAO,CA0BnB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { bt_face_read_triangle_vertices } from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_face_read_triangle.js";
|
|
2
|
+
import { vertex_attributes_match } from "./vertex_attributes_equal.js";
|
|
3
|
+
|
|
4
|
+
const a_corners = [0, 0, 0];
|
|
5
|
+
const b_corners = [0, 0, 0];
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lay triangle `face_b` of B on triangle `face_a` of A corner to corner, keeping the winding: corner `k`
|
|
9
|
+
* of A on corner `(k + offset) % 3` of B. Writes the three pairs into `out` (vertex of A → vertex of B)
|
|
10
|
+
* when every pair carries equal attributes.
|
|
11
|
+
*
|
|
12
|
+
* A triangle lies on another in three ways that keep the winding. Attributes usually rule out two; where
|
|
13
|
+
* they leave more than one, the caller grows from each in turn and lets positions decide.
|
|
14
|
+
*
|
|
15
|
+
* @param {Map<number, number>} out cleared first; left empty when the offset does not fit
|
|
16
|
+
* @param {import("./vertex_attributes_equal.js").VertexAttributePairs} attributes
|
|
17
|
+
* @param {BinaryTopology} topology_a
|
|
18
|
+
* @param {BinaryTopology} topology_b
|
|
19
|
+
* @param {number} face_a
|
|
20
|
+
* @param {number} face_b
|
|
21
|
+
* @param {number} offset 0, 1 or 2
|
|
22
|
+
* @returns {boolean} whether `out` holds a correspondence
|
|
23
|
+
*/
|
|
24
|
+
export function seed_correspondence_from_face_pair(
|
|
25
|
+
out,
|
|
26
|
+
attributes,
|
|
27
|
+
topology_a, topology_b,
|
|
28
|
+
face_a, face_b,
|
|
29
|
+
offset
|
|
30
|
+
) {
|
|
31
|
+
out.clear();
|
|
32
|
+
|
|
33
|
+
if (!bt_face_read_triangle_vertices(a_corners, topology_a, face_a)) return false;
|
|
34
|
+
if (!bt_face_read_triangle_vertices(b_corners, topology_b, face_b)) return false;
|
|
35
|
+
|
|
36
|
+
for (let k = 0; k < 3; k++) {
|
|
37
|
+
if (!vertex_attributes_match(attributes, a_corners[k], b_corners[(k + offset) % 3])) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (let k = 0; k < 3; k++) {
|
|
43
|
+
out.set(a_corners[k], b_corners[(k + offset) % 3]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// a triangle with a repeated vertex has fewer than three to fit a transform to
|
|
47
|
+
return out.size === 3;
|
|
48
|
+
}
|
|
@@ -42,7 +42,8 @@ export function entity_of_row(row: number): number;
|
|
|
42
42
|
* **Change flow is mark, then flush.** The systems that place entities listen to the dataset's
|
|
43
43
|
* change events and {@link mark_local} or {@link mark_world}; nothing is read at mark time. The
|
|
44
44
|
* flush, in `GPUSceneContext.build`, reads each marked entity's components once, consults
|
|
45
|
-
* `GPUStateAuthority` then, writes the ranges the CPU owns
|
|
45
|
+
* `GPUStateAuthority` then, writes the ranges the CPU owns — and an offset the GPU has just taken,
|
|
46
|
+
* once ({@link mark_handover}) — and clears the list. A world mark on
|
|
46
47
|
* an attached entity whose parent has a row writes nothing: its local offset and its parent are
|
|
47
48
|
* unchanged, and the GPU composes the rest. That is what stops a root's move from costing a row
|
|
48
49
|
* per descendant.
|
|
@@ -155,6 +156,21 @@ export class GPUSceneRows {
|
|
|
155
156
|
* @param {number} entity
|
|
156
157
|
*/
|
|
157
158
|
mark_local(entity: number): void;
|
|
159
|
+
/**
|
|
160
|
+
* The entity's offset passes to the GPU as it stands: a clip binds it for the first time, or a
|
|
161
|
+
* CPU writer that held it has let go and a clip still bound has it back. The next flush writes
|
|
162
|
+
* the offset into the row once more, though `GPUStateAuthority` already says the GPU writes it.
|
|
163
|
+
*
|
|
164
|
+
* The bit is granted at that moment, and the flush runs later, in the frame's build, and reads
|
|
165
|
+
* the bit then. So whatever was written since the last flush — an offset announced in the frame
|
|
166
|
+
* the clip binds; a holder's last step, or an offset it captured and put back — would never
|
|
167
|
+
* reach the row: the axes no bound clip keys would keep the previous pose on the GPU, while the
|
|
168
|
+
* CPU twin reads the offset. The axes a clip keys are rewritten by the resolve, which runs after
|
|
169
|
+
* the flush.
|
|
170
|
+
*
|
|
171
|
+
* @param {number} entity
|
|
172
|
+
*/
|
|
173
|
+
mark_handover(entity: number): void;
|
|
158
174
|
/**
|
|
159
175
|
* The entity's world transform changed. For an entity the GPU composes under a parent row this
|
|
160
176
|
* is nothing to write; for one carrying its world pose it is the row's contents.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUSceneRows.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/rows/GPUSceneRows.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,sCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;GAMG;AACH,mCAHW,MAAM,GACJ,MAAM,CAIlB;
|
|
1
|
+
{"version":3,"file":"GPUSceneRows.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/rows/GPUSceneRows.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,sCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;GAMG;AACH,mCAHW,MAAM,GACJ,MAAM,CAIlB;AA0ID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IA2II;;;;;;;;;OASG;IACH;QAR2C,OAAO,EAAvC,sBAAsB;QACC,UAAU;QACV,MAAM;QACD,UAAU,EAAtC,kBAAkB;QACU,SAAS,EAArC,kBAAkB;QACyB,IAAI,EAA/C,iCAAiC;QACW,QAAQ,QAAxC,sBAAsB;OAmB5C;IAED;;OAEG;IACH,iGAEC;IAED;;;;;OAKG;IACH,gCAEC;IAED;;;;;OAKG;IACH,YAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;;OAQG;IACH,oBAA8B;IAE9B;;;;;OAKG;IACH,iBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;OAOG;IACH,8BAHoB,MAAM,QAAE,eAAe,QAAE,aAAa,QAAE,OAAO,KAAG,IAAI,QASzE;IAED;;;;;;;;;OASG;IACH,6BAHW,KAAK,GACH,OAAO,CAyBnB;IAED;;;;;;;;;;OAUG;IACH,gBAFW,MAAM,QAuChB;IAED;;;;;;;;OAQG;IACH,gBAFW,MAAM,QA0BhB;IAED;;;;OAIG;IACH,mBAFW,MAAM,QAIhB;IAED;;;;;;;;;;;;;OAaG;IACH,sBAFW,MAAM,QAIhB;IAED;;;;;OAKG;IACH,mBAFW,MAAM,QAIhB;IAED;;;;;OAKG;IACH,2EAOC;IAED;;;;OAIG;IACH,gCAEC;IAqCD;;;;;;;;;;;;;;OAcG;IACH,oBALW,MAAM,YACN,eAAe,YACf,aAAa,YACb,OAAO,QAgDjB;IAED;;;;;OAKG;IACH,oBAFW,MAAM,QAUhB;IAwCD;;;;OAIG;IACH,SAFa,MAAM,CAsDlB;IA0MD;;;;OAIG;IACH;;;;;;;;OAQG;IACH,4BAHW,MAAM,kBACG,MAAM,KAAG,IAAI,QAiBhC;IAyGD;;;;;OAKG;IACH,gBAUC;;CACJ;qCAppCY,OAAO,kDAAkD,EAAE,sBAAsB;;iCAEjF,OAAO,sCAAsC,EAAE,kBAAkB;iCACjE,OAAO,sCAAsC,EAAE,kBAAkB;gDACjE,OAAO,yCAAyC,EAAE,iCAAiC;qCACnF,OAAO,oDAAoD,EAAE,sBAAsB;8BACnF,OAAO,mCAAmC,EAAE,eAAe;4BAC3D,OAAO,iCAAiC,EAAE,aAAa;oBACvD,OAAO,wCAAwC,EAAE,KAAK"}
|
|
@@ -57,6 +57,12 @@ const MARK_LOCAL = 1;
|
|
|
57
57
|
const MARK_WORLD = 2;
|
|
58
58
|
const MARK_MESH = 4;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The offset goes to the row although the GPU writes it now — see {@link GPUSceneRows#mark_handover}.
|
|
62
|
+
* Always carried with {@link MARK_LOCAL}.
|
|
63
|
+
*/
|
|
64
|
+
const MARK_HANDOVER = 8;
|
|
65
|
+
|
|
60
66
|
/**
|
|
61
67
|
* Staging for one `transforms` row, reused across every write. `global` and `prev_global` are read
|
|
62
68
|
* only on a row's first write.
|
|
@@ -193,7 +199,8 @@ class MeshEntry {
|
|
|
193
199
|
* **Change flow is mark, then flush.** The systems that place entities listen to the dataset's
|
|
194
200
|
* change events and {@link mark_local} or {@link mark_world}; nothing is read at mark time. The
|
|
195
201
|
* flush, in `GPUSceneContext.build`, reads each marked entity's components once, consults
|
|
196
|
-
* `GPUStateAuthority` then, writes the ranges the CPU owns
|
|
202
|
+
* `GPUStateAuthority` then, writes the ranges the CPU owns — and an offset the GPU has just taken,
|
|
203
|
+
* once ({@link mark_handover}) — and clears the list. A world mark on
|
|
197
204
|
* an attached entity whose parent has a row writes nothing: its local offset and its parent are
|
|
198
205
|
* unchanged, and the GPU composes the rest. That is what stops a root's move from costing a row
|
|
199
206
|
* per descendant.
|
|
@@ -564,6 +571,24 @@ export class GPUSceneRows {
|
|
|
564
571
|
this.#mark(entity, MARK_LOCAL);
|
|
565
572
|
}
|
|
566
573
|
|
|
574
|
+
/**
|
|
575
|
+
* The entity's offset passes to the GPU as it stands: a clip binds it for the first time, or a
|
|
576
|
+
* CPU writer that held it has let go and a clip still bound has it back. The next flush writes
|
|
577
|
+
* the offset into the row once more, though `GPUStateAuthority` already says the GPU writes it.
|
|
578
|
+
*
|
|
579
|
+
* The bit is granted at that moment, and the flush runs later, in the frame's build, and reads
|
|
580
|
+
* the bit then. So whatever was written since the last flush — an offset announced in the frame
|
|
581
|
+
* the clip binds; a holder's last step, or an offset it captured and put back — would never
|
|
582
|
+
* reach the row: the axes no bound clip keys would keep the previous pose on the GPU, while the
|
|
583
|
+
* CPU twin reads the offset. The axes a clip keys are rewritten by the resolve, which runs after
|
|
584
|
+
* the flush.
|
|
585
|
+
*
|
|
586
|
+
* @param {number} entity
|
|
587
|
+
*/
|
|
588
|
+
mark_handover(entity) {
|
|
589
|
+
this.#mark(entity, MARK_LOCAL | MARK_HANDOVER);
|
|
590
|
+
}
|
|
591
|
+
|
|
567
592
|
/**
|
|
568
593
|
* The entity's world transform changed. For an entity the GPU composes under a parent row this
|
|
569
594
|
* is nothing to write; for one carrying its world pose it is the row's contents.
|
|
@@ -845,10 +870,11 @@ export class GPUSceneRows {
|
|
|
845
870
|
|
|
846
871
|
const parent_changed = this.#parent_row[entity] !== parent_row;
|
|
847
872
|
|
|
848
|
-
if ((flags & GPUStateAuthorityFlags.TransformAttachment) !== 0) {
|
|
873
|
+
if ((flags & GPUStateAuthorityFlags.TransformAttachment) !== 0 && (why & MARK_HANDOVER) === 0) {
|
|
849
874
|
// The GPU writes this row's TRS — a clip, a pose the CPU never sees — and a CPU that
|
|
850
875
|
// wrote it too would race what the animation just resolved. The parent row is still
|
|
851
|
-
// this side's, and changes only when the parent's own row comes or goes.
|
|
876
|
+
// this side's, and changes only when the parent's own row comes or goes. A hand-over
|
|
877
|
+
// is the one write past the bit: the offset as the GPU takes it.
|
|
852
878
|
if (!parent_changed) {
|
|
853
879
|
return 0;
|
|
854
880
|
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export class IKConstraint {
|
|
2
|
-
/**
|
|
3
|
-
* End bone that is going to be placed
|
|
4
|
-
* @type {String}
|
|
5
|
-
*/
|
|
6
|
-
effector: string;
|
|
7
|
-
/**
|
|
8
|
-
* How far should effector be from the contact, positive values result in effector not reaching the surface, and negative result in penetration
|
|
9
|
-
* @example For a foot effector this would be distance above the ground
|
|
10
|
-
* @type {number}
|
|
11
|
-
*/
|
|
12
|
-
offset: number;
|
|
13
|
-
/**
|
|
14
|
-
* Positive distance from the surface at which IK starts to take effect, low value represents full effect and high value represents where the influence begins
|
|
15
|
-
* @type {NumericInterval}
|
|
16
|
-
*/
|
|
17
|
-
distance: NumericInterval;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @type {number}
|
|
21
|
-
*/
|
|
22
|
-
strength: number;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @type {number}
|
|
26
|
-
*/
|
|
27
|
-
limit: number;
|
|
28
|
-
/**
|
|
29
|
-
* Solver to be used for this constraint
|
|
30
|
-
* @type {string}
|
|
31
|
-
*/
|
|
32
|
-
solver: string;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param {IKConstraint} other
|
|
36
|
-
*/
|
|
37
|
-
copy(other: IKConstraint): void;
|
|
38
|
-
clone(): IKConstraint;
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @param {IKConstraint} other
|
|
42
|
-
* @returns {boolean}
|
|
43
|
-
*/
|
|
44
|
-
equals(other: IKConstraint): boolean;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @return {number}
|
|
48
|
-
*/
|
|
49
|
-
hash(): number;
|
|
50
|
-
}
|
|
51
|
-
import { NumericInterval } from "../../../core/math/interval/NumericInterval.js";
|
|
52
|
-
//# sourceMappingURL=IKConstraint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IKConstraint.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKConstraint.js"],"names":[],"mappings":"AAKA;IAEI;;;OAGG;IACH,iBAAc;IAEd;;;;OAIG;IACH,QAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,UAFU,eAAe,CAEY;IAErC;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;OAGG;IACH,OAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,QAFU,MAAM,CAEA;IAGhB;;;OAGG;IACH,YAFW,YAAY,QAStB;IAED,sBAMC;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CASnB;IAED;;;OAGG;IACH,QAFY,MAAM,CAWjB;CACJ;gCA7F+B,gDAAgD"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { combine_hash } from "../../../core/collection/array/combine_hash.js";
|
|
2
|
-
import { NumericInterval } from "../../../core/math/interval/NumericInterval.js";
|
|
3
|
-
import { computeHashFloat } from "../../../core/primitives/numbers/computeHashFloat.js";
|
|
4
|
-
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
5
|
-
|
|
6
|
-
export class IKConstraint {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* End bone that is going to be placed
|
|
10
|
-
* @type {String}
|
|
11
|
-
*/
|
|
12
|
-
effector = "";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* How far should effector be from the contact, positive values result in effector not reaching the surface, and negative result in penetration
|
|
16
|
-
* @example For a foot effector this would be distance above the ground
|
|
17
|
-
* @type {number}
|
|
18
|
-
*/
|
|
19
|
-
offset = 0;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Positive distance from the surface at which IK starts to take effect, low value represents full effect and high value represents where the influence begins
|
|
23
|
-
* @type {NumericInterval}
|
|
24
|
-
*/
|
|
25
|
-
distance = new NumericInterval(0, 0);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @type {number}
|
|
30
|
-
*/
|
|
31
|
-
strength = 1;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @type {number}
|
|
36
|
-
*/
|
|
37
|
-
limit = Math.PI;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Solver to be used for this constraint
|
|
41
|
-
* @type {string}
|
|
42
|
-
*/
|
|
43
|
-
solver = "2BIK";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @param {IKConstraint} other
|
|
49
|
-
*/
|
|
50
|
-
copy(other) {
|
|
51
|
-
this.effector = other.effector;
|
|
52
|
-
this.offset = other.offset;
|
|
53
|
-
this.distance.copy(other.distance);
|
|
54
|
-
this.strength = other.strength;
|
|
55
|
-
this.limit = other.limit;
|
|
56
|
-
this.solver = other.solver;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
clone() {
|
|
60
|
-
const r = new IKConstraint();
|
|
61
|
-
|
|
62
|
-
r.copy(this);
|
|
63
|
-
|
|
64
|
-
return r;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @param {IKConstraint} other
|
|
70
|
-
* @returns {boolean}
|
|
71
|
-
*/
|
|
72
|
-
equals(other) {
|
|
73
|
-
return this.effector === other.effector
|
|
74
|
-
&& this.offset === other.offset
|
|
75
|
-
&& this.distance.equals(other.distance)
|
|
76
|
-
&& this.strength === other.strength
|
|
77
|
-
&& this.limit === other.limit
|
|
78
|
-
&& this.solver === other.solver;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* @return {number}
|
|
84
|
-
*/
|
|
85
|
-
hash() {
|
|
86
|
-
return combine_hash(
|
|
87
|
-
computeStringHash(this.effector),
|
|
88
|
-
computeHashFloat(this.offset),
|
|
89
|
-
this.distance.hash(),
|
|
90
|
-
computeHashFloat(this.strength),
|
|
91
|
-
computeHashFloat(this.limit),
|
|
92
|
-
computeStringHash(this.solver)
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export class IKProblem {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @type {IKConstraint}
|
|
5
|
-
*/
|
|
6
|
-
constraint: IKConstraint;
|
|
7
|
-
/**
|
|
8
|
-
* Where the hierarchy lives. Bones are entities, so the chain is walked here rather than on a
|
|
9
|
-
* skeleton object.
|
|
10
|
-
*
|
|
11
|
-
* @type {EntityComponentDataset}
|
|
12
|
-
*/
|
|
13
|
-
dataset: EntityComponentDataset;
|
|
14
|
-
/**
|
|
15
|
-
* The bone being placed. Its ancestors are the rest of the chain, reached through
|
|
16
|
-
* {@link transform_attachment_parent_of}.
|
|
17
|
-
*
|
|
18
|
-
* @type {number}
|
|
19
|
-
*/
|
|
20
|
-
effector: number;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @type {Terrain}
|
|
24
|
-
*/
|
|
25
|
-
terrain: Terrain;
|
|
26
|
-
/**
|
|
27
|
-
* The clips playing on the constrained entity's model, with their times and weights: what a
|
|
28
|
-
* chain under a GPU-composed ancestor is evaluated against. Empty for a model nothing plays.
|
|
29
|
-
*
|
|
30
|
-
* @type {PosePlayback[]}
|
|
31
|
-
*/
|
|
32
|
-
playbacks: PosePlayback[];
|
|
33
|
-
/**
|
|
34
|
-
* The system's per-tick evaluation cache, shared by every problem of the tick; null where a
|
|
35
|
-
* chain is evaluated on its own.
|
|
36
|
-
*
|
|
37
|
-
* @type {T64WorldCache|null}
|
|
38
|
-
*/
|
|
39
|
-
cache: T64WorldCache | null;
|
|
40
|
-
}
|
|
41
|
-
export namespace IKProblem {
|
|
42
|
-
let pool: ObjectPoolFactory<IKProblem>;
|
|
43
|
-
}
|
|
44
|
-
import { ObjectPoolFactory } from "../../../core/model/object/ObjectPoolFactory.js";
|
|
45
|
-
//# sourceMappingURL=IKProblem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IKProblem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKProblem.js"],"names":[],"mappings":"AAGA;IAEI;;;OAGG;IACH,yBAAkB;IAElB;;;;;OAKG;IACH,gCAAe;IAEf;;;;;OAKG;IACH,UAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,iBAAe;IAEf;;;;;OAKG;IACH,WAFU,cAAc,CAET;IAEf;;;;;OAKG;IACH,OAFU,gBAAc,IAAI,CAEf;CAEhB;;cAIS,kBAAkB,SAAS,CAAC;;kCApDJ,iDAAiD"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { noop } from "../../../core/function/noop.js";
|
|
2
|
-
import { ObjectPoolFactory } from "../../../core/model/object/ObjectPoolFactory.js";
|
|
3
|
-
|
|
4
|
-
export class IKProblem {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @type {IKConstraint}
|
|
9
|
-
*/
|
|
10
|
-
constraint = null;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Where the hierarchy lives. Bones are entities, so the chain is walked here rather than on a
|
|
14
|
-
* skeleton object.
|
|
15
|
-
*
|
|
16
|
-
* @type {EntityComponentDataset}
|
|
17
|
-
*/
|
|
18
|
-
dataset = null;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The bone being placed. Its ancestors are the rest of the chain, reached through
|
|
22
|
-
* {@link transform_attachment_parent_of}.
|
|
23
|
-
*
|
|
24
|
-
* @type {number}
|
|
25
|
-
*/
|
|
26
|
-
effector = -1;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @type {Terrain}
|
|
31
|
-
*/
|
|
32
|
-
terrain = null;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The clips playing on the constrained entity's model, with their times and weights: what a
|
|
36
|
-
* chain under a GPU-composed ancestor is evaluated against. Empty for a model nothing plays.
|
|
37
|
-
*
|
|
38
|
-
* @type {PosePlayback[]}
|
|
39
|
-
*/
|
|
40
|
-
playbacks = [];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The system's per-tick evaluation cache, shared by every problem of the tick; null where a
|
|
44
|
-
* chain is evaluated on its own.
|
|
45
|
-
*
|
|
46
|
-
* @type {T64WorldCache|null}
|
|
47
|
-
*/
|
|
48
|
-
cache = null;
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @type {ObjectPoolFactory<IKProblem>}
|
|
55
|
-
*/
|
|
56
|
-
IKProblem.pool = new ObjectPoolFactory(() => {
|
|
57
|
-
return new IKProblem();
|
|
58
|
-
}, noop, noop);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IKSolver.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKSolver.js"],"names":[],"mappings":"AAAA;IACI;;;OAGG;IACH,gCAEC;CACJ"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export class InverseKinematics {
|
|
2
|
-
/**
|
|
3
|
-
* @readonly
|
|
4
|
-
* @type {IKConstraint[]}
|
|
5
|
-
*/
|
|
6
|
-
readonly constraints: IKConstraint[];
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param {InverseKinematics} other
|
|
10
|
-
*/
|
|
11
|
-
copy(other: InverseKinematics): void;
|
|
12
|
-
clone(): InverseKinematics;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param {Object} options
|
|
16
|
-
* @param {String} options.effector
|
|
17
|
-
* @param {number} options.offset
|
|
18
|
-
* @param {number} options.distanceMin
|
|
19
|
-
* @param {number} options.distanceMax
|
|
20
|
-
* @param {number} options.strength
|
|
21
|
-
* @param {number} options.limit
|
|
22
|
-
* @param {String} options.solver
|
|
23
|
-
*/
|
|
24
|
-
add({ effector, offset, distanceMin, distanceMax, strength, limit, solver }: {
|
|
25
|
-
effector: string;
|
|
26
|
-
offset: number;
|
|
27
|
-
distanceMin: number;
|
|
28
|
-
distanceMax: number;
|
|
29
|
-
strength: number;
|
|
30
|
-
limit: number;
|
|
31
|
-
solver: string;
|
|
32
|
-
}): void;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param {InverseKinematics} other
|
|
36
|
-
* @returns {boolean}
|
|
37
|
-
*/
|
|
38
|
-
equals(other: InverseKinematics): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* @returns {number}
|
|
41
|
-
*/
|
|
42
|
-
hash(): number;
|
|
43
|
-
}
|
|
44
|
-
export namespace InverseKinematics {
|
|
45
|
-
let typeName: string;
|
|
46
|
-
}
|
|
47
|
-
import { IKConstraint } from "./IKConstraint.js";
|
|
48
|
-
//# sourceMappingURL=InverseKinematics.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InverseKinematics.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/InverseKinematics.js"],"names":[],"mappings":"AAGA;IAEI;;;OAGG;IACH,sBAFU,YAAY,EAAE,CAEP;IAEjB;;;OAGG;IACH,YAFW,iBAAiB,QAe3B;IAED,2BAMC;IAED;;;;;;;;;;OAUG;IACH;QAR2B,QAAQ;QACR,MAAM,EAAtB,MAAM;QACU,WAAW,EAA3B,MAAM;QACU,WAAW,EAA3B,MAAM;QACU,QAAQ,EAAxB,MAAM;QACU,KAAK,EAArB,MAAM;QACU,MAAM;aAqBhC;IAED;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CAsBnB;IAED;;OAEG;IACH,QAFa,MAAM,CAgBlB;CACJ;;;;6BAnH4B,mBAAmB"}
|