We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0e14871 + 4240402 commit 5070a42Copy full SHA for 5070a42
core/math/quaternion.h
@@ -146,7 +146,11 @@ struct [[nodiscard]] Quaternion {
146
#ifdef MATH_CHECKS
147
ERR_FAIL_COND_MSG(p_v0.is_zero_approx() || p_v1.is_zero_approx(), "The vectors must not be zero.");
148
#endif
149
- constexpr real_t ALMOST_ONE = 1.0f - (real_t)CMP_EPSILON;
+#ifdef REAL_T_IS_DOUBLE
150
+ constexpr real_t ALMOST_ONE = 0.999999999999999;
151
+#else
152
+ constexpr real_t ALMOST_ONE = 0.99999975f;
153
+#endif
154
Vector3 n0 = p_v0.normalized();
155
Vector3 n1 = p_v1.normalized();
156
real_t d = n0.dot(n1);
@@ -169,6 +173,7 @@ struct [[nodiscard]] Quaternion {
169
173
z = c.z * rs;
170
174
w = s * 0.5f;
171
175
}
176
+ normalize();
172
177
178
};
179
0 commit comments