Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2005, 11:08:33 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: cleaned out the md2 model class, there is now only one model again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/md2Model.h

    r4245 r4276  
    140140
    141141
     142
     143/* forward definitions */
     144class Material;
     145
     146
     147
     148
    142149//! This is a MD2 Model class
    143150class MD2Model : public AbstractModel {
     
    146153  MD2Model();
    147154  virtual ~MD2Model();
    148  
    149   bool loadModel(const char* filename);
    150   bool loadSkin(const char* filename);
    151  
    152   void drawModel(float time);
    153   void drawFrame(int frame);
    154   void draw();
    155  
    156   void setAnim(int type);
    157   void scaleModel(float s);
    158 
    159   void tick(float dtS);
    160 
    161   void animate(/*float time*/);
    162 private:
    163   void processLightning();
    164   void interpolate(CVector3* vertlist);
    165   void renderFrame();
    166   float getCurrentTime(t3DModel *pModel, int nextFrame);
    167 
    168   t3DModel* model;
    169   float localTime;
    170 };
    171 
    172 /* forward definitions */
    173 class Material;
    174 
    175 
    176 //! A class that handles all of the loading code
    177 class MD2Loader : public BaseObject {
    178 
    179 public:
    180   MD2Loader();
    181   virtual ~MD2Loader();
    182  
    183   bool importMD2(t3DModel *pModel, char *fileName, char *texture = NULL);
    184 
    185 private:
    186   void readMD2Data();
    187   void parseAnimations(t3DModel *pModel);
    188   void convertDataStructures(t3DModel *pModel);
    189   void computeNormals(t3DModel *pModel);
    190   void cleanUp();
    191  
    192   FILE *pFile; 
    193   tMd2Header header;                          //!< The header data
    194   tMd2Skin *pSkins;                           //!< The skin data
    195   tMd2TexCoord *pTexCoords;                   //!< The texture coordinates
    196   tMd2Face *pTriangles;                       //!< Face index information
    197   tMd2Frame *pFrames;                         //!< The frames of animation (vertices)
    198 };
    199 
    200 
    201 //! This is a MD2 Model class
    202 class MD2Model2 : public AbstractModel {
    203 
    204 public:
    205   MD2Model2();
    206   virtual ~MD2Model2();
    207155 
    208156  bool loadModel(const char* filename);
     
    238186  int numGLCommands;
    239187  char* fileName;
     188  char* skinFileName;
    240189  tMd2Header* header;
    241190
Note: See TracChangeset for help on using the changeset viewer.