Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 6, 2007, 5:03:27 PM (18 years ago)
Author:
patrick
Message:

extended model again, added mounting point generation procedures now working on a nicer interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mount_points/src/world_entities/world_entity.cc

    r10147 r10184  
    207207      {
    208208        this->setModel(model, modelNumber);
    209         if( modelNumber == 0 /* FIXME && !this->isA(CL_WEAPON) */)
     209        if( modelNumber == 0)
    210210          this->buildObbTree(obbTreeDepth);
     211
     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);
    211215      }
    212216      else
    213217        delete model;
    214 
    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->loadObjectInformationFile( oifName);
    218218    }
    219219    /// LOADING AN MD2-model
     
    269269 * @param fileName the name of the file
    270270 */
    271 void WorldEntity::loadObjectInformationFile(const std::string& fileName)
     271void WorldEntity::loadMountPoints(const std::string& fileName)
    272272{
    273273  PRINTF(4)("loading the oif File: %s\n", fileName.c_str());
    274274
     275  // first get all mount points from the model
     276  std::list<mountPointSkeleton> mpList = this->models[0]->getMountPoints();
     277
     278  // for each skeleton create a mounting point world entity
     279  std::list<mountPointSkeleton>::const_iterator it = mpList.begin();
     280  for( ; it != mpList.end(); it++)
     281  {
     282    MountPoint* mp = new MountPoint((*it).up, (*it).forward, (*it).center, (*it).name);
     283
     284    this->mountPoints.push_back(mp);
     285  }
     286
     287  // now load the object information file
    275288  this->oiFile = new ObjectInformationFile(fileName);
     289
     290
     291
    276292}
    277293
Note: See TracChangeset for help on using the changeset viewer.