- Timestamp:
- May 15, 2014, 3:53:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
r10055 r10058 40 40 41 41 #include "items/ShipPart.h" 42 #include "items/Engine.h" 42 43 #include "worldentities/StaticEntity.h" 43 44 #include "collisionshapes/WorldEntityCollisionShape.h" … … 230 231 /** 231 232 @brief 233 Looks for an attached ShipPart with a certain name. 234 @param name 235 The name of the ShipPart to be returned. 236 @return 237 Pointer to the ShipPart with the given name, or NULL if not found. 238 */ 239 ShipPart* ModularSpaceShip::getShipPartByName(std::string name) 240 { 241 for(std::vector<ShipPart*>::iterator it = this->partList_.begin(); it != this->partList_.end(); ++it) 242 { 243 if(orxonox_cast<ShipPart*>(*it)->getName() == name) 244 { 245 return orxonox_cast<ShipPart*>(*it); 246 } 247 } 248 orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl; 249 return NULL; 250 } 251 252 /** 253 @brief 232 254 Check whether the SpaceShip has a particular Engine. 233 255 @param engine … … 285 307 /** 286 308 @brief 309 Looks for an attached Engine with a certain name. 310 @param name 311 The name of the engine to be returned. 312 @return 313 Pointer to the engine with the given name, or NULL if not found. 314 */ 315 Engine* ModularSpaceShip::getEngineByName(std::string name) 316 { 317 for(std::vector<Engine*>::iterator it = this->engineList_.begin(); it != this->engineList_.end(); ++it) 318 { 319 if(orxonox_cast<Engine*>(*it)->getName() == name) 320 { 321 return orxonox_cast<Engine*>(*it); 322 } 323 } 324 orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl; 325 return NULL; 326 } 327 328 /** 329 @brief 287 330 Detaches a child WorldEntity from this instance. 288 331 */ … … 297 340 298 341 // collision shapes 299 orxout() << "MSS: detach()" << endl;300 342 301 343 //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0); … … 314 356 315 357 object->notifyDetached(); 316 orxout() << "MSS: detach() completed." << endl;317 358 } 318 359 }
Note: See TracChangeset
for help on using the changeset viewer.