Should I use remove() or SceneManager->addToDeletionQueue

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
Adversus
Posts: 128
Joined: Sun Oct 05, 2008 10:58 pm
Contact:

Should I use remove() or SceneManager->addToDeletionQueue

Post by Adversus »

Should I call remove() or SceneManager->addToDeletionQueue(this) to remove a node I'm currently in.

I would imagine the second but not sure.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

If you need to remove something from inside drawAll() (in OnPreRender, OnAnimate, etc) then use addToDeletionQueue, otherwise you can safely call remove.
It just prevents messing up the parent's Children's list iterator while Irrlicht is iterating through the list
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Adversus
Posts: 128
Joined: Sun Oct 05, 2008 10:58 pm
Contact:

Post by Adversus »

OK but what about Animators, I want one to remove itself after a certain period of time.
Adversus
Posts: 128
Joined: Sun Oct 05, 2008 10:58 pm
Contact:

Post by Adversus »

Agh this has been covered and aparently the new fix is in subversion although I just copied and pasted the code.

http://irrlicht.sourceforge.net/phpBB2/ ... e+animator
Post Reply