Changeset 10184 in orxonox.OLD for branches/mount_points/src/world_entities
- Timestamp:
- Jan 6, 2007, 5:03:27 PM (18 years ago)
- Location:
- branches/mount_points/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/world_entities/mount_point.cc
r10147 r10184 33 33 * construct 34 34 */ 35 MountPoint::MountPoint ( )35 MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name) 36 36 { 37 38 this->name = name; 39 this->setAbsCoor( center); 40 this->setAbsDir( Quaternion(forward, up)); 41 37 42 this->init(); 38 43 } -
branches/mount_points/src/world_entities/mount_point.h
r10147 r10184 12 12 13 13 public: 14 MountPoint ( );14 MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name); 15 15 MountPoint(const TiXmlElement* root); 16 16 virtual ~MountPoint (); … … 32 32 private: 33 33 WorldEntity* _mount; //!< the entity mounted at this mount point 34 std::string _name; //!< the name of the mount point 34 35 35 36 }; -
branches/mount_points/src/world_entities/world_entity.cc
r10147 r10184 207 207 { 208 208 this->setModel(model, modelNumber); 209 if( modelNumber == 0 /* FIXME && !this->isA(CL_WEAPON) */)209 if( modelNumber == 0) 210 210 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); 211 215 } 212 216 else 213 217 delete model; 214 215 // now get the object information file for this model, if any216 std::string oifName = fileName.substr(0, fileName.length() - 4) + ".oif";217 this->loadObjectInformationFile( oifName);218 218 } 219 219 /// LOADING AN MD2-model … … 269 269 * @param fileName the name of the file 270 270 */ 271 void WorldEntity::load ObjectInformationFile(const std::string& fileName)271 void WorldEntity::loadMountPoints(const std::string& fileName) 272 272 { 273 273 PRINTF(4)("loading the oif File: %s\n", fileName.c_str()); 274 274 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 275 288 this->oiFile = new ObjectInformationFile(fileName); 289 290 291 276 292 } 277 293 -
branches/mount_points/src/world_entities/world_entity.h
r10147 r10184 53 53 Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; }; 54 54 55 void load ObjectInformationFile(const std::string& fileName);55 void loadMountPoints(const std::string& fileName); 56 56 inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; } 57 57
Note: See TracChangeset
for help on using the changeset viewer.