Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10185 in orxonox.OLD


Ignore:
Timestamp:
Jan 6, 2007, 5:41:12 PM (17 years ago)
Author:
patrick
Message:

some more properties of the mount point

Location:
branches/mount_points/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/lib/graphics/importer/model.h

    r10184 r10185  
    102102    /** adds a mounting point to the model @param up up vector @param forward forward vector @param center center vector */
    103103    inline void addMountPoint(const Vector& up, const Vector& forward, const Vector& center, const std::string& name)
    104     { mountPointSkeleton mps; mps.up = up; mps.forward = forward; mps.center = center; mps.name = name; }
     104    { mountPointSkeleton mps; mps.up = up; mps.forward = forward; mps.center = center; mps.name = name; this->mountPoints.push_back(mps); }
    105105
    106106
  • branches/mount_points/src/world_entities/mount_point.cc

    r10184 r10185  
    3636{
    3737
    38   this->name = name;
     38  this->_name = name;
    3939  this->setAbsCoor( center);
    4040  this->setAbsDir( Quaternion(forward, up));
  • branches/mount_points/src/world_entities/world_entity.cc

    r10184 r10185  
    204204      StaticModel* model = new StaticModel();
    205205      *model = ResourceOBJ(fileName, this->scaling);
     206
     207      // check if ther is a valid model and load other stuff
    206208      if (model->getVertexCount() > 0)
    207209      {
    208210        this->setModel(model, modelNumber);
    209211        if( modelNumber == 0)
     212        {
    210213          this->buildObbTree(obbTreeDepth);
    211214
    212         // now get the object information file for this model, if any
    213         std::string oifName = fileName.substr(0, fileName.length() - 4) + ".oif";
    214         this->loadMountPoints( oifName);
     215          // now get the object information file for this model, if any
     216          std::string oifName = fileName.substr(0, fileName.length() - 4) + ".oif";
     217          this->loadMountPoints( oifName);
     218        }
    215219      }
    216220      else
     
    271275void WorldEntity::loadMountPoints(const std::string& fileName)
    272276{
    273   PRINTF(4)("loading the oif File: %s\n", fileName.c_str());
     277  PRINTF(0)("loading the oif File: %s\n", fileName.c_str());
     278
    274279
    275280  // first get all mount points from the model
    276   std::list<mountPointSkeleton> mpList = this->models[0]->getMountPoints();
    277 
     281  std::list<mountPointSkeleton> mpList = this->getModel(0)->getMountPoints();
    278282  // for each skeleton create a mounting point world entity
    279283  std::list<mountPointSkeleton>::const_iterator it = mpList.begin();
     284
    280285  for( ; it != mpList.end(); it++)
    281286  {
    282287    MountPoint* mp = new MountPoint((*it).up, (*it).forward, (*it).center, (*it).name);
    283288
    284     this->mountPoints.push_back(mp);
     289    std::string nrStr = (*it).name.substr(1, 2);;
     290
     291    PRINTF(0)("got mp nr: %s\n", nrStr.c_str());
     292
     293    this->addMountPoint(mp);
    285294  }
    286295
    287296  // now load the object information file
    288297  this->oiFile = new ObjectInformationFile(fileName);
     298
    289299
    290300
Note: See TracChangeset for help on using the changeset viewer.