Hi,
after i have worked through the tutorials and did some basic classes i want to do my first small game. While planning it i was curiose about the storage of the modells.
Does irrlicht load a Mesh 2+ times or does it recordnice that he has load this mesh former and just copy it from the first modell/mesh.
If not i will write a repository for the modells but if irrlicht manage that itself it would be some useless work.
sry for my english
is there a need for modell storage?
All loaded meshes are put in irr::scene::IMeshCache. If you try to load them again they are taken from there.
So no need to do that yourself :-)
So no need to do that yourself :-)
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
Thx for your fast reply.
Just a additional basic question?
I load a Modell and alter the Mesh. Now i Load the same File again. Is it the altered Mesh or complete new and loaded from file?
Or does the CMeshCache class holds the data independent from the nodes. So 1 copy for the CMeshCache class and one copy for each modell with the mesh.
Just a additional basic question?
I load a Modell and alter the Mesh. Now i Load the same File again. Is it the altered Mesh or complete new and loaded from file?
Or does the CMeshCache class holds the data independent from the nodes. So 1 copy for the CMeshCache class and one copy for each modell with the mesh.
I think it's like that:
The mesh is only identified by it's filename. So when you try to load a file again and there's a mesh with the same filename in the cache, then the cached mesh is used. If you don't want that behavior you can remove meshes from the cache.
And the nodes should directly use the meshes. At least the MeshSceneNode seems to to so. Can't guarantee it for the other nodetypes, I would have to check them, but I think this is the usual way. But it also shouldn't be that hard to implement a custom scenenode which would keep or create it's own copies of meshes.
The mesh is only identified by it's filename. So when you try to load a file again and there's a mesh with the same filename in the cache, then the cached mesh is used. If you don't want that behavior you can remove meshes from the cache.
And the nodes should directly use the meshes. At least the MeshSceneNode seems to to so. Can't guarantee it for the other nodetypes, I would have to check them, but I think this is the usual way. But it also shouldn't be that hard to implement a custom scenenode which would keep or create it's own copies of meshes.
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