deleting a model?

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
Guest

deleting a model?

Post by Guest »

Hello,

i´ve got a question. Is it possible to delete a model, which was loaded with smgr->addAnimatedMeshSceneNode?

Regards Efrint
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

Suppose you declared a mesh with

ISceneNode* node = smgr->addAnimatedMeshSceneNode;

You could just say:

node = NULL;

Would that serve your purpose?
Guest

Post by Guest »

no, not really, because the model i loaded doesn´t disappear.
Efrint
Posts: 18
Joined: Sat Dec 10, 2005 6:04 pm

Post by Efrint »

the class, i created for the models looks like this:

Code: Select all

class Model
	{
	public:
		
		bool LoadModel(const char* Path)
		{
			model = smgr->getMesh(Path);
			Name = smgr->addAnimatedMeshSceneNode (model);
			if(Name == 0)
			{
				return true;
			}
			return false;
		}

		void Delete()
		{
			model=NULL;
			Name=NULL;
		}

	protected:
		scene::IAnimatedMesh* model;
		scene:: ISceneNode* Name;
	};
but the model doesn´t disappear if i use the Delete() Function...
Guest

Post by Guest »

if you want to just hide it use node->setVisible(false).
dawasw
Posts: 357
Joined: Tue Aug 10, 2004 4:39 pm
Location: Poland

Post by dawasw »

Maybe:

modelNode->setVisible(false);

That should help.
Guest

Post by Guest »

try either remove() or drop()

so:

model->remove();

or

model->drop();

i think they should both work
Post Reply