summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-29 09:36:34 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-29 09:36:34 +0545
commitfc9767abb14348c2236b487f0bc6d18de65a38fd (patch)
treeef480b9a349b88a51b75296eae844c27a2504469 /scene/3d
parent5aa099aaed359df6ff79fe31616b5601db2a42c5 (diff)
Use functions defined in the their classes.
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/skeleton_ik_3d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp
index 466f67afb8..8d90aabfac 100644
--- a/scene/3d/skeleton_ik_3d.cpp
+++ b/scene/3d/skeleton_ik_3d.cpp
@@ -99,7 +99,7 @@ bool FabrikInverseKinematic::build_chain(Task *p_task, bool p_force_simple_chain
child_ci->current_pos = child_ci->initial_transform.origin;
if (child_ci->parent_item) {
- child_ci->length = (child_ci->current_pos - child_ci->parent_item->current_pos).length();
+ child_ci->length = child_ci->parent_item->current_pos.distance_to(child_ci->current_pos);
}
}
@@ -140,7 +140,7 @@ void FabrikInverseKinematic::solve_simple(Task *p_task, bool p_solve_magnet, Vec
solve_simple_backwards(p_task->chain, p_solve_magnet);
solve_simple_forwards(p_task->chain, p_solve_magnet, p_origin_pos);
- distance_to_goal = (p_task->chain.tips[0].chain_item->current_pos - p_task->chain.tips[0].end_effector->goal_transform.origin).length();
+ distance_to_goal = p_task->chain.tips[0].end_effector->goal_transform.origin.distance_to(p_task->chain.tips[0].chain_item->current_pos);
}
}