- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r10821 r10916 65 65 { 66 66 // Delete all children 67 for (auto & elem: this->attachedShapes_)67 for (auto& mapEntry : this->attachedShapes_) 68 68 { 69 69 // make sure that the child doesn't want to detach itself --> speedup because of the missing update 70 elem.first->notifyDetached();71 elem.first->destroy();72 if (this->collisionShape_ == elem.second)70 mapEntry.first->notifyDetached(); 71 mapEntry.first->destroy(); 72 if (this->collisionShape_ == mapEntry.second) 73 73 this->collisionShape_ = nullptr; // don't destroy it twice 74 74 } … … 246 246 { 247 247 unsigned int i = 0; 248 for (const auto & elem: this->attachedShapes_)248 for (const auto& mapEntry : this->attachedShapes_) 249 249 { 250 250 if (i == index) 251 return elem.first;251 return mapEntry.first; 252 252 ++i; 253 253 } … … 266 266 std::vector<CollisionShape*> shapes; 267 267 // Iterate through all attached CollisionShapes and add them to the list of shapes. 268 for(auto & elem: this->attachedShapes_)269 shapes.push_back( elem.first);268 for(auto& mapEntry : this->attachedShapes_) 269 shapes.push_back(mapEntry.first); 270 270 271 271 // Delete the compound shape and create a new one. … … 274 274 275 275 // Re-attach all CollisionShapes. 276 for(auto shape : shapes) 277 { 278 276 for(CollisionShape* shape : shapes) 277 { 279 278 shape->setScale3D(this->getScale3D()); 280 279 // Only actually attach if we didn't pick a CompoundCollisionShape with no content.
Note: See TracChangeset
for help on using the changeset viewer.