Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2005, 1:06:09 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/ll2trunktemp: now WorldEntity loads model property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/ll2trunktemp/src/world_entities/world_entity.cc

    r3832 r4002  
    3838   class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
    3939*/
    40 WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
     40WorldEntity::WorldEntity ()
    4141{
    4242  this->setClassName ("WorldEntity");
     
    4646}
    4747
     48WorldEntity::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
    4886/**
    4987   \brief standard destructor
     
    73111{}
    74112
    75 
    76 /**
    77    \brief query whether the WorldEntity in question is free
    78    \return true if the WorldEntity is free or false if it isn't
    79 */
    80 bool WorldEntity::isFree ()
    81 {
    82   return bFree;
    83 }
    84113
    85114/**
Note: See TracChangeset for help on using the changeset viewer.