Page 1 of 1

Stop animations from looping

Posted: Thu Sep 01, 2011 9:55 am
by brick
Sorry if I'm spamming the board with too many questions, but I'm really having trouble with this one. I can't seem to stop the animations (or the rotation) from looping. I've tried stopping it after a number of frames, but the number of scene and mesh frames doesn't match. I've found the following thread from some years ago, but I'm not sure if this is still the best solution.

http://irrlicht.sourceforge.net/forum/v ... php?t=2511

Re: Stop animations from looping

Posted: Thu Sep 01, 2011 10:07 am
by CuteAlien
There is IAnimatedMeshSceneNode::setLoopMode which allows setting the animation to non-looped. You can also stop it by setting setAnimationSpeed to 0. Or set setFrameLoop to a single value (maybe you need to give setCurrentFrame the same value).
You can catch the end of an animation by setting a callback with setAnimationEndCallback.

Here is the documentation for this all by the way: http://irrlicht.sourceforge.net/docu/cl ... _node.html

Re: Stop animations from looping

Posted: Thu Sep 01, 2011 10:11 am
by brick
That's great. Thanks a lot!