Remove animator from animator

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
IPv6
Posts: 188
Joined: Tue Aug 08, 2006 11:58 am

Remove animator from animator

Post by IPv6 »

Hello!
Is there a way to call removeAnimator from another animator? i`m getting a crash when trying to do that. it seems that there is a lack of "deletion" list for animators just as for scene nodes :(
kompadre
Posts: 8
Joined: Tue Aug 08, 2006 9:56 pm
Contact:

Post by kompadre »

No, as far as I know. When I needed this I used an ugly hack like:

Code: Select all

				core::list<ISceneNodeAnimator*>::Iterator ait = Animators.begin();
				for (; ait != Animators.end();) {
					if (!(*ait)->Unused) {
						(*ait)->animateNode(this, timeMs);
						++ait;
					}
					else {
						ISceneNodeAnimator *unused = *ait;
						++ait;
						removeAnimator(unused);
					}
				}

in include/ISceneNode.h and added "Unused" property to the ISceneNodeAnimator class.
Post Reply