Changeset 6191 in orxonox.OLD for branches/christmas_branche
- Timestamp:
- Dec 20, 2005, 3:24:14 PM (19 years ago)
- Location:
- branches/christmas_branche/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/christmas_branche/src/lib/graphics/importer/md2Model.cc
r6188 r6191 121 121 currVec = &this->data->pVertices[this->data->numVertices * this->animationState.currentFrame]; 122 122 nextVec = &this->data->pVertices[this->data->numVertices * this->animationState.nextFrame]; 123 PRINTF(0)("current frame nr %i, next frame nr %i\n", this->animationState.currentFrame, this->animationState.nextFrame);124 125 123 126 124 for( int i = 0; i < this->data->numVertices; ++i) … … 215 213 } 216 214 217 218 215 for(; i > 0; i--, pCommands += 3) /* down counting for loop, next 3 gl commands */ 219 216 { … … 242 239 // glEnable(GL_CULL_FACE); 243 240 // glCullFace(GL_BACK); 244 241 // 245 242 // this->processLighting(); 246 243 // this->interpolate(/*verticesList*/); … … 352 349 this->numTexCoor = 0; 353 350 354 this->scaleFactor = 1.0f;355 //this->scaleFactor = 0.2f;351 // this->scaleFactor = 1.0f; 352 this->scaleFactor = 0.2f; 356 353 357 354 this->fileName = NULL; … … 448 445 for(int i = 0; i < this->numFrames; ++i) 449 446 { 450 printf("==============vertex loading for frame %i/%i========\n", i, this->numFrames);451 447 frame = (sFrame*)(buffer + this->header->frameSize * i); 452 448 pVertex = this->pVertices + this->numVertices * i; … … 460 456 pVertex[j][2] = (-1.0 * (frame->pVertices[j].v[1] * frame->scale[1] + frame->translate[1])) * this->scaleFactor; 461 457 462 // pVertex[j][0] = ((frame->pVertices[j].v[0] /** frame->scale[0]*/ )/* + frame->translate[0]*/ ); 463 // pVertex[j][2] = (-1.0f * (frame->pVertices[j].v[2] /** frame->scale[2]*/) /*+ frame->translate[2]*/); 464 // pVertex[j][1] = ((frame->pVertices[j].v[1] /** frame->scale[1]*/ /*+ frame->translate[1]*/)); 465 466 467 printf("vertex %i/%i: (%f, %f, %f)\n", j, this->numVertices, pVertex[j][0], pVertex[j][1], pVertex[j][2]); 458 //printf("vertex %i/%i: (%f, %f, %f)\n", j, this->numVertices, pVertex[j][0], pVertex[j][1], pVertex[j][2]); 468 459 469 460 pNormals[j] = frame->pVertices[j].lightNormalIndex; -
branches/christmas_branche/src/lib/graphics/importer/md2Model.h
r6188 r6191 69 69 typedef struct 70 70 { 71 unsigned char 71 unsigned char v[3]; //!< the vector of the vertex 72 72 unsigned char lightNormalIndex; //!< the index of the light normal 73 73 } sVertex; -
branches/christmas_branche/src/subprojects/importer/importer.cc
r6184 r6191 45 45 obj = new OBJModel (argv[1], atof(argv[2])); 46 46 else if( strstr(argv[1], ".md2") != NULL) 47 { 47 48 obj = new MD2Model(argv[1], argv[2]); 49 ((MD2Model*)obj)->tick(0.1f); 50 } 48 51 } 49 52 else if (argc>=2) … … 51 54 if( strstr(argv[1], ".obj") != NULL) 52 55 obj = new OBJModel(argv[1]); 53 else if( strstr(argv[1], ".md2") != NULL) 56 else if( strstr(argv[1], ".md2") != NULL) { 54 57 obj = new MD2Model(argv[1], "fake_texture.bad"); 58 obj = new MD2Model(argv[1], argv[2]); 59 ((MD2Model*)obj)->tick(0.1f); 60 } 55 61 } 56 62 else -
branches/christmas_branche/src/world_entities/world_entity.cc
r6187 r6191 85 85 static_cast<PNode*>(this)->loadParams(root); 86 86 87 LoadParam(root, "md2texture", this, WorldEntity, loadMD2Texture) 88 .describe("the fileName of the texture, that should be loaded onto this world-entity. (must be relative to the data-dir)") 89 .defaultValues(1, NULL); 90 87 91 // Model Loading 88 92 LoadParam(root, "model", this, WorldEntity, loadModel) 89 93 .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)") 90 94 .defaultValues(3, NULL, 1.0f, 0); 91 92 } 95 } 96 93 97 94 98 /** … … 135 139 PRINTF(4)("fetching MD2 file: %s\n", fileName); 136 140 // MD2Model* m = (MD2Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN); 137 Model* m = new MD2Model(fileName, "md2_fake_texture.bad");141 Model* m = new MD2Model(fileName, this->md2TextureFileName); 138 142 //this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0); 139 143 this->setModel(m, 0); -
branches/christmas_branche/src/world_entities/world_entity.h
r6179 r6191 36 36 void setModel(Model* model, unsigned int modelNumber = 0); 37 37 Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; }; 38 39 inline void loadMD2Texture(const char* fileName) { this->md2TextureFileName = fileName; } 38 40 39 41 bool buildObbTree(unsigned int depth); … … 79 81 private: 80 82 std::vector<Model*> models; //!< The model that should be loaded for this entity. 83 const char* md2TextureFileName; //!< the file name of the md2 model texture, only if this 81 84 BVTree* obbTree; //!< this is the obb tree reference needed for collision detection 82 85
Note: See TracChangeset
for help on using the changeset viewer.