summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-11-24 13:43:07 +0900
committerSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-11-24 13:43:07 +0900
commit27bd7b23f68da271adda17dfff085b4e075717bf (patch)
tree84a74db1d57f4d9b72836a5e909af3a48af6c3ae
parentf952bfe9985ad8f507cc29b2c7601bbba18b8039 (diff)
downloadredot-engine-27bd7b23f68da271adda17dfff085b4e075717bf.tar.gz
Fix forward_vector scale to handle safe_margin in LookAtModifier
-rw-r--r--scene/3d/look_at_modifier_3d.cpp2
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 ad33cd420a..8aa6a3f9c3 100644
--- a/scene/3d/look_at_modifier_3d.cpp
+++ b/scene/3d/look_at_modifier_3d.cpp
@@ -486,7 +486,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);