summaryrefslogtreecommitdiff
path: root/core/math/basis.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-05-12 15:08:03 +0200
committerGitHub <noreply@github.com>2023-05-12 15:08:03 +0200
commit2ac4e3bb30517998916bb6b81b7b76788276038c (patch)
tree245bf4614ff38f3b0fcac813c1dde8c39b57732d /core/math/basis.cpp
parentfdf66b3472e5ca254a4f90c32f26c4702d46828b (diff)
parentfa8b32cbd4503e73a840bd1a1dd32d2a88cc3f45 (diff)
Merge pull request #76998 from akien-mga/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.3) - 4th batch
Diffstat (limited to 'core/math/basis.cpp')
-rw-r--r--core/math/basis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index 95a4187062..bfd902c7e2 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -807,8 +807,8 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
z = (rows[1][0] - rows[0][1]) / s;
r_axis = Vector3(x, y, z);
- // CLAMP to avoid NaN if the value passed to acos is not in [0,1].
- r_angle = Math::acos(CLAMP((rows[0][0] + rows[1][1] + rows[2][2] - 1) / 2, (real_t)0.0, (real_t)1.0));
+ // acos does clamping.
+ r_angle = Math::acos((rows[0][0] + rows[1][1] + rows[2][2] - 1) / 2);
}
void Basis::set_quaternion(const Quaternion &p_quaternion) {