Update for float, double and unsigned char, unsigned short, short, etc. char was left alone: read why here http://msdn.microsoft.com/en-us/library/cc953fe1.aspx

This commit is contained in:
cpusci 2013-08-04 16:58:59 -05:00
parent 4c35fd37af
commit 7a8f46b19f
36 changed files with 75 additions and 75 deletions

View file

@ -278,9 +278,9 @@ void AnimData::parseTargetString(const char* target, S32 fullCount, const char*
/// Solve the cubic spline B(s) = param for s
F32 AnimData::invertParamCubic(F32 param, F32 x0, F32 x1, F32 x2, F32 x3) const
{
const double INVERTPARAMCUBIC_TOL = 1.0e-09;
const double INVERTPARAMCUBIC_SMALLERTOL = 1.0e-20;
const double INVERTPARAMCUBIC_MAXIT = 100;
const F64 INVERTPARAMCUBIC_TOL = 1.0e-09;
const F64 INVERTPARAMCUBIC_SMALLERTOL = 1.0e-20;
const F64 INVERTPARAMCUBIC_MAXIT = 100;
// check input value for outside range
if ((param - x0) < INVERTPARAMCUBIC_SMALLERTOL)
@ -295,12 +295,12 @@ F32 AnimData::invertParamCubic(F32 param, F32 x0, F32 x1, F32 x2, F32 x3) const
F32 v = 1.0f;
while (iterations < INVERTPARAMCUBIC_MAXIT) {
double a = (x0 + x1)*0.5f;
double b = (x1 + x2)*0.5f;
double c = (x2 + x3)*0.5f;
double d = (a + b)*0.5f;
double e = (b + c)*0.5f;
double f = (d + e)*0.5f;
F64 a = (x0 + x1)*0.5f;
F64 b = (x1 + x2)*0.5f;
F64 c = (x2 + x3)*0.5f;
F64 d = (a + b)*0.5f;
F64 e = (b + c)*0.5f;
F64 f = (d + e)*0.5f;
if (mFabs(f - param) < INVERTPARAMCUBIC_TOL)
break;