Hi everyone!
I have a question on Irrlicht scene management system.
I have downloaded the Newton-irrlicht tutorial and took a look at the source code. In the demo application you have some boxes falling down from the sky. During the application if you make a mouse click a box appears in front of you. I took a look at the box creation code and I have noticed this:
NewtonCube *CGame::MakeCube(vector3df loc)
{
NewtonCube *tmp = new NewtonCube;
tmp->mesh = smgr->getMesh("data/smallcube.3ds");
I am confused about the last line. The application loads the mesh from the hard disk each time a new object is being created? Does't this slow down the application?
Object creation during game runtime.
When you call getMesh for the first time with a filename, it loads the mesh from the file. But if you call it more times, it will return the same object. So meshes are shared among mesh scene nodes. To physically load a mesh every time use the meshbuffer (new in 0.12).the code IS loading the mesh from a file every time the object is instantiated
(Anyway, I still need a function that copies a mesh optionally with its materials without loading it again from file.)
Toma
"This is not a bug, this is a feature!"