i would like to create a meshviewer, witch loads .pk3 files with the addFileOpenDialog and loads the meshes within, but when i change the file system it does not reload the meshes, so the old are still displayed.
..jes i´m not a pro
anny code snipples to learn would help.
changing file system with open file dialog ?
The mesh is still in the meshcache so if you reload it with the same name you have to remove the old one first explicitly.
You can access the cache like: sceneManager->getMeshCache ().
And there you have several ways to remove it. Best check the docs to find the functions for that.
You can access the cache like: sceneManager->getMeshCache ().
And there you have several ways to remove it. Best check the docs to find the functions for that.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
using irrlicht 1.2
tried the following
but something is wrong
please help...
tried the following
Code: Select all
// solid-oberflächen
scene::IAnimatedMeshSceneNode* mesh = 0;
if(mesh)
mesh->remove();
mesh = 0;
scene::IAnimatedMesh* solid = 0;
smgr->getMeshCache();
scene::IMeshCache*cache = 0;
cache->removeMesh(solid);
solid = smgr->getMesh("solid.3ds");
scene::ITriangleSelector* selectormesh = 0;
if(solid)
{
mesh = smgr->addAnimatedMeshSceneNode(solid);
mesh->setMaterialType(video::EMT_SOLID);
mesh->setMaterialFlag(video::EMF_LIGHTING, false);
// erkennung für collision
selectormesh = smgr->createTriangleSelector(solid->getMesh(0), mesh);
mesh->setTriangleSelector(selectormesh);
metaselector->addTriangleSelector(selectormesh);
}
please help...
Code: Select all
scene::IMeshCache*cache = 0;
cache->removeMesh(solid);
You are accessing an invalid pointer. You have to initialize it using ISceneManager::getMeshCache()
And for the future: "Something is wrong" is not an acceptable error description. Not if you want us to help you.
Oh and btw:
The current Irrlicht version is 1.5 and 1.6 is on its way.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.