- Timestamp:
- Jan 6, 2007, 5:03:27 PM (18 years ago)
- Location:
- branches/mount_points/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/lib/graphics/importer/model.h
r10182 r10184 55 55 typedef struct 56 56 { 57 std::string name; //!< the name of the mount point 57 58 Vector up; //!< the up vector 58 59 Vector forward; //!< the forward vector … … 100 101 inline const mpList& getMountPoints() const { return this->mountPoints; } 101 102 /** adds a mounting point to the model @param up up vector @param forward forward vector @param center center vector */ 102 inline void addMountPoint( Vector up, Vector forward, Vector center)103 { mountPointSkeleton mps; mps.up = up; mps.forward = forward; mps.center = center; }103 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 105 105 106 -
branches/mount_points/src/lib/graphics/importer/static_model.cc
r10183 r10184 197 197 198 198 // now add the mount point 199 this->addMountPoint( up, forward, center );199 this->addMountPoint( up, forward, center, groupName); 200 200 } 201 201 } -
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.