src/Model.h

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * Model Object Header
00003  */
00004 
00005 #if !defined ( _MODEL_H_ )
00006 #define _MODEL_H_
00007 
00008 #include <string>
00009 #include "GLee.h"
00010 
00011 struct ObjModel;
00012 struct ObjGroup;
00013 class BoundBox;
00014 class Texture;
00015 
00016 class Model {
00017  public:
00018   // This basically just loads the texture
00019   // Still need to call a loadFORMAT method
00020   Model(std::string textureName);
00021 
00022   // Do whatever cleanup is necessary
00023   ~Model();
00024 
00025   // Draws the actual model
00026   void draw();
00027 
00028   // Add all file format dependent loadFORMAT functions here
00029   // Loads a .obj file
00030   void loadObj(const char *filename, float scale);
00031 
00032   BoundBox *modelBox;
00033 
00034  private:
00035   // Starts and sets up a display list, call from all LoadFORMAT functions
00036   void startList();
00037 
00038   // Texture for model
00039   Texture *texture;
00040 
00041   // Display list to display the model
00042   // Eventually this will probably be replace by a VBO/VA
00043   GLuint displayList;
00044 
00045   // Whether the model has been loaded or not
00046   bool loaded;
00047 
00048   // Add all loadFORMAT helper functions here
00049   ObjModel* objLoad(const char *filename);
00050   void objDraw(ObjModel *model);
00051   void objFirstPass(ObjModel *model, FILE *file);
00052   ObjGroup* objAddGroup(ObjModel *model, char *name);
00053   ObjGroup* objFindGroup(ObjModel *model, char *name);
00054   void objSecondPass(ObjModel* model, FILE* file);
00055   void objScale(ObjModel* model, float scale);
00056   BoundBox* objGenerateBox(ObjModel* model);
00057 };
00058 
00059 #endif

Generated on Mon Jan 8 22:34:12 2007 for CrownandCutlass by  doxygen 1.4.7