ISceneNodeAnimatorFinishing

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
squisher
Competition winner
Posts: 91
Joined: Sat May 17, 2008 2:23 am
Contact:

ISceneNodeAnimatorFinishing

Post by squisher »

what's the point of ISceneNodeAnimatorFinishing? It appears it would help optimize things by causing completed animators to be cleaned from the animator list, but nothing in the code appears to actually be calling HasFinished() or doing any cleaning.
Current project: StarDust. A single player galactic conquest game.
CuteAlien
Admin
Posts: 9682
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: ISceneNodeAnimatorFinishing

Post by CuteAlien »

We don't seem to have a ISceneNodeAnimatorFinishing... or I'm not seeing it in the docs right now. I would guess you mean ISceneNodeAnimator ::hasFinished() but you mention that as well, so probably not.
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
squisher
Competition winner
Posts: 91
Joined: Sat May 17, 2008 2:23 am
Contact:

Re: ISceneNodeAnimatorFinishing

Post by squisher »

It was in the Irrlicht 1.8 zip I downloaded. I'm not the only one:
http://code.google.com/p/opennero/sourc ... 640&r=1640
https://github.com/codetiger/IrrNacl/bl ... inishing.h
http://irrlicht.sourcearchive.com/docum ... shing.html

And most of the animator implementations inherit from ISceneNodeAnimatorFinishing

https://github.com/codetiger/IrrNacl/bl ... Delete.cpp

I understand these are mirrors. The point is they were included in the zip file i downloaded, and may still even be in it. If ISceneNodeAnimatorFinishing is just an atavism, that's fine, I'm just curious what the story is.

At the very least, ISceneNodeAnimator::hasFinished should be removed, because it leads to confusion and extra work, when it doesnt appear to be used at all. Shame it isnt used to keep the animator list clean..
Current project: StarDust. A single player galactic conquest game.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: ISceneNodeAnimatorFinishing

Post by serengeor »

squisher wrote:At the very least, ISceneNodeAnimator::hasFinished should be removed, because it leads to confusion and extra work, when it doesnt appear to be used at all. Shame it isnt used to keep the animator list clean..
I'm pretty sure it's not meant to be used internally in the engine to clean animators, but to tell the user that the animator has done its job and the user can do what ever he needs.
I'm sure some animators can be reset, reused so removing them might not be a good thing and might lead to confusion.
Maybe some other flag should be introduced that would tell that the animator should be removed after it has finished :roll:
Working on game: Marrbles (Currently stopped).
CuteAlien
Admin
Posts: 9682
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: ISceneNodeAnimatorFinishing

Post by CuteAlien »

Ah ok - I only looked in documentation, but that's just some internal class for common functionality all animators which do set the HasFinished flag need. Maybe the nicer solution would be if the class where public, wouldn't be in ISceneNodeAnimator at all and ISceneNodeAnimatorFinishing would be derived from ISceneNodeAnimator. For mainly historical reasons that's not the case so every animator has an hasFinished even if it will never set it.

But for users it doesn't really matter except that they have no additional hint which animators can finish, but generally it's obvious anyway.

We can't automatically remove as you might use the same animator again after it's finished.
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
Post Reply