How Do I remove a ISceneNode?

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
torleif
Posts: 188
Joined: Mon Jun 30, 2008 4:53 am

How Do I remove a ISceneNode?

Post by torleif »

I have ISceneNode created by addSkyBoxSceneNode(). The textures are loaded by addZipFileArchive(), and then loaded from the main folder.

It loads the textures fine, but when I try to call it again, it stays the same. The code is as following:

Code: Select all

// --- sets & loads the skybox ---
void setSkyBox(s32 type, 
	io::IFileSystem* fileSystem, 
	scene::ISceneManager* smgr,
	video::IVideoDriver* driver) {
	// name of the skybox
	core::stringc skyBoxName = "art/skybox";
	skyBoxName.append(intToChar(type));
	skyBoxName.append(".zip");

	driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
	if(fileSystem->addZipFileArchive(skyBoxName.c_str())) {
		if(mySkyBox) {
			mySkyBox->remove();
		}
		mySkyBox = smgr->addSkyBoxSceneNode(
			driver->getTexture("5.jpg"), 
			driver->getTexture("6.jpg"), 
			driver->getTexture("2.jpg"), 
			driver->getTexture("4.jpg"),  
			driver->getTexture("3.jpg"),  
			driver->getTexture("1.jpg"));
	}
	driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
};
Post Reply