Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 23, 2009, 12:02:49 PM (16 years ago)
Author:
landauf
Message:

merged miniprojects branch back to trunk

Location:
code/trunk
Files:
23 edited
8 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/worldentities/Backlight.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Backlight.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Billboard.h

    r2662 r2826  
    3434#include "util/Math.h"
    3535#include "tools/BillboardSet.h"
     36#include "objects/Teamcolourable.h"
    3637
    3738namespace orxonox
    3839{
    39     class _OrxonoxExport Billboard : public StaticEntity
     40    class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable
    4041    {
    4142        public:
     
    6162                { return this->colour_; }
    6263
     64            virtual void setTeamColour(const ColourValue& colour)
     65                { this->setColour(colour); }
     66
    6367        protected:
    6468            inline BillboardSet& getBillboardSet()
  • code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt

    r2710 r2826  
    1919  Planet.cc
    2020  SpawnPoint.cc
     21  TeamSpawnPoint.cc
     22  PongCenterpoint.cc
     23  PongBall.cc
     24  PongBat.cc
    2125)
    2226
  • code/trunk/src/orxonox/objects/worldentities/Camera.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/Camera.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc

    r2662 r2826  
    4444        this->bDrag_ = false;
    4545        this->bAllowMouseLook_ = false;
     46        this->bAbsolute_ = false;
    4647
    4748        this->setObjectMode(0x0);
     
    5859        XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
    5960        XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
     61        XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false);
    6062    }
    6163
  • code/trunk/src/orxonox/objects/worldentities/CameraPosition.h

    r2662 r2826  
    5454                { return this->bAllowMouseLook_; }
    5555
     56            inline void setIsAbsolute(bool bAbsolute)
     57                { this->bAbsolute_ = bAbsolute; }
     58            inline bool getIsAbsolute() const
     59                { return this->bAbsolute_; }
     60
    5661            void attachCamera(Camera* camera);
    5762
     
    5964            bool bDrag_;
    6065            bool bAllowMouseLook_;
     66            bool bAbsolute_;
    6167    };
    6268}
  • code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2662 r2826  
    144144    void ControllableEntity::addCameraPosition(CameraPosition* position)
    145145    {
    146         if (position->getAllowMouseLook())
    147             position->attachToNode(this->cameraPositionRootNode_);
     146        if (!position->getIsAbsolute())
     147        {
     148            if (position->getAllowMouseLook())
     149                position->attachToNode(this->cameraPositionRootNode_);
     150            else
     151                this->attach(position);
     152        }
    148153        else
    149             this->attach(position);
     154        {
     155            WorldEntity* parent = this->getParent();
     156            if (parent)
     157                parent->attach(position);
     158        }
    150159        this->cameraPositions_.push_back(position);
    151160    }
  • code/trunk/src/orxonox/objects/worldentities/Light.h

    r2662 r2826  
    3737
    3838#include "util/Math.h"
     39#include "objects/Teamcolourable.h"
    3940
    4041namespace orxonox
    4142{
    42     class _OrxonoxExport Light : public StaticEntity
     43    class _OrxonoxExport Light : public StaticEntity, public Teamcolourable
    4344    {
    4445        public:
     
    6869            inline const ColourValue& getSpecularColour() const
    6970                { return this->specular_; }
     71
     72            virtual void setTeamColour(const ColourValue& colour)
     73                { this->setDiffuseColour(colour); this->setSpecularColour(colour); }
    7074
    7175            /**
  • code/trunk/src/orxonox/objects/worldentities/MobileEntity.cc

  • code/trunk/src/orxonox/objects/worldentities/MobileEntity.h

  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/StaticEntity.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/StaticEntity.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2809 r2826  
    133133    }
    134134
     135    void Pawn::setPlayer(PlayerInfo* player)
     136    {
     137        ControllableEntity::setPlayer(player);
     138
     139        if (this->getGametype())
     140            this->getGametype()->playerStartsControllingPawn(player, this);
     141    }
     142
     143    void Pawn::removePlayer()
     144    {
     145        if (this->getGametype())
     146            this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);
     147
     148        ControllableEntity::removePlayer();
     149    }
     150
    135151    void Pawn::setHealth(float health)
    136152    {
     
    140156    void Pawn::damage(float damage, Pawn* originator)
    141157    {
    142         this->setHealth(this->health_ - damage);
    143         this->lastHitOriginator_ = originator;
    144 
    145         // play damage effect
     158        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
     159        {
     160            this->setHealth(this->health_ - damage);
     161            this->lastHitOriginator_ = originator;
     162
     163            // play damage effect
     164        }
    146165    }
    147166
    148167    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
    149168    {
    150         this->damage(damage, originator);
    151         this->setVelocity(this->getVelocity() + force);
    152 
    153         // play hit effect
     169        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))
     170        {
     171            this->damage(damage, originator);
     172            this->setVelocity(this->getVelocity() + force);
     173
     174            // play hit effect
     175        }
    154176    }
    155177
     
    176198    void Pawn::death()
    177199    {
    178         // Set bAlive_ to false and wait for PawnManager to do the destruction
    179         this->bAlive_ = false;
    180 
    181         this->setDestroyWhenPlayerLeft(false);
    182 
    183         if (this->getGametype())
    184             this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
    185 
    186         if (this->getPlayer())
    187             this->getPlayer()->stopControl(this);
    188 
    189         if (Core::isMaster())
    190             this->deatheffect();
     200        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
     201        {
     202            // Set bAlive_ to false and wait for PawnManager to do the destruction
     203            this->bAlive_ = false;
     204
     205            this->setDestroyWhenPlayerLeft(false);
     206
     207            if (this->getGametype())
     208                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
     209
     210            if (this->getPlayer())
     211                this->getPlayer()->stopControl(this);
     212
     213            if (Core::isMaster())
     214                this->deatheffect();
     215        }
     216        else
     217            this->setHealth(1);
    191218    }
    192219
  • code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2662 r2826  
    4747            virtual void tick(float dt);
    4848            void registerVariables();
     49
     50            virtual void setPlayer(PlayerInfo* player);
     51            virtual void removePlayer();
    4952
    5053            inline bool isAlive() const
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.