removing a mesh from a 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
c_olin3404
Posts: 67
Joined: Fri Jan 23, 2004 5:04 am

removing a mesh from a node?

Post by c_olin3404 »

Basicly what I'm trying to do is change weapons for my fps, I have an array of IAnimatedMesh* of the meshes of the weapons, and one node which is a child of the camera. In my change weapon function, i want to remove everything in the weapon node, and then add the correct mesh... but removeAll() makes the program freeze!! Why is this?
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Hmm, I'm not sure I understand the way you have it set up there, but this is what I would do.

I would create all the meshes on loading the level ( good practice, as there are no loading times then in the middle of a level for slow computers ) and then hide them all. Then, use your weapon switcher function to hide and unhide the meshes as needed. It probably isn't a good idea to delete meshes in the middle of the scene, it is all cleaned up in the end of the program with device->drop(), so just hide the unwanted meshes until then.
c_olin3404
Posts: 67
Joined: Fri Jan 23, 2004 5:04 am

Post by c_olin3404 »

but IAnimatedMesh as no ->setVisible() function, only ISceneNode does, and I need only a single node for the weapon!
brcolow

Post by brcolow »

I looked up removeAll in the functions list, and it seems to only work for scene nodes. I believe it freezes because you are removing the node!
c_olin3404
Posts: 67
Joined: Fri Jan 23, 2004 5:04 am

Post by c_olin3404 »

I just changed it so that there is a seperate node for every weapon, and it works great... thanks!
Post Reply