|
|
@ -557,11 +557,16 @@ hsScalar 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; |
|
|
|
|
|
|
|
// if fLoopBegin == fLoopEnd == 0, result will not be a number
|
|
|
|
|
|
|
|
if (!isnan(result)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
secs = result; |
|
|
|
wrapped = true; |
|
|
|
wrapped = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (IGetLatestState()->fStartAnimTime < fLoopBegin) |
|
|
|
if (IGetLatestState()->fStartAnimTime < fLoopBegin) |
|
|
@ -576,11 +581,16 @@ hsScalar 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); |
|
|
|
|
|
|
|
// if fLoopBegin == fLoopEnd == 0, result will not be a number
|
|
|
|
|
|
|
|
if (!isnan(result)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
secs = result; |
|
|
|
wrapped = true; |
|
|
|
wrapped = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (fFlags & kWrap) |
|
|
|
if (fFlags & kWrap) |
|
|
|
{ |
|
|
|
{ |
|
|
|