home *** CD-ROM | disk | FTP | other *** search
- #ifndef __Model_h__
- #define __Model_h__
-
- #include "Mesh.h"
- #include "vectormath.h"
-
-
- class Model{
- public:
- char* name;
-
- Mesh** meshes;
- int numMeshes;
- Material** materials;
- int numMaterials;
-
- GLfloat*** matrices;
- int numKeyframes;
-
- Model(const char* filename);
- // Model(const char* filename, bool generateMatrices=true, bool setupLights=false);
- ~Model();
- int addMesh(Mesh* mesh);
- int addMatrix(int frame, int id, GLfloat mat[16]);
- int getMeshId(Mesh* mesh);
-
- void dump();
-
- float bSphereRadius;
- vec3_t min, max;
-
- void calcBSphere();
- void calcAABB();
-
- protected:
- void clearModel();
- // void loadModel(const char* filename, bool generateMatrices=true, bool setupLights=false);
- bool readFromFile(File* f);
- bool readMaterialList(File* f);
- bool readMeshList(File* f);
- bool readKeyframeList(File* f);
- GLfloat** readKeyframe(File* f);
- };
-
-
-
- #endif /* __Model_h__ */
-