Stop animations from looping

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Stop animations from looping

Post 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
CuteAlien
Admin
Posts: 9693
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Stop animations from looping

Post 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
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Re: Stop animations from looping

Post by brick »

That's great. Thanks a lot!
Post Reply