deleting a mesh permanently

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
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

deleting a mesh permanently

Post by johann_gambolputty »

Hi i'm working on a game that will create/delete charaters (Skined meshes) frequently. Each time the level ends i want to delete the old "IAnimatedMesh" and load a new one.

Code: Select all

IAnimatedMesh * mesh = smgr->getMesh("character_A.X");
 
// Now mesh's ref counter is 1 (held by the scene manager)
after the level ends i want to delete this mesh but i cant... because for that i need to release the scene manager thus the whole device.
if i drop() the mesh it will delete it , but the pointer will be still referenced somewhere in the scene manager... and when drop() the device , the mesh ref couter will be -1... which isn't a good thing...

i just wish there are methods like

Code: Select all

sceneManager->removeMesh(IAnimatedMesh * mesh); 
and
sceneManager->removeNode(ISceneNode * node);
Is there any solution to delete meshes inside a game loop?
Thanks in advance !
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: deleting a mesh permanently

Post by CuteAlien »

SceneManager has a getMeshCache function. That's where the meshes are grabbed additionally - you'll find functions there to remove them.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Re: deleting a mesh permanently

Post by johann_gambolputty »

Yep that's exacly what i need ! Thanks !
Post Reply