Changeset 6424 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Jan 7, 2006, 11:07:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r6341 r6424 35 35 ->defaultValues(2, "models/ships/fighter.obj", 1.0); 36 36 37 SHELL_COMMAND(debugEntity, WorldEntity, debugWE); 37 38 38 39 /** … … 48 49 49 50 this->obbTree = NULL; 51 52 this->md2TextureFileName = NULL; 50 53 51 54 if (root != NULL) … … 105 108 void WorldEntity::loadModel(const char* fileName, float scaling, unsigned int modelNumber) 106 109 { 110 this->scaling = scaling; 107 111 if ( fileName != NULL && strcmp(fileName, "") ) 108 112 { … … 123 127 return; 124 128 } 125 129 if (scaling == 0.0) 130 { 131 scaling = 1.0; 132 PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1\n"); 133 } 126 134 if(strstr(fileName, ".obj")) 127 135 { … … 343 351 } 344 352 353 354 /** 355 * Debug the WorldEntity 356 */ 357 void WorldEntity::debugEntity() const 358 { 359 PRINT(0)("WorldEntity %s::%s (DEBUG)\n", this->getClassName(), this->getName()); 360 this->debugNode(); 361 PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size()); 362 for (unsigned int i = 0; i < this->models.size(); i++) 363 { 364 if (models[i] != NULL) 365 PRINT(0)(" : %d:%s", i, this->models[i]->getName()); 366 } 367 PRINT(0)("\n"); 368 369 } 370 371 345 372 /** 346 373 * Writes data from network containing information about the state … … 359 386 SYNCHELP_READ_FLOAT( scaling ); 360 387 //check if modelFileName is relative to datadir or absolute 361 if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) ) 362 { 363 loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling ); 364 } 365 else 366 { 367 loadModel( modelFileName, scaling ); 388 389 if ( strcmp(modelFileName, "") ) 390 { 391 392 if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) ) 393 { 394 loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling ); 395 } 396 else 397 { 398 loadModel( modelFileName, scaling ); 399 } 368 400 } 369 401 delete[] modelFileName; 402 403 SYNCHELP_READ_STRINGM( modelFileName ); 404 if ( strcmp(modelFileName, "") ) 405 this->md2TextureFileName = modelFileName; 370 406 371 407 return SYNCHELP_READ_N; … … 386 422 SYNCHELP_WRITE_STRING( getModel( 0 )->getName() ); 387 423 SYNCHELP_WRITE_FLOAT( scaling ); 424 if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") ) 425 { 426 SYNCHELP_WRITE_STRING(this->md2TextureFileName); 427 } 428 else 429 { 430 SYNCHELP_WRITE_STRING(""); 431 } 432 388 433 return SYNCHELP_WRITE_N; 389 434 }
Note: See TracChangeset
for help on using the changeset viewer.