mercoledì, agosto 02, 2006

Mesh Creator Class : Coded!

Hi,

this evening I've coded a class that had inside only one function.
This function is used from the Mesh storage to create a mesh.
Why I need this class?
Because The mesh storage works with IMesh interface, so the user can define his own mesh format and loader. In this way the programmer can store in the mesh storage his own mesh.
The mesh storage creates a mesh object and stores it.
The object creation... a line such as:
IMesh* newmesh= new ocelot::scene::OXMesh(dev,fname,numtextures,storage,_fvf);
is owned by the OXMesh class that is not generalized on IMesh.
So this line is defined in the creation function of an IMeshCreator object.
In this way if the programmer define his mesh class (ex: class My3DSMeshClass : public IMesh), he also must define the MeshCreator class (ex: class My3DSCreator : public IMeshCreator).
Finally he pass all the datas and the pointer to IMeshCreator object to the mesh storage.

Soon I'll start to implement scene manager nodes.