Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10228 in orxonox.OLD for branches/mount_points/src


Ignore:
Timestamp:
Jan 10, 2007, 6:34:01 PM (18 years ago)
Author:
patrick
Message:

some more work on the mounting points. should soon be finished

Location:
branches/mount_points/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/lib/graphics/importer/oif/object_information_file.cc

    r10147 r10228  
    5757
    5858  // check basic validity
    59   TiXmlElement* root = XMLDoc.RootElement();
    60   assert( root != NULL);
     59  this->_root = XMLDoc.RootElement();
     60  assert( this->_root != NULL);
    6161
    62   if( strcmp( root->Value(), "ObjectInformationFile"))
     62  if( strcmp( this->_root->Value(), "ObjectInformationFile"))
    6363  {
    6464    // report an error
     
    6767  }
    6868
    69   // construct campaign
    70 //   return new Campaign( root);
    7169}
    7270
     
    132130
    133131
     132/**
     133 * this initializes the mount point
     134 * @param mountPoint to be initialized
     135 */
     136// void ObjectInformationFile::initMountPoint(MountPoint* mountPoint)
     137// {
     138//   TiXmlElement* root = this->data->root();
     139//
     140// }
    134141
  • branches/mount_points/src/lib/graphics/importer/oif/object_information_file.h

    r10147 r10228  
    2525  void load(const std::string& fileName);
    2626
     27  inline TiXmlElement* root() { return this->_root; }
     28
    2729
    2830private:
    29 
     31  TiXmlElement* _root;           //!< root of the xml file
    3032};
    3133
     
    4244  ObjectInformationFile& operator=(const ObjectInformationFile& oif);
    4345
     46//   void initMountPoint(MountPoint* mountPoint);
     47
    4448  private:
    4549    void init();
  • branches/mount_points/src/story_entities/game_world.cc

    r10216 r10228  
    543543  ObjectManager::EntityList::const_iterator entity;
    544544  for (entity = drawList.begin(); entity != drawList.end(); entity++)
     545  {
    545546    if ((*entity)->isVisible())
    546547      (*entity)->draw();
     548
     549    if( unlikely( this->showMPV))
     550      (*entity)->debugDrawMountPoints();
     551  }
    547552}
    548553
     
    668673    }
    669674
     675
    670676    if( unlikely(this->showPNodes))
    671677      PNode::getNullParent()->debugDraw(0);
  • branches/mount_points/src/world_entities/world_entity.cc

    r10216 r10228  
    276276void WorldEntity::loadMountPoints( Model* model, const std::string& fileName)
    277277{
    278   PRINTF(0)("loading the oif File: %s\n", fileName.c_str());
     278  PRINTF(4)("loading the oif File: %s\n", fileName.c_str());
     279
     280  // now load the object information file
     281  this->oiFile = new ObjectInformationFile(fileName);
    279282
    280283  // extract the mount points
     
    291294    // now get the number and add the mount point to the slot
    292295    std::string nrStr = (*it).name.substr(3, 2);
     296    // add the mount point
    293297    this->addMountPoint(atoi(nrStr.c_str()), mp);
    294   }
    295 
    296   // now load the object information file
    297   this->oiFile = new ObjectInformationFile(fileName);
     298
     299    // now fill the mount point
     300    this->oiFile->initMountPoint(mp);
     301  }
    298302
    299303}
     
    817821
    818822
     823
     824/**
     825 * draw the mounting points
     826 */
     827void WorldEntity::debugDrawMountPoints() const
     828{
     829
     830  std::vector<MountPoint*>::const_iterator it = this->mountPoints.begin();
     831  for( ; it < this->mountPoints.end(); it++)
     832  {
     833    if( (*it) != NULL)
     834    {
     835      (*it)->debugDraw();
     836    }
     837  }
     838}
     839
     840
    819841/**
    820842 * Debug the WorldEntity
  • branches/mount_points/src/world_entities/world_entity.h

    r10202 r10228  
    7373  virtual void tick (float time);
    7474  virtual void draw () const;
     75  void debugDrawMountPoints() const;
    7576
    7677  /* --- Collision Detection Block  --- */
Note: See TracChangeset for help on using the changeset viewer.