Browse Source

NaN animation time == kaboom

Adam Johnson 10 years ago
parent
commit
7e2595850b
  1. 22
      Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp

22
Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp

@ -508,8 +508,13 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs)
{ {
if (secs > fLoopEnd) if (secs > fLoopEnd)
{ {
secs = fmodf(secs - fLoopBegin, fLoopEnd - fLoopBegin) + fLoopBegin; float result = fmodf(secs - fLoopBegin, fLoopEnd - fLoopBegin) + fLoopBegin;
wrapped = true; // are they a dumb ass?
if (!isnan(result))
{
secs = result;
wrapped = true;
}
} }
} }
} }
@ -527,11 +532,16 @@ float plAnimTimeConvert::WorldToAnimTime(double wSecs)
{ {
if (secs < fLoopBegin) if (secs < fLoopBegin)
{ {
secs = fLoopEnd - fmodf(fLoopEnd - secs, fLoopEnd - fLoopBegin); float result = fLoopEnd - fmodf(fLoopEnd - secs, fLoopEnd - fLoopBegin);
wrapped = true; // are they a dumb ass?
if (!isnan(result))
{
secs = result;
wrapped = true;
}
} }
} }
} }
if (fFlags & kWrap) if (fFlags & kWrap)
{ {

Loading…
Cancel
Save