mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix Quaternion arc constructor tolerance
This commit is contained in:
parent
1b4ed4c038
commit
37aca09b23
1 changed files with 6 additions and 1 deletions
|
|
@ -139,7 +139,11 @@ struct [[nodiscard]] Quaternion {
|
||||||
#ifdef MATH_CHECKS
|
#ifdef MATH_CHECKS
|
||||||
ERR_FAIL_COND_MSG(p_v0.is_zero_approx() || p_v1.is_zero_approx(), "The vectors must not be zero.");
|
ERR_FAIL_COND_MSG(p_v0.is_zero_approx() || p_v1.is_zero_approx(), "The vectors must not be zero.");
|
||||||
#endif
|
#endif
|
||||||
constexpr real_t ALMOST_ONE = 1.0f - (real_t)CMP_EPSILON;
|
#ifdef REAL_T_IS_DOUBLE
|
||||||
|
constexpr real_t ALMOST_ONE = 0.999999999999999;
|
||||||
|
#else
|
||||||
|
constexpr real_t ALMOST_ONE = 0.99999975f;
|
||||||
|
#endif
|
||||||
Vector3 n0 = p_v0.normalized();
|
Vector3 n0 = p_v0.normalized();
|
||||||
Vector3 n1 = p_v1.normalized();
|
Vector3 n1 = p_v1.normalized();
|
||||||
real_t d = n0.dot(n1);
|
real_t d = n0.dot(n1);
|
||||||
|
|
@ -162,6 +166,7 @@ struct [[nodiscard]] Quaternion {
|
||||||
z = c.z * rs;
|
z = c.z * rs;
|
||||||
w = s * 0.5f;
|
w = s * 0.5f;
|
||||||
}
|
}
|
||||||
|
normalize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue