I guess there is a mistake for the code of SkeletonAnimation::addFrame and SkeletonAnimation::setFrame :
Code: Select all
mCurrentFrame = fmod( mCurrentFrame, maxFrame );
if( mCurrentFrame < 0 )
mCurrentFrame = maxFrame - mCurrentFrame;
Code: Select all
mCurrentFrame = maxFrame - mCurrentFrame;
the good version might be in fact :
Code: Select all
mCurrentFrame = mCurrentFrame + maxFrame; // or simply "mCurrentFrame += maxFrame;"
Code: Select all
mCurrentFrame = fmod( -5.1, 3.0 ); // mCurrentFrame = -2.1
if( mCurrentFrame < 0 ) // true
mCurrentFrame = -2.1 + 3.0; // mCurrentFrame = 0.9 => good behavior