Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2010, 3:27:09 PM (14 years ago)
Author:
dafrick
Message:

Merged pickup branch into trunk. Yay. Persisting bugs will be fixed, very soon.

Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

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

    r6501 r6524  
    8181        this->node_->setPosition(Vector3::ZERO);
    8282        this->node_->setOrientation(Quaternion::IDENTITY);
     83       
     84        // Activity and visibility memory.
     85        this->bActiveMem_ = true;
     86        this->bVisibleMem_ = true;
    8387
    8488
     
    201205        registerVariable(this->parentID_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
    202206    }
     207   
     208    /**
     209    @brief
     210        When the activity is changed, it is changed for all attached objects as well.
     211    */
     212    void WorldEntity::changedActivity(void)
     213    {
     214        SUPER(WorldEntity, changedActivity);
     215       
     216        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     217        {
     218            if(!this->isActive())
     219            {
     220                (*it)->bActiveMem_ = (*it)->isActive();
     221                (*it)->setActive(this->isActive());
     222            }
     223            else
     224            {
     225                (*it)->setActive((*it)->bActiveMem_);
     226            }
     227        }
     228    }
     229   
     230    /**
     231    @brief
     232        When the visibility is changed, it is changed for all attached objects as well.
     233    */
     234    void WorldEntity::changedVisibility(void)
     235    {
     236        SUPER(WorldEntity, changedVisibility);
     237       
     238        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
     239        {
     240            if(!this->isVisible())
     241            {
     242                (*it)->bVisibleMem_ = (*it)->isVisible();
     243                (*it)->setVisible(this->isVisible());
     244            }
     245            else
     246            {
     247                (*it)->setVisible((*it)->bVisibleMem_);
     248            }
     249        }
     250    }
    203251
    204252    /**
  • code/trunk/src/orxonox/worldentities/WorldEntity.h

    r6501 r6524  
    105105            static const Vector3 DOWN;
    106106            static const Vector3 UP;
     107           
     108            virtual void changedActivity(void);
     109            virtual void changedVisibility(void);
    107110
    108111            virtual void setPosition(const Vector3& position) = 0;
     
    231234            std::set<WorldEntity*> children_;
    232235            bool bDeleteWithParent_;
     236           
     237            bool bActiveMem_;
     238            bool bVisibleMem_;
    233239
    234240
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r6417 r6524  
    7171        this->aimPosition_ = Vector3::ZERO;
    7272
    73         this->getPickups().setOwner(this);
     73        //TODO: Remove.
     74        //this->getPickups().setOwner(this);
    7475
    7576        if (GameMode::isMaster())
     
    296297    }
    297298
    298     void Pawn::dropItems()
    299     {
    300         this->getPickups().clear();
    301     }
     299//TODO: Remove.
     300//     void Pawn::dropItems()
     301//     {
     302//         this->getPickups().clear();
     303//     }
    302304
    303305
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r6417 r6524  
    3333
    3434#include <string>
     35#include "interfaces/PickupCarrier.h"
    3536#include "interfaces/RadarViewable.h"
    3637#include "worldentities/ControllableEntity.h"
    37 #include "pickup/PickupCollection.h"
    3838
    3939namespace orxonox
    4040{
    41     class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable
     41    class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable, public PickupCarrier
    4242    {
    4343        friend class WeaponSystem;
     
    109109                { return this->numexplosionchunks_; }
    110110
    111             virtual void dropItems();
    112             inline PickupCollection& getPickups()
    113                 { return this->pickups_; }
    114             virtual void useItem()
    115                 { this->pickups_.useItem(); }
     111//TODO: Remove.
     112//             virtual void dropItems();
     113//             inline PickupCollection& getPickups()
     114//                 { return this->pickups_; }
     115//             virtual void useItem()
     116//                 { this->pickups_.useItem(); }
    116117
    117118            virtual void startLocalHumanControl();
     
    135136            bool bAlive_;
    136137
    137             PickupCollection pickups_;
     138            //TODO: Remove.
     139            //PickupCollection pickups_;
     140            virtual std::list<PickupCarrier*>* getCarrierChildren(void)
     141                { return new std::list<PickupCarrier*>(); }
     142            virtual PickupCarrier* getCarrierParent(void)
     143                { return NULL; }
     144            virtual const Vector3& getCarrierPosition(void)
     145                { return this->getWorldPosition(); };
    138146
    139147            float health_;
Note: See TracChangeset for help on using the changeset viewer.