How to delete item?

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
fon3m
Posts: 32
Joined: Thu Sep 28, 2006 9:34 pm

How to delete item?

Post by fon3m »

When i get item, i want it disappear. and now i use setPosition to move it. I would like to know that can i delete item? and if can do, how to do that ?

Thank you
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

node->remove()

Always check the API ;)
Image Image Image
fon3m
Posts: 32
Joined: Thu Sep 28, 2006 9:34 pm

Post by fon3m »

i use remove(). and then have debug. :shock:
zeno60
Posts: 342
Joined: Sun May 21, 2006 2:48 am
Location: NC, USA
Contact:

Post by zeno60 »

Search API for node->setVisible() if you want them just to disappear.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yes I find it crashes when I use remove so I have resorted to using setVisible (false) in my projects..
jun
Posts: 12
Joined: Thu Dec 07, 2006 5:00 pm

Post by jun »

i also find it crashed when i use remove, but i think it has something to do with perhaps how i attached an animator to the node. i think if you remove a node with no animator attached it might not crash
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

jun wrote:i also find it crashed when i use remove, but i think it has something to do with perhaps how i attached an animator to the node. i think if you remove a node with no animator attached it might not crash
Perhaps you have a situation that requires this:

Code: Select all

ISceneManager::addToDeletionQueue(ISceneNode *node);
This tells Irrlicht to delete the node when it is safe to do so.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Thanks sio that looks great, i was afraid setVisible may have a performance impact after a few hours of use :lol:
Post Reply