Changed 0.001 and 0.00001 to EPSILON

This commit is untested.
I don't know what consequences this has.
Since the commits that added these numbers were before epsilon was added,
I have assumed that epsilon could replace them.
This commit is contained in:
Brian-E 2023-08-13 02:43:19 +01:00
parent feaaf95db4
commit 03567d2b2e

View File

@ -1826,7 +1826,7 @@ RMAPI Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount)
float halfTheta = acosf(cosHalfTheta); float halfTheta = acosf(cosHalfTheta);
float sinHalfTheta = sqrtf(1.0f - cosHalfTheta*cosHalfTheta); float sinHalfTheta = sqrtf(1.0f - cosHalfTheta*cosHalfTheta);
if (fabsf(sinHalfTheta) < 0.001f) if (fabsf(sinHalfTheta) < EPSILON)
{ {
result.x = (q1.x*0.5f + q2.x*0.5f); result.x = (q1.x*0.5f + q2.x*0.5f);
result.y = (q1.y*0.5f + q2.y*0.5f); result.y = (q1.y*0.5f + q2.y*0.5f);
@ -2039,7 +2039,7 @@ RMAPI void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle
float resAngle = 2.0f*acosf(q.w); float resAngle = 2.0f*acosf(q.w);
float den = sqrtf(1.0f - q.w*q.w); float den = sqrtf(1.0f - q.w*q.w);
if (den > 0.0001f) if (den > EPSILON)
{ {
resAxis.x = q.x/den; resAxis.x = q.x/den;
resAxis.y = q.y/den; resAxis.y = q.y/den;