diff options
author | Ferenc Arn <tagcup@yahoo.com> | 2017-03-24 12:03:33 -0500 |
---|---|---|
committer | Ferenc Arn <tagcup@yahoo.com> | 2017-03-24 12:03:33 -0500 |
commit | 3730e0533cceaefe7981387804556810442865e1 (patch) | |
tree | 7bd178d033eddb2480564c021c67833ea0a322bb /core/math | |
parent | efaeebab4d83e5657288b7b20db6ce4ccf987a01 (diff) |
Use atan2 rather than acos in Vector3.angle_to.
Fixes #8111.
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/vector3.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h index fc02e66c33..9a31ec4f27 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -214,7 +214,7 @@ real_t Vector3::distance_squared_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 */ |