Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/weapons/projectiles/BasicProjectile.cc

    r11052 r11071  
    8888                                    // The projectile is destroyed by its tick()-function (in the following tick).
    8989
    90             Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is NULL
     90            Pawn* victim = orxonox_cast<Pawn*>(otherObject); // If otherObject isn't a Pawn, then victim is nullptr
    9191
    9292            WorldEntity* entity = orxonox_cast<WorldEntity*>(this);
     
    146146    bool BasicProjectile::isObjectRelatedToShooter(WorldEntity* otherObject)
    147147    {
    148         for (WorldEntity* shooter = this->getShooter(); shooter != NULL; shooter = shooter->getParent())
     148        for (WorldEntity* shooter = this->getShooter(); shooter != nullptr; shooter = shooter->getParent())
    149149            if (otherObject == shooter)
    150150                return true;
    151         for (WorldEntity* object = otherObject; object != NULL; object = object->getParent())
     151        for (WorldEntity* object = otherObject; object != nullptr; object = object->getParent())
    152152            if (otherObject == this->getShooter())
    153153                return true;
  • code/trunk/src/modules/weapons/projectiles/BillboardProjectile.h

    r10629 r11071  
    6161            virtual void setMaterial(const std::string& material);
    6262            virtual const std::string& getMaterial();
    63             virtual void changedVisibility();
     63            virtual void changedVisibility() override;
    6464
    6565        private:
  • code/trunk/src/modules/weapons/projectiles/GravityBomb.cc

    r10622 r11071  
    2828                this->timeToLife_= LIFETIME;
    2929                this->setCollisionResponse(false);
    30                 this->setCollisionType(WorldEntity::Dynamic);
     30                this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    3131                this->enableCollisionCallback();
    3232
  • code/trunk/src/modules/weapons/projectiles/GravityBomb.h

    r10622 r11071  
    4141            GravityBomb(Context* context);
    4242            virtual ~GravityBomb();
    43             virtual void tick(float dt);
     43            virtual void tick(float dt) override;
    4444
    45             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     45            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    4646            void detonate();
    4747        private:
  • code/trunk/src/modules/weapons/projectiles/GravityBombField.cc

    r11052 r11071  
    4141        //Make the Field visible on Radar and minimap.
    4242        this->setRadarObjectColour(ColourValue(1.0, 0.0, 0.2,1)); // Red
    43         this->setRadarObjectShape(RadarViewable::Dot);
     43        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    4444        this->setRadarObjectScale(1.0f);
    4545       
     
    125125
    126126            //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once.
    127             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     127            for (Pawn* pawn : ObjectList<Pawn>())
    128128            {
    129                 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
     129                Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
    130130                 //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl;
    131131                if(distanceVector.length()< forceSphereRadius_)
    132132                {
    133133                    //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length();
    134                     if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),*it) == victimsAlreadyDamaged_.end())
     134                    if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),pawn) == victimsAlreadyDamaged_.end())
    135135                    {
    136136                        //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl;
    137137                        float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS);
    138138                        //orxout(debug_output) << "Damage: " << damage << endl;
    139                         it->hit(shooter_, it->getWorldPosition(), NULL, damage, 0,0);
    140                         victimsAlreadyDamaged_.push_back(*it);
     139                        pawn->hit(shooter_, pawn->getWorldPosition(), nullptr, damage, 0,0);
     140                        victimsAlreadyDamaged_.push_back(pawn);
    141141                    }
    142142                }
  • code/trunk/src/modules/weapons/projectiles/GravityBombField.h

    r10622 r11071  
    3939    GravityBombField(Context* context);
    4040    virtual ~GravityBombField();
    41     virtual void tick(float dt);
     41    virtual void tick(float dt) override;
    4242    virtual void destroy();
    4343
  • code/trunk/src/modules/weapons/projectiles/IceGunProjectile.cc

    r11052 r11071  
    120120            Vector3 offset = this->getWorldPosition() - otherObject->getWorldPosition();
    121121            freezer->setPosition(Vector3(0,0,0));
    122             freezer->translate(offset, WorldEntity::World);
     122            freezer->translate(offset, WorldEntity::TransformSpace::World);
    123123            // Start the freezing effect.
    124124            freezer->startFreezing();
  • code/trunk/src/modules/weapons/projectiles/IceGunProjectile.h

    r11052 r11071  
    6262
    6363        protected:
    64             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     64            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6565            static const float particleDestructionDelay_;
    6666        private:
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r10622 r11071  
    4848        this->textureIndex_ = 1;
    4949        this->setMass(2);
    50         this->setCollisionType(Dynamic);
     50        this->setCollisionType(CollisionType::Dynamic);
    5151        this->maxTextureIndex_ = 8;
    5252        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
  • code/trunk/src/modules/weapons/projectiles/LightningGunProjectile.h

    r9667 r11071  
    5858            virtual ~LightningGunProjectile() {}
    5959
    60             virtual void setMaterial(const std::string& material);
     60            virtual void setMaterial(const std::string& material) override;
    6161
    6262        private:
  • code/trunk/src/modules/weapons/projectiles/MineProjectile.cc

    r11052 r11071  
    112112        modelRing4_->yaw(Degree(270));
    113113
    114         emitter_ = NULL;
     114        emitter_ = nullptr;
    115115
    116116        if (GameMode::isMaster())
     
    121121            this->enableCollisionCallback();
    122122            this->setCollisionResponse(true);
    123             this->setCollisionType(Dynamic);
     123            this->setCollisionType(CollisionType::Dynamic);
    124124
    125125            // Create a sphere collision shape and attach it to the projectile.
     
    217217            {
    218218                // Damage all pawns within the damage radius
    219                 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     219                for (Pawn* pawn : ObjectList<Pawn>())
    220220                {
    221                     Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
     221                    Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
    222222                    if(distanceVector.length()< damageRadius_)
    223223                    {
    224                         it->hit(this->getShooter(), it->getWorldPosition(), NULL, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
     224                        pawn->hit(this->getShooter(), pawn->getWorldPosition(), nullptr, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
    225225                    }
    226226                }
  • code/trunk/src/modules/weapons/projectiles/MineProjectile.h

    r11052 r11071  
    5757            virtual ~MineProjectile();
    5858
    59             virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
    6060
    61             virtual void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
    62             virtual void setTimeUntilActivation(float timeUntilActivation);
     61            void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
     62            void setTimeUntilActivation(float timeUntilActivation);
    6363        protected:
    6464            static const float triggerRadius_;
     
    8484            WeakPtr<DistanceTrigger> distanceTrigger_;
    8585
    86             virtual void destructionEffect();
    87             virtual void allowExplosion();
    88             virtual void explode();
     86            void destructionEffect();
     87            void allowExplosion();
     88            void explode();
    8989    };
    9090}
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.cc

    r10624 r11071  
    5858        }
    5959        else
    60             this->particles_ = 0;
     60            this->particles_ = nullptr;
    6161    }
    6262
  • code/trunk/src/modules/weapons/projectiles/ParticleProjectile.h

    r9667 r11071  
    5353            ParticleProjectile(Context* context);
    5454            virtual ~ParticleProjectile();
    55             virtual void changedVisibility();
     55            virtual void changedVisibility() override;
    5656
    5757        private:
  • code/trunk/src/modules/weapons/projectiles/Projectile.cc

    r10629 r11071  
    5757            this->enableCollisionCallback();
    5858            this->setCollisionResponse(false);
    59             this->setCollisionType(Dynamic);
     59            this->setCollisionType(CollisionType::Dynamic);
    6060
    6161            // Create a sphere collision shape and attach it to the projectile.
     
    9494    void Projectile::setCollisionShapeRadius(float radius)
    9595    {
    96         if (collisionShape_ != NULL && radius > 0)
     96        if (collisionShape_ != nullptr && radius > 0)
    9797        {
    9898            collisionShape_->setRadius(radius);
  • code/trunk/src/modules/weapons/projectiles/Projectile.h

    r11052 r11071  
    6464            void setConfigValues();
    6565
    66             virtual void tick(float dt);
    67             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     66            virtual void tick(float dt) override;
     67            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6868
    6969        protected:
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r11052 r11071  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->setVelocity(0,0,-100);
    7474
     
    9292            this->enableCollisionCallback();
    9393            this->setCollisionResponse(false);
    94             this->setCollisionType(Kinematic);
     94            this->setCollisionType(CollisionType::Kinematic);
    9595
    9696            // Add collision shape
     
    117117        else
    118118        {
    119             this->defSndWpnEngine_ = 0;
    120             this->defSndWpnLaunch_ = 0;
     119            this->defSndWpnEngine_ = nullptr;
     120            this->defSndWpnLaunch_ = nullptr;
    121121        }
    122122
     
    128128
    129129        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
    130         this->setRadarObjectShape(RadarViewable::Triangle);
     130        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    131131        this->setRadarObjectScale(0.5f);
    132132    }
  • code/trunk/src/modules/weapons/projectiles/Rocket.h

    r11052 r11071  
    6262            virtual ~Rocket();
    6363
    64             virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
     64            virtual void tick(float dt) override; //!< Defines which actions the Rocket has to take in each tick.
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    67             virtual void destroyObject(void);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
     67            virtual void destroyObject(void) override;
    6868            void destructionEffect();
    6969
    70             virtual void moveFrontBack(const Vector2& value) {}
    71             virtual void moveRightLeft(const Vector2& value) {}
    72             virtual void moveUpDown(const Vector2& value) {}
     70            virtual void moveFrontBack(const Vector2& value) override {}
     71            virtual void moveRightLeft(const Vector2& value) override {}
     72            virtual void moveUpDown(const Vector2& value) override {}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777
    7878            /**
     
    114114                { this->rotateRoll(Vector2(value, 0)); }
    115115
    116             virtual void setShooter(Pawn* shooter);
     116            virtual void setShooter(Pawn* shooter) override;
    117117
    118             virtual void fired(unsigned int firemode);
     118            virtual void fired(unsigned int firemode) override;
    119119
    120120            /**
    121121            @brief Set the maximum lifetime of the rocket.
    122122            */
    123             virtual void setMaxFuel(float fuel);
     123            void setMaxFuel(float fuel);
    124124            /**
    125125            @brief Get the maximum lifetime of the rocket.
     
    127127            inline float getMaxFuel() const
    128128                { return lifetime_; }
    129             virtual float getFuel() const;
     129            float getFuel() const;
    130130
    131131        private:
  • code/trunk/src/modules/weapons/projectiles/RocketOld.cc

    r10622 r11071  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->setVelocity(0,0,-100);
    7474
     
    9292            this->enableCollisionCallback();
    9393            this->setCollisionResponse(false);
    94             this->setCollisionType(Kinematic);
     94            this->setCollisionType(CollisionType::Kinematic);
    9595
    9696            // Add collision shape
     
    117117        else
    118118        {
    119             this->defSndWpnEngine_ = 0;
    120             this->defSndWpnLaunch_ = 0;
     119            this->defSndWpnEngine_ = nullptr;
     120            this->defSndWpnLaunch_ = nullptr;
    121121        }
    122122
     
    128128
    129129        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
    130         this->setRadarObjectShape(RadarViewable::Triangle);
     130        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    131131        this->setRadarObjectScale(0.5f);
    132132    }
  • code/trunk/src/modules/weapons/projectiles/RocketOld.h

    r10622 r11071  
    6262            virtual ~RocketOld();
    6363
    64             virtual void tick(float dt); //!< Defines which actions the RocketOld has to take in each tick.
     64            virtual void tick(float dt) override; //!< Defines which actions the RocketOld has to take in each tick.
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    67             virtual void destroyObject(void);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
     67            virtual void destroyObject(void) override;
    6868            void destructionEffect();
    6969
    70             virtual void moveFrontBack(const Vector2& value) {}
    71             virtual void moveRightLeft(const Vector2& value) {}
    72             virtual void moveUpDown(const Vector2& value) {}
     70            virtual void moveFrontBack(const Vector2& value) override {}
     71            virtual void moveRightLeft(const Vector2& value) override {}
     72            virtual void moveUpDown(const Vector2& value) override {}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777
    7878            /**
     
    114114                { this->rotateRoll(Vector2(value, 0)); }
    115115
    116             virtual void setShooter(Pawn* shooter);
     116            virtual void setShooter(Pawn* shooter) override;
    117117
    118             virtual void fired(unsigned int firemode);
     118            virtual void fired(unsigned int firemode) override;
    119119
    120120        private:
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r11052 r11071  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->fuel_ = true;
    7474
     
    8787            this->enableCollisionCallback();
    8888            this->setCollisionResponse(false);
    89             this->setCollisionType(Kinematic);
     89            this->setCollisionType(CollisionType::Kinematic);
    9090
    9191            // Add collision shape.
     
    101101
    102102        this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow
    103         this->setRadarObjectShape(RadarViewable::Triangle);
     103        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    104104        this->setRadarObjectScale(0.5f);
    105105    }
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.h

    r10216 r11071  
    6262            SimpleRocket(Context* context);
    6363            virtual ~SimpleRocket();
    64             virtual void tick(float dt);
     64            virtual void tick(float dt) override;
    6565
    66             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
     66            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
    6767
    6868            void disableFire(); //!< Method to disable the fire and stop all acceleration
    6969
    70             virtual void moveFrontBack(const Vector2& value){}
    71             virtual void moveRightLeft(const Vector2& value){}
    72             virtual void moveUpDown(const Vector2& value){}
     70            virtual void moveFrontBack(const Vector2& value) override{}
     71            virtual void moveRightLeft(const Vector2& value) override{}
     72            virtual void moveUpDown(const Vector2& value) override{}
    7373
    74             virtual void rotateYaw(const Vector2& value);
    75             virtual void rotatePitch(const Vector2& value);
    76             virtual void rotateRoll(const Vector2& value);
     74            virtual void rotateYaw(const Vector2& value) override;
     75            virtual void rotatePitch(const Vector2& value) override;
     76            virtual void rotateRoll(const Vector2& value) override;
    7777            void setDestroy();
    7878
     
    115115                { this->rotateRoll(Vector2(value, 0)); }
    116116
    117             virtual void setShooter(Pawn* shooter);
     117            virtual void setShooter(Pawn* shooter) override;
    118118
    119119            inline bool hasFuel() const
Note: See TracChangeset for help on using the changeset viewer.