Changeset 11538 for code/branches/SOBv2_HS17/src
- Timestamp:
- Nov 6, 2017, 3:43:57 PM (7 years ago)
- Location:
- code/branches/SOBv2_HS17/src/modules/superorxobros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
r11535 r11538 113 113 114 114 // now, change the clothes of the Figure to red 115 std::set<WorldEntity*> attachedObjects = this->getAttachedObjects(); 116 std::set<WorldEntity*>::iterator it; 117 for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it) 118 { 119 Model* FiguresModel = orxonox_cast<Model*>(*it); 120 if (FiguresModel != nullptr) 121 { 122 std::string name = "orxo_material_gross"; 123 124 FiguresModel->setSubMaterial(name, 4); // 4 is the body 125 126 } 127 } 128 } 115 std::string name = "orxo_material_gross"; 116 this->changeClothes(name); 117 118 } 119 129 120 //Check if otherObject is a Gumba (that walking enemies) 130 121 … … 146 137 147 138 148 // now, change the clothes of the Figure to old ones 149 std::set<WorldEntity*> attachedObjects = this->getAttachedObjects(); 150 std::set<WorldEntity*>::iterator it; 151 for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it) 152 { 153 Model* FiguresModel = orxonox_cast<Model*>(*it); 154 if (FiguresModel != nullptr) 155 { 156 std::string name = "orxo_material "; 157 FiguresModel->setMaterial(name); 158 } 159 } 139 // now, change the clothes of the Figure to old ones 140 std::string name = "orxo_material"; 141 this->changeClothes(name); 160 142 gumba->destroyLater(); 161 143 gumba->hasCollided_ = true; … … 405 387 406 388 407 } 389 390 // PRE: name is an existing name of a material. Example orxo_material for orxo_material.material in data_extern/materials 391 // POST: clothes of body of player are changed to name 392 void SOBFigure::changeClothes(std::string& name){ 393 std::set<WorldEntity*> attachedObjects = this->getAttachedObjects(); 394 std::set<WorldEntity*>::iterator it; 395 for (it = attachedObjects.begin(); it != attachedObjects.end(); ++it) 396 { 397 Model* FiguresModel = orxonox_cast<Model*>(*it); 398 if (FiguresModel != nullptr) 399 { 400 401 FiguresModel->setSubMaterial(name, 4); // 4 is the body 402 403 } 404 } 405 } 406 407 } -
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.h
r11418 r11538 46 46 virtual void boost(bool boost) override; 47 47 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 48 void changeClothes(std::string& name); 48 49 49 50 bool dead_;
Note: See TracChangeset
for help on using the changeset viewer.