Changeset 4277 in orxonox.OLD
- Timestamp:
- May 24, 2005, 11:23:12 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/md2Model.cc
r4276 r4277 21 21 22 22 #include <fstream> 23 #include <string> 24 #include <vector> 23 25 24 26 25 … … 83 82 this->numGLCommands = 0; 84 83 85 this->textureID = 0;86 84 this->scaleFactor = 1.0f; 87 85 -
orxonox/trunk/src/lib/graphics/importer/md2Model.h
r4276 r4277 146 146 147 147 148 149 //! This is a MD2 Model class 150 class MD2Model : public AbstractModel { 151 152 public: 153 MD2Model(); 154 virtual ~MD2Model(); 155 156 bool loadModel(const char* filename); 157 bool loadSkin(const char* filename); 158 159 void drawFrame(int frame); 160 void draw(); 161 void draw2(); 162 163 void setAnim(int type); 164 void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;} 165 166 void tick(float dtS); 167 void debug(); 168 169 170 private: 171 void animate(); 172 void processLighting(); 173 void interpolate(sVec3D* verticesList); 174 void renderFrame(); 175 148 //! class to store the md2 data in 149 class MD2Data 150 { 176 151 public: 177 /* these variables are static, because they are all the same for every model */178 static sVec3D anorms[NUM_VERTEX_NORMALS];179 static float anormsDots[SHADEDOT_QUANT][256]; 180 static sAnim animationList[21];181 182 private: 152 MD2Data(); 153 virtual ~MD2Data(); 154 155 bool loadModel(const char* fileName); 156 bool loadSkin(const char* fileName); 157 183 158 int numFrames; 184 159 int numVertices; … … 194 169 glCommandVertex* pGLCommands2; 195 170 196 unsigned int textureID; 171 Material* material; 172 float scaleFactor; 173 }; 174 175 176 //! This is a MD2 Model class 177 class MD2Model : public AbstractModel { 178 179 public: 180 MD2Model(); 181 virtual ~MD2Model(); 182 183 bool loadModel(const char* filename); 184 bool loadSkin(const char* filename); 185 186 void drawFrame(int frame); 187 void draw(); 188 void draw2(); 189 190 void setAnim(int type); 191 void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;} 192 193 void tick(float dtS); 194 void debug(); 195 196 197 private: 198 void animate(); 199 void processLighting(); 200 void interpolate(sVec3D* verticesList); 201 void renderFrame(); 202 203 public: 204 /* these variables are static, because they are all the same for every model */ 205 static sVec3D anorms[NUM_VERTEX_NORMALS]; 206 static float anormsDots[SHADEDOT_QUANT][256]; 207 static sAnim animationList[21]; 208 209 private: 210 MD2Data* data; 211 212 int numFrames; 213 int numVertices; 214 int numTriangles; 215 int numGLCommands; 216 char* fileName; 217 char* skinFileName; 218 tMd2Header* header; 219 220 sVec3D* pVertices; 221 int* pGLCommands; 222 int* pLightNormals; 223 glCommandVertex* pGLCommands2; 224 197 225 Material* material; 198 226 sAnimState animationState;
Note: See TracChangeset
for help on using the changeset viewer.