Changeset 4172 in orxonox.OLD for orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h
- Timestamp:
- May 13, 2005, 3:40:23 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h
r4168 r4172 25 25 26 26 //! These are the needed defines for the max values when loading .MD2 files 27 #define MD2_IDENT (('2'<<24) + ('P'<<16) + ('D'<<8) + 'I') 28 #define MD2_VERSION 8 27 29 #define MD2_MAX_TRIANGLES 4096 28 30 #define MD2_MAX_VERTICES 2048 … … 31 33 #define MD2_MAX_SKINS 32 32 34 #define MD2_MAX_FRAMESIZE (MD2_MAX_VERTICES * 4 + 128) 35 36 #define NUM_VERTEX_NORMALS 162 37 #define SHADEDOT_QUANT 16 33 38 34 39 //! This stores the speed of the animation between each key frame - currently conflicting with the animation framework … … 107 112 typedef char tMd2Skin[64]; 108 113 114 109 115 //! This is a MD2 Model class 110 116 class MD2Model : public AbstractModel { … … 137 143 }; 138 144 145 /* forward definitions */ 146 class Material; 147 148 //! This is a MD2 Model class 149 class MD2Model2 : public AbstractModel { 150 151 public: 152 MD2Model2(); 153 virtual ~MD2Model2(); 154 155 bool loadModel(const char* filename); 156 bool loadSkin(const char* filename); 157 158 void drawFrame(int frame); 159 void draw(); 160 161 void setAnim(int type); 162 void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;} 163 164 void tick(float dtS); 165 166 private: 167 void animate(float time); 168 void processLighting(); 169 void interpolate(sVec3D* verticesList); 170 void renderFrame(); 171 172 public: 173 /* these variables are static, because they are all the same for every model */ 174 static sVec3D anorms[NUM_VERTEX_NORMALS]; 175 static float anormsDots[SHADEDOT_QUANT][256]; 176 static sAnim animationList[21]; 177 178 private: 179 int numFrames; 180 int numVertices; 181 int numGLCommands; 182 183 sVec3D* pVertices; 184 int* pGLCommands; 185 int* pLightNormals; 186 187 unsigned int textureID; 188 Material* material; 189 sAnimState animationState; 190 float scaleFactor; 191 }; 192 193 139 194 //! A class that handles all of the loading code 140 195 class MD2Loader : public BaseObject {
Note: See TracChangeset
for help on using the changeset viewer.