Merge pull request #8132 from tagcup/vector3_angle_to

Use atan2 rather than acos in Vector3.angle_to.
This commit is contained in:
Rémi Verschelde 2017-03-24 22:52:46 +01:00 committed by GitHub
commit 60a9debb99

View file

@ -215,7 +215,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 */