Changeset 10821 for code/branches/cpp11_v2/src/orxonox/Scene.cc
- Timestamp:
- Nov 21, 2015, 7:05:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/Scene.cc
r10768 r10821 220 220 { 221 221 // Remove all WorldEntities and shove them to the queue since they would still like to be in a physical world. 222 for (std::set<WorldEntity*>::const_iterator it = this->physicalObjects_.begin(); 223 it != this->physicalObjects_.end(); ++it) 222 for (const auto & elem : this->physicalObjects_) 224 223 { 225 this->physicalWorld_->removeRigidBody(( *it)->physicalBody_);226 this->physicalObjectQueue_.insert( *it);224 this->physicalWorld_->removeRigidBody((elem)->physicalBody_); 225 this->physicalObjectQueue_.insert(elem); 227 226 } 228 227 this->physicalObjects_.clear(); … … 256 255 { 257 256 // Add all scheduled WorldEntities 258 for (std::set<WorldEntity*>::const_iterator it = this->physicalObjectQueue_.begin(); 259 it != this->physicalObjectQueue_.end(); ++it) 257 for (const auto & elem : this->physicalObjectQueue_) 260 258 { 261 this->physicalWorld_->addRigidBody(( *it)->physicalBody_);262 this->physicalObjects_.insert( *it);259 this->physicalWorld_->addRigidBody((elem)->physicalBody_); 260 this->physicalObjects_.insert(elem); 263 261 } 264 262 this->physicalObjectQueue_.clear(); … … 321 319 { 322 320 unsigned int i = 0; 323 for ( std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)321 for (const auto & elem : this->objects_) 324 322 { 325 323 if (i == index) 326 return ( *it);324 return (elem); 327 325 ++i; 328 326 }
Note: See TracChangeset
for help on using the changeset viewer.