SceneNodeAnimator hasFinished() issues

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
remark
Posts: 14
Joined: Wed May 28, 2014 5:02 am

SceneNodeAnimator hasFinished() issues

Post by remark »

Hi, I am trying to make a loop where the program wont exit the loop until the animation I placed on the camera is done, but I cant seem to get it to work, hasFinished() seems to return 0/false while it is running, but when I put it in a while loop, it simply stops everything and stays stuck in the loop forever, and the animation stops. Any help would be great.

Code: Select all

scene::ISceneNodeAnimator *anim = smgr->createFlyStraightAnimator(core::vector3df(camera->getPosition()),
                            core::vector3df(camera->getPosition().X,-1,camera->getPosition().Z-(10 * counter)), 500*counter, false);
                camera->addAnimator(anim);
                while (anim->hasFinished() == false)
                {
                    cout<<anim->hasFinished();
                }
                anim->drop();
http://irrlicht.sourceforge.net/docu/cl ... mator.html
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: SceneNodeAnimator hasFinished() issues

Post by thanhle »

You should put an if statement instead.

Animator updated by dt each frame.

Your code does an infinite loop because the next frame never executed. Your code seems to stuck in the first frame.

Regards
Thanh
Post Reply