summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-03-24 22:52:46 +0100
committerGitHub <noreply@github.com>2017-03-24 22:52:46 +0100
commit60a9debb99ecb538ab91d76d80ab6f6c22cf4d5f (patch)
tree60dcfd7ebf73bccfa5935ab22e985a621b504e69
parent397380e9e5e07b438327b32a84a2e18f67ecf2c1 (diff)
parent3730e0533cceaefe7981387804556810442865e1 (diff)
Merge pull request #8132 from tagcup/vector3_angle_to
Use atan2 rather than acos in Vector3.angle_to.
-rw-r--r--core/math/vector3.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 097d6b9480..951380e898 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -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 */