Animation end detecting

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
_Sareth_
Posts: 6
Joined: Tue May 04, 2010 12:03 pm
Location: Ukraine

Animation end detecting

Post by _Sareth_ »

This is noob question :)

I have .x meshes with animations. Each animation must plays one time, then it must changes to idle mesh. Main question: how can I detect end of animation. I'd tried to use construction like this:
(executes in loop)

Code: Select all

if(node->getFrameNr() >= node->getEndFrame() - 1)
{
   node->remove();
   ...
   node = scmng->addAnimatedMeshSceneNode(idle_mesh);
}
But this doesn't work well
animations don't playing after 2 returning to idle mesh.
Need help
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
_Sareth_
Posts: 6
Joined: Tue May 04, 2010 12:03 pm
Location: Ukraine

Post by _Sareth_ »

Acki wrote:try to use an animation end callback
thanks
it works fine
Post Reply