diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-18 23:45:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 23:45:37 +0100 |
commit | 217d9d1b3057499a64dfff915121afb531198af0 (patch) | |
tree | fd22d155472ab5a642e237808bea0dbec30c7460 /scene/3d | |
parent | d0f0fdb6ad9fff7672d2c3da58cc6d7fdbf741ca (diff) | |
parent | c15e23396da5d44b23dd6edc0df8ccaebbd9f6bc (diff) |
Merge pull request #47147 from TwistedTwigleg/skeletonik_changes_and_bug_fixes_regressionfix
Fix for regression in SkeletonIK code
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/skeleton_ik_3d.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp index 80c1f0ddb1..85da546430 100644 --- a/scene/3d/skeleton_ik_3d.cpp +++ b/scene/3d/skeleton_ik_3d.cpp @@ -268,6 +268,10 @@ void FabrikInverseKinematic::solve(Task *p_task, real_t blending_delta, bool ove p_task->skeleton->set_bone_global_pose_override(p_task->chain.tips[i].chain_item->bone, Transform(), 0.0, true); } + // Update the initial root transform + p_task->chain.chain_root.initial_transform = p_task->skeleton->get_bone_global_pose(p_task->chain.chain_root.bone); + p_task->chain.chain_root.current_pos = p_task->chain.chain_root.initial_transform.origin; + make_goal(p_task, p_task->skeleton->get_global_transform().affine_inverse(), blending_delta); if (p_use_magnet && p_task->chain.middle_chain_item) { |