How do you drop a node?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
GameCreator
Posts: 22
Joined: Wed Jun 08, 2005 2:44 pm

How do you drop a node?

Post by GameCreator »

Sounds like a simple question and I'm sure the solution is simple but I couldn't find an answer on these forums.

My problem is that I want to load a level, play in it, drop it, then load another but when I looked in the Irrlicht help for a create function for nodes, I couldn't find one. I understand that drop() only works on things that are created. So if no create function exists for nodes, how do you create one that can be dropped?

My search only turned up one useful thread, which I didn't quite understand, somehow involving the grab() function. Does that turn non-drop()-able objects into drop()-able ones?

So, in short, if I have:
IAnimatedMesh* mesh = smgr->getMesh("data\\level01.3ds");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

How do I now drop() that?

Thanks!!
Elise
Posts: 48
Joined: Tue Jul 19, 2005 6:30 am
Contact:

Post by Elise »

node->remove();

or

SceneManager->addToDeletionQueue(node);

First one can cause the app to crash under certain conditions so you might want to use the other one.
Grey Lantern
Posts: 34
Joined: Sat Jul 30, 2005 9:45 am
Contact:

Post by Grey Lantern »

I do a scenemanager->clearall then reload for different areas. Not sure this is optimal but it seems to clean up the resources!
GameCreator
Posts: 22
Joined: Wed Jun 08, 2005 2:44 pm

Post by GameCreator »

Awesome!! Thanks Elise and Grey Lantern!

(Also, just a heads-up that it's just clear(), not clearall() that clears everything, at least in my version (0.10.0))
Post Reply