diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-11-26 13:04:45 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-26 13:04:45 -0600 |
commit | d18f8046dd29ce004fb401aa5d8c22858855a149 (patch) | |
tree | b51cb5f16233fa48b0ab24277c9bf21588849c17 /scene/3d | |
parent | dc0fcf9753972163e0a28d647801d9b039073210 (diff) | |
parent | 27bd7b23f68da271adda17dfff085b4e075717bf (diff) | |
download | redot-engine-d18f8046dd29ce004fb401aa5d8c22858855a149.tar.gz |
Merge pull request #99613 from TokageItLab/scl-fw
Fix `forward_vector` scale to handle `safe_margin` correctly in LookAtModifier
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/look_at_modifier_3d.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/look_at_modifier_3d.cpp b/scene/3d/look_at_modifier_3d.cpp index 269e190edc..47a8a9050e 100644 --- a/scene/3d/look_at_modifier_3d.cpp +++ b/scene/3d/look_at_modifier_3d.cpp @@ -534,7 +534,7 @@ void LookAtModifier3D::_process_modification() { } else { origin_tr = bone_rest_space; } - forward_vector = bone_rest_space.basis.xform_inv((target->get_global_position() - origin_tr.translated_local(origin_offset).origin)); + forward_vector = bone_rest_space.orthonormalized().basis.xform_inv((target->get_global_position() - origin_tr.translated_local(origin_offset).origin)); forward_vector_nrm = forward_vector.normalized(); if (forward_vector_nrm.abs().is_equal_approx(get_vector_from_axis(primary_rotation_axis))) { destination = skeleton->get_bone_pose_rotation(bone); |