Changeset 4002 in orxonox.OLD for orxonox/branches/ll2trunktemp/src/world_entities/world_entity.cc
- Timestamp:
- Apr 28, 2005, 1:06:09 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/ll2trunktemp/src/world_entities/world_entity.cc
r3832 r4002 38 38 class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary. 39 39 */ 40 WorldEntity::WorldEntity ( bool isFree) : bFree(isFree)40 WorldEntity::WorldEntity () 41 41 { 42 42 this->setClassName ("WorldEntity"); … … 46 46 } 47 47 48 WorldEntity::WorldEntity(TiXmlElement* root) 49 { 50 // Name Setup 51 char* temp; 52 const char* string; 53 string = grabParameter( root, "name"); 54 if( string == NULL) 55 { 56 PRINTF(0)("WorldEntity is missing a proper 'name'\n"); 57 string = "Unknown"; 58 temp = new char[strlen(string + 2)]; 59 strcpy( temp, string); 60 this->setName( temp); 61 } 62 else 63 { 64 temp = new char[strlen(string + 2)]; 65 strcpy( temp, string); 66 this->setName( temp); 67 } 68 // Model Loading 69 this->model = NULL; 70 string = grabParameter( root, "model"); 71 if( string != NULL) 72 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN); 73 else 74 { 75 PRINTF(0)("WorldEntity is missing a proper 'model'\n"); 76 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN); 77 } 78 if( this->model == NULL) 79 { 80 PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string); 81 } 82 83 this->bDraw = true; 84 } 85 48 86 /** 49 87 \brief standard destructor … … 73 111 {} 74 112 75 76 /**77 \brief query whether the WorldEntity in question is free78 \return true if the WorldEntity is free or false if it isn't79 */80 bool WorldEntity::isFree ()81 {82 return bFree;83 }84 113 85 114 /**
Note: See TracChangeset
for help on using the changeset viewer.