Magnesus

I'm changing some animation code and I created animation class that has updateAnimation method:
if(currentAnimation!=null)
{
currentAnimation.apply(skeleton, this.animTime, loopAnimation);
this.animTime+=animStep;
skeleton.updateWorldTransform();
skeleton.update(animStep);
}
animStep is always 0.075f;
I'm not sure about animTime though - I tried zeroing it (as a local variable) every time currentAnimation changes and I tried setting it globally (incrementing by animStep once a frame). The animation seems to show only the end of the animation though in not looped animations...

My looped animation work properly (but it's posibble I get into the middle of the loop sometimes instead of always start from the beginning?).

I have several such animated objects...
Magnesus

Kickstarter Backer
  • 전체글: 111

Nate

Passing true for loop just does a modulus on the time using the animation duration. If you don't loop the animation, it will animate between 0 and the animation duration. For time greater than that it will pose the skeleton using the last position in the animation.
사용자 아바타
Nate

Nate
  • 전체글: 11795

Magnesus

Thanks. I probably have some mistake in the code that zeroes animTime when animation changes. Should be easy to find. I understand how it works now.
Magnesus

Kickstarter Backer
  • 전체글: 111


다시 돌아감: Editor