Changeset 10114 in orxonox.OLD for trunk/src/lib/graphics/importer/md2
- Timestamp:
- Dec 19, 2006, 11:55:26 PM (18 years ago)
- Location:
- trunk/src/lib/graphics/importer/md2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/md2/md2Model.cc
r9869 r10114 92 92 rebuildInfo(); 93 93 94 //this->debug();94 this->debug(); 95 95 } 96 96 … … 99 99 { 100 100 this->init(); 101 102 this->scaleFactor = model.scaleFactor; 103 101 104 this->rebuildInfo(); 102 105 } … … 104 107 MD2Model& MD2Model::operator=(const MD2Model& md2model) 105 108 { 109 this->init(); 110 this->scaleFactor = md2model.scaleFactor; 106 111 this->data = md2model.data; 107 112 this->rebuildInfo(); … … 141 146 this->data = MD2Data::Pointer(new MD2Data(modelFileName, skinFileName, scale)); 142 147 this->rebuildInfo(); 148 149 // init the animation - do not remove 150 this->tick( 0.01); 151 152 return true; 143 153 } 144 154 … … 268 278 /** 269 279 * @brief draws the model: interface for all other classes out in the world 270 * @todo make it const and virtual271 * FIXME272 280 */ 273 281 void MD2Model::draw() const … … 313 321 glNormal3fv(anorms[this->data->pLightNormals[pCommands[2]]]); 314 322 glVertex3fv(this->verticesList[pCommands[2]]); 323 // printf("vertex: %f, %f, %f\n", this->verticesList[pCommands[2]][0], this->verticesList[pCommands[2]][1], this->verticesList[pCommands[2]][2]); 315 324 } 316 325 glEnd(); … … 325 334 { 326 335 //static sVec3D this->verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 327 int* pCommands = this->data->pGLCommands;336 // int* pCommands = this->data->pGLCommands; 328 337 /* some face culling stuff */ 329 338 // glPushAttrib(GL_POLYGON_BIT); … … 428 437 PRINT(0)("= Number of Frames: \t%i\n", this->data->header->numFrames); 429 438 PRINT(0)("= Height, Width:\t%i, %i\n", this->data->header->skinHeight, this->data->header->skinWidth); 430 //PRINT(0)("= Pointer to the data object: %p\n", this->data); 439 PRINT(0)("= DATA:\n"); 440 PRINT(0)("= Number of references to data: %i\n", this->data.count()); 431 441 PRINT(0)("===================================================\n\n"); 432 442 } … … 452 462 this->loadModel(modelFileName); 453 463 this->loadSkin(skinFileName); 464 465 PRINTF(0)("model %s, skin %s\n", modelFileName.c_str(), skinFileName.c_str()); 454 466 } 455 467 … … 570 582 delete [] buffer; 571 583 fclose(pFile); 584 585 return true; 572 586 } 573 587 … … 592 606 this->material.setIllum(3); 593 607 this->material.setAmbient(1.0, 1.0, 1.0); 594 } 608 609 return true; 610 } -
trunk/src/lib/graphics/importer/md2/resource_md2.cc
r9869 r10114 20 20 PRINTF(0)("NOT FOUND MD2: %s\n", modelName.c_str()); 21 21 std::string modelFileName = this->Resource::locateFile(modelName); 22 //std::string skinFileName = this->Resource::locateFile(skinName); 22 std::string skinFileName = this->Resource::locateFile(skinName); 23 PRINTF(0)("NEW %s::%s\n", modelName.c_str(), modelFileName.c_str()); 23 24 this->MD2Model::load(modelFileName, skinName, scale); 24 this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skin Name, scale), keepLevel, this->MD2Model::dataPointer()));25 this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinFileName, scale), keepLevel, this->MD2Model::dataPointer())); 25 26 } 26 27
Note: See TracChangeset
for help on using the changeset viewer.