Deleting or Removing a Scene Node???

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
reifsnyderb
Posts: 45
Joined: Wed Oct 29, 2008 6:03 pm

Deleting or Removing a Scene Node???

Post by reifsnyderb »

Hello,

How do I remove or delete a scene node?

I have tried, like this:

IBillboardSceneNode* bill = (IBillboardSceneNode*)smgr->getSceneNode(objectId);

if(bill)
{
bill->drop();
}


and it results in the program crashing at smgr->drawAll;
(objectId is valid...I checked)


Thanks,

Brian
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

That's because bill's parent isn't aware it's been drop. The proper way to do this is with bill->remove. It decouples the scene node with its parent. When the parent drops it, it gets deleted (unless you have grabbed it).
reifsnyderb
Posts: 45
Joined: Wed Oct 29, 2008 6:03 pm

Post by reifsnyderb »

Thank You! That works perfectly. I didn't even realize there was a remove.

Best Regards,

Brian


[quote="slavik262"]That's because bill's parent isn't aware it's been drop. The proper way to do this is with bill->remove. It decouples the scene node with its parent. When the parent drops it, it gets deleted (unless you have grabbed it).[/quote]
Post Reply