diff options
Diffstat (limited to 'scene/resources/skeleton_modification_2d_fabrik.cpp')
-rw-r--r-- | scene/resources/skeleton_modification_2d_fabrik.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/resources/skeleton_modification_2d_fabrik.cpp b/scene/resources/skeleton_modification_2d_fabrik.cpp index aef852f7e4..c03a92b503 100644 --- a/scene/resources/skeleton_modification_2d_fabrik.cpp +++ b/scene/resources/skeleton_modification_2d_fabrik.cpp @@ -161,25 +161,25 @@ void SkeletonModification2DFABRIK::_execute(float p_delta) { } Bone2D *final_bone2d_node = Object::cast_to<Bone2D>(ObjectDB::get_instance(fabrik_data_chain[fabrik_data_chain.size() - 1].bone2d_node_cache)); - float final_bone2d_angle = final_bone2d_node->get_global_transform().get_rotation(); + float final_bone2d_angle = final_bone2d_node->get_global_rotation(); if (fabrik_data_chain[fabrik_data_chain.size() - 1].use_target_rotation) { final_bone2d_angle = target_global_pose.get_rotation(); } Vector2 final_bone2d_direction = Vector2(Math::cos(final_bone2d_angle), Math::sin(final_bone2d_angle)); float final_bone2d_length = final_bone2d_node->get_length() * MIN(final_bone2d_node->get_global_scale().x, final_bone2d_node->get_global_scale().y); - float target_distance = (final_bone2d_node->get_global_transform().get_origin() + (final_bone2d_direction * final_bone2d_length)).distance_to(target->get_global_transform().get_origin()); + float target_distance = (final_bone2d_node->get_global_position() + (final_bone2d_direction * final_bone2d_length)).distance_to(target->get_global_position()); chain_iterations = 0; while (target_distance > chain_tolarance) { chain_backwards(); chain_forwards(); - final_bone2d_angle = final_bone2d_node->get_global_transform().get_rotation(); + final_bone2d_angle = final_bone2d_node->get_global_rotation(); if (fabrik_data_chain[fabrik_data_chain.size() - 1].use_target_rotation) { final_bone2d_angle = target_global_pose.get_rotation(); } final_bone2d_direction = Vector2(Math::cos(final_bone2d_angle), Math::sin(final_bone2d_angle)); - target_distance = (final_bone2d_node->get_global_transform().get_origin() + (final_bone2d_direction * final_bone2d_length)).distance_to(target->get_global_transform().get_origin()); + target_distance = (final_bone2d_node->get_global_position() + (final_bone2d_direction * final_bone2d_length)).distance_to(target->get_global_position()); chain_iterations += 1; if (chain_iterations >= chain_max_iterations) { @@ -210,7 +210,7 @@ void SkeletonModification2DFABRIK::_execute(float p_delta) { chain_trans.set_rotation(chain_trans.get_rotation() - joint_bone2d_node->get_bone_angle()); // Reset scale - chain_trans.set_scale(joint_bone2d_node->get_global_transform().get_scale()); + chain_trans.set_scale(joint_bone2d_node->get_global_scale()); // Apply to the bone, and to the override joint_bone2d_node->set_global_transform(chain_trans); |