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.
1 parent 1b4ed4c commit 37aca09Copy full SHA for 37aca09
core/math/quaternion.h
@@ -139,7 +139,11 @@ struct [[nodiscard]] Quaternion {
139
#ifdef MATH_CHECKS
140
ERR_FAIL_COND_MSG(p_v0.is_zero_approx() || p_v1.is_zero_approx(), "The vectors must not be zero.");
141
#endif
142
- constexpr real_t ALMOST_ONE = 1.0f - (real_t)CMP_EPSILON;
+#ifdef REAL_T_IS_DOUBLE
143
+ constexpr real_t ALMOST_ONE = 0.999999999999999;
144
+#else
145
+ constexpr real_t ALMOST_ONE = 0.99999975f;
146
+#endif
147
Vector3 n0 = p_v0.normalized();
148
Vector3 n1 = p_v1.normalized();
149
real_t d = n0.dot(n1);
@@ -162,6 +166,7 @@ struct [[nodiscard]] Quaternion {
162
166
z = c.z * rs;
163
167
w = s * 0.5f;
164
168
}
169
+ normalize();
165
170
171
};
172
0 commit comments