Fix looking at with 180 degree arc

Co-authored-by: Fruitsalad <949631+fruitsalad@users.noreply.github.com>
This commit is contained in:
Silc Lizard (Tokage) Renew
2025-01-01 10:58:25 +09:00
parent 0f95e9f8e6
commit d0c421976c
7 changed files with 55 additions and 11 deletions

View File

@@ -1066,7 +1066,6 @@ void Node3D::look_at_from_position(const Vector3 &p_pos, const Vector3 &p_target
ERR_THREAD_GUARD;
ERR_FAIL_COND_MSG(p_pos.is_equal_approx(p_target), "Node origin and target are in the same position, look_at() failed.");
ERR_FAIL_COND_MSG(p_up.is_zero_approx(), "The up vector can't be zero, look_at() failed.");
ERR_FAIL_COND_MSG(p_up.cross(p_target - p_pos).is_zero_approx(), "Up vector and direction between node origin and target are aligned, look_at() failed.");
Vector3 forward = p_target - p_pos;
Basis lookat_basis = Basis::looking_at(forward, p_up, p_use_model_front);