Changeset 11054 for code/branches/cpp11_v3/src/orxonox/Scene.cc
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/orxonox/Scene.cc
r10727 r11054 66 66 this->bShadows_ = true; 67 67 this->bDebugDrawPhysics_ = false; 68 this->debugDrawer_ = NULL;68 this->debugDrawer_ = nullptr; 69 69 this->soundReferenceDistance_ = 20.0; 70 70 this->bIsUpdatingPhysics_ = false; … … 84 84 this->rootSceneNode_ = this->sceneManager_->getRootSceneNode(); 85 85 86 this->radar_ = 0;86 this->radar_ = nullptr; 87 87 } 88 88 … … 92 92 this->positiveWorldRange_ = Vector3::UNIT_SCALE * defaultMaxWorldSize; 93 93 this->gravity_ = Vector3::ZERO; 94 this->physicalWorld_ = 0;95 this->solver_ = 0;96 this->dispatcher_ = 0;97 this->collisionConfig_ = 0;98 this->broadphase_ = 0;94 this->physicalWorld_ = nullptr; 95 this->solver_ = nullptr; 96 this->dispatcher_ = nullptr; 97 this->collisionConfig_ = nullptr; 98 this->broadphase_ = nullptr; 99 99 100 100 this->registerVariables(); … … 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 (WorldEntity* object : this->physicalObjects_) 224 223 { 225 this->physicalWorld_->removeRigidBody( (*it)->physicalBody_);226 this->physicalObjectQueue_.insert( *it);224 this->physicalWorld_->removeRigidBody(object->physicalBody_); 225 this->physicalObjectQueue_.insert(object); 227 226 } 228 227 this->physicalObjects_.clear(); … … 234 233 delete this->collisionConfig_; 235 234 delete this->broadphase_; 236 this->physicalWorld_ = 0;237 this->solver_ = 0;238 this->dispatcher_ = 0;239 this->collisionConfig_ = 0;240 this->broadphase_ = 0;235 this->physicalWorld_ = nullptr; 236 this->solver_ = nullptr; 237 this->dispatcher_ = nullptr; 238 this->collisionConfig_ = nullptr; 239 this->broadphase_ = nullptr; 241 240 } 242 241 } … … 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 (WorldEntity* object : this->physicalObjectQueue_) 260 258 { 261 this->physicalWorld_->addRigidBody( (*it)->physicalBody_);262 this->physicalObjects_.insert( *it);259 this->physicalWorld_->addRigidBody(object->physicalBody_); 260 this->physicalObjects_.insert(object); 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 (BaseObject* object : this->objects_) 324 322 { 325 323 if (i == index) 326 return (*it);324 return object; 327 325 ++i; 328 326 } 329 return 0;327 return nullptr; 330 328 } 331 329 … … 391 389 /*static*/ void Scene::consoleCommand_debugDrawPhysics(bool bDraw, bool bFill, float fillAlpha) 392 390 { 393 for ( ObjectListIterator<Scene> it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it)394 it->setDebugDrawPhysics(bDraw, bFill, fillAlpha);391 for (Scene* scene : ObjectList<Scene>()) 392 scene->setDebugDrawPhysics(bDraw, bFill, fillAlpha); 395 393 } 396 394 }
Note: See TracChangeset
for help on using the changeset viewer.