Use atan2 rather than acos in Vector3.angle_to.

Fixes #8111.

(cherry picked from commit 3730e0533c)
This commit is contained in:
Ferenc Arn 2017-03-24 12:03:33 -05:00 committed by Rémi Verschelde
parent 0c650c2511
commit f263274a25

View file

@ -193,7 +193,7 @@ real_t Vector3::distance_squared_to(const Vector3 &p_b) const {
real_t Vector3::angle_to(const Vector3 &p_b) const { real_t Vector3::angle_to(const Vector3 &p_b) const {
return Math::acos(this->dot(p_b) / Math::sqrt(this->length_squared() * p_b.length_squared())); return Math::atan2(cross(p_b).length(), dot(p_b));
} }
/* Operators */ /* Operators */