Changeset 10185 in orxonox.OLD
- Timestamp:
- Jan 6, 2007, 5:41:12 PM (18 years ago)
- Location:
- branches/mount_points/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mount_points/src/lib/graphics/importer/model.h
r10184 r10185 102 102 /** adds a mounting point to the model @param up up vector @param forward forward vector @param center center vector */ 103 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 { mountPointSkeleton mps; mps.up = up; mps.forward = forward; mps.center = center; mps.name = name; this->mountPoints.push_back(mps); } 105 105 106 106 -
branches/mount_points/src/world_entities/mount_point.cc
r10184 r10185 36 36 { 37 37 38 this-> name = name;38 this->_name = name; 39 39 this->setAbsCoor( center); 40 40 this->setAbsDir( Quaternion(forward, up)); -
branches/mount_points/src/world_entities/world_entity.cc
r10184 r10185 204 204 StaticModel* model = new StaticModel(); 205 205 *model = ResourceOBJ(fileName, this->scaling); 206 207 // check if ther is a valid model and load other stuff 206 208 if (model->getVertexCount() > 0) 207 209 { 208 210 this->setModel(model, modelNumber); 209 211 if( modelNumber == 0) 212 { 210 213 this->buildObbTree(obbTreeDepth); 211 214 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 } 215 219 } 216 220 else … … 271 275 void WorldEntity::loadMountPoints(const std::string& fileName) 272 276 { 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 274 279 275 280 // 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(); 278 282 // for each skeleton create a mounting point world entity 279 283 std::list<mountPointSkeleton>::const_iterator it = mpList.begin(); 284 280 285 for( ; it != mpList.end(); it++) 281 286 { 282 287 MountPoint* mp = new MountPoint((*it).up, (*it).forward, (*it).center, (*it).name); 283 288 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); 285 294 } 286 295 287 296 // now load the object information file 288 297 this->oiFile = new ObjectInformationFile(fileName); 298 289 299 290 300
Note: See TracChangeset
for help on using the changeset viewer.