Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2015, 6:03:17 PM (10 years ago)
Author:
landauf
Message:

merged branch presentationFS14 back to trunk

Location:
code/trunk
Files:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/MovableEntity.cc

    r9667 r10216  
    7272    }
    7373
    74     bool MovableEntity::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     74    bool MovableEntity::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    7575    {
    7676        if (GameMode::isMaster() && enableCollisionDamage_)
     
    8080            {
    8181                float damage = this->collisionDamage_ * (victim->getVelocity() - this->getVelocity()).length();
    82                 victim->hit(0, contactPoint, damage);
     82                victim->hit(0, contactPoint, ownCollisionShape, damage);
    8383            }
    8484        }
     
    8686        return false;
    8787    }
    88 
    8988
    9089    void MovableEntity::registerVariables()
  • code/trunk/src/orxonox/worldentities/MovableEntity.h

    r9667 r10216  
    4747
    4848            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    49             virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
     49            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
    5050
    5151            using WorldEntity::setPosition;
  • code/trunk/src/orxonox/worldentities/WorldEntity.h

    r9667 r10216  
    374374                Condition is that enableCollisionCallback() was called.
    375375            */
    376             virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     376            virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
    377377                { return false; } /* With false, Bullet assumes no modification to the collision objects. */
    378378
  • code/trunk/src/orxonox/worldentities/pawns/CMakeLists.txt

    r7163 r10216  
    44  Pawn.cc
    55  SpaceShip.cc
     6  ModularSpaceShip.cc
    67  TeamBaseMatchBase.cc
    78  Destroyer.cc
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r9950 r10216  
    244244    }
    245245
    246     void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
     246    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
    247247    {
    248248        // Applies multiplier given by the DamageBoost Pickup.
     
    279279
    280280*/
    281     void Pawn::hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage)
     281    void Pawn::hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage)
    282282    {
    283283        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
    284284        {
    285             this->damage(damage, healthdamage, shielddamage, originator);
     285            this->damage(damage, healthdamage, shielddamage, originator, cs);
    286286            this->setVelocity(this->getVelocity() + force);
    287287        }
    288288    }
    289289
    290 
    291     void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage)
     290    void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage)
    292291    {
    293292        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
    294293        {
    295             this->damage(damage, healthdamage, shielddamage, originator);
     294            this->damage(damage, healthdamage, shielddamage, originator, cs);
    296295
    297296            if ( this->getController() )
     
    559558        return BLANKSTRING;
    560559    }
    561 
    562 
    563560}
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r9948 r10216  
    126126            //virtual void hit(Pawn* originator, const Vector3& force, float damage);
    127127            //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
    128             virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
    129             virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
     128            virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
     129            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
    130130
    131131            virtual void kill();
     
    196196
    197197            //virtual void damage(float damage, Pawn* originator = 0);
    198             virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL);
     198            virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
    199199
    200200            bool bAlive_;
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r9667 r10216  
    342342    /**
    343343    @brief
     344        Looks for an attached Engine with a certain name.
     345    @param name
     346        The name of the engine to be returned.
     347    @return
     348        Pointer to the engine with the given name, or NULL if not found.
     349    */
     350    Engine* SpaceShip::getEngineByName(const std::string& name)
     351    {
     352        for(size_t i = 0; i < this->engineList_.size(); ++i)
     353            if(this->engineList_[i]->getName() == name)
     354                return this->engineList_[i];
     355
     356        orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
     357        return NULL;
     358    }
     359
     360    /**
     361    @brief
    344362        Remove and destroy all Engines of the SpaceShip.
    345363    */
     
    355373    @param engine
    356374        A pointer to the Engine to be removed.
     375    @note
     376        Don't forget to reset the Engine's ship pointer after it was removed (or destroy the engine).
    357377    */
    358378    void SpaceShip::removeEngine(Engine* engine)
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h

    r9667 r10216  
    124124            bool hasEngine(Engine* engine) const; // Check whether the SpaceShip has a particular Engine.
    125125            Engine* getEngine(unsigned int i); // Get the i-th Engine of the SpaceShip.
     126            Engine* getEngineByName(const std::string& name);
    126127            /**
    127128            @brief Get the list of all Engines that are mounted on the SpaceShip.
Note: See TracChangeset for help on using the changeset viewer.