home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 March / ENTER.ISO / files / fwp-0.0.6-win32-installer.exe / Model.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-06  |  925 b   |  48 lines

  1. #ifndef __Model_h__
  2. #define __Model_h__
  3.  
  4. #include "Mesh.h"
  5. #include "vectormath.h"
  6.  
  7.  
  8. class Model{
  9. public:
  10.     char* name;
  11.  
  12.     Mesh** meshes;
  13.     int numMeshes;
  14.     Material** materials;
  15.     int numMaterials;
  16.  
  17.     GLfloat*** matrices;
  18.     int numKeyframes;
  19.  
  20.     Model(const char* filename);
  21. //    Model(const char* filename, bool generateMatrices=true, bool setupLights=false);
  22.     ~Model();
  23.     int addMesh(Mesh* mesh);
  24.     int addMatrix(int frame, int id, GLfloat mat[16]);
  25.     int getMeshId(Mesh* mesh);
  26.  
  27.     void dump();
  28.  
  29.     float bSphereRadius;
  30.     vec3_t min, max;
  31.  
  32.     void calcBSphere();
  33.     void calcAABB();
  34.  
  35. protected:
  36.     void clearModel();
  37. //    void loadModel(const char* filename, bool generateMatrices=true, bool setupLights=false);
  38.     bool readFromFile(File* f);
  39.     bool readMaterialList(File* f);
  40.     bool readMeshList(File* f);
  41.     bool readKeyframeList(File* f);
  42.     GLfloat** readKeyframe(File* f);
  43. };
  44.  
  45.  
  46.  
  47. #endif    /* __Model_h__ */
  48.