Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/Scene.cc

    r10727 r11054  
    6666        this->bShadows_ = true;
    6767        this->bDebugDrawPhysics_ = false;
    68         this->debugDrawer_ = NULL;
     68        this->debugDrawer_ = nullptr;
    6969        this->soundReferenceDistance_ = 20.0;
    7070        this->bIsUpdatingPhysics_ = false;
     
    8484            this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
    8585
    86             this->radar_ = 0;
     86            this->radar_ = nullptr;
    8787        }
    8888
     
    9292        this->positiveWorldRange_ = Vector3::UNIT_SCALE *  defaultMaxWorldSize;
    9393        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;
    9999
    100100        this->registerVariables();
     
    220220        {
    221221            // 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_)
    224223            {
    225                 this->physicalWorld_->removeRigidBody((*it)->physicalBody_);
    226                 this->physicalObjectQueue_.insert(*it);
     224                this->physicalWorld_->removeRigidBody(object->physicalBody_);
     225                this->physicalObjectQueue_.insert(object);
    227226            }
    228227            this->physicalObjects_.clear();
     
    234233            delete this->collisionConfig_;
    235234            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;
    241240        }
    242241    }
     
    256255            {
    257256                // 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_)
    260258                {
    261                     this->physicalWorld_->addRigidBody((*it)->physicalBody_);
    262                     this->physicalObjects_.insert(*it);
     259                    this->physicalWorld_->addRigidBody(object->physicalBody_);
     260                    this->physicalObjects_.insert(object);
    263261                }
    264262                this->physicalObjectQueue_.clear();
     
    321319    {
    322320        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_)
    324322        {
    325323            if (i == index)
    326                 return (*it);
     324                return object;
    327325            ++i;
    328326        }
    329         return 0;
     327        return nullptr;
    330328    }
    331329
     
    391389    /*static*/ void Scene::consoleCommand_debugDrawPhysics(bool bDraw, bool bFill, float fillAlpha)
    392390    {
    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);
    395393    }
    396394}
Note: See TracChangeset for help on using the changeset viewer.