Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2009, 9:57:52 PM (16 years ago)
Author:
landauf
Message:

merged gametypes branch back to trunk

Location:
code/trunk
Files:
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/worldentities/triggers/CMakeLists.txt

    r2710 r3033  
    44  EventTrigger.cc
    55  PlayerTrigger.cc
     6  CheckPoint.cc
    67)
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc

    r3028 r3033  
    3535#include "core/XMLPort.h"
    3636
    37 #include "orxonox/objects/worldentities/ControllableEntity.h"
     37#include "orxonox/objects/worldentities/pawns/Pawn.h"
    3838
    3939namespace orxonox
     
    109109    WEMask.include(Class(WorldEntity));
    110110    this->targetMask_ *= WEMask;
     111
     112    this->notifyMaskUpdate();
    111113  }
    112114
     
    133135        if(this->isForPlayer())
    134136        {
    135           ControllableEntity* player = dynamic_cast<ControllableEntity*>(entity);
     137          Pawn* player = dynamic_cast<Pawn*>(entity);
    136138          this->setTriggeringPlayer(player);
    137139        }
  • code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h

    r3028 r3033  
    6363    protected:
    6464      virtual bool isTriggered(TriggerMode mode);
     65      virtual void notifyMaskUpdate() {}
     66
     67      ClassTreeMask targetMask_;
    6568
    6669    private:
    67       ClassTreeMask targetMask_;
    6870      std::set<Ogre::Node*> targetSet_;
    6971      float distance_;
  • code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h

    r2662 r3033  
    6060        @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
    6161        */
    62         inline ControllableEntity* getTriggeringPlayer(void) const
     62        inline Pawn* getTriggeringPlayer(void) const
    6363            { return this->player_; }
    6464       
     
    7777        @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
    7878        */
    79         inline void setTriggeringPlayer(ControllableEntity* player)
     79        inline void setTriggeringPlayer(Pawn* player)
    8080           { this->player_ = player; }
    8181
     
    8888       
    8989    private:
    90         ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.
     90        Pawn* player_; //!< The player that triggered the PlayerTrigger.
    9191        bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
    9292   
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc

    r3028 r3033  
    102102    {
    103103      this->bFirstTick_ = false;
    104       this->fireEvent(false);
     104      this->triggered(false);
    105105    }
    106106
     
    144144      this->bTriggered_ = (newState & 0x1);
    145145      this->bActive_ = newState & 2;
    146       this->fireEvent(this->bActive_);
     146      this->triggered(this->bActive_);
    147147      this->stateChanges_.pop();
    148148      if (this->stateChanges_.size() != 0)
     
    160160    else
    161161      this->setBillboardColour(ColourValue(1.0, 0.0, 0.0));
     162  }
     163
     164  void Trigger::triggered(bool bIsTriggered)
     165  {
     166    this->fireEvent(bIsTriggered);
    162167  }
    163168
  • code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h

    r3028 r3033  
    8989        { return this->remainingActivations_; }
    9090
     91      inline void setVisible(bool visibility)
     92        { this->debugBillboard_.setVisible(visibility); }
     93
    9194      void setDelay(float delay);
    9295      inline float getDelay() const
     
    101104      inline bool isTriggered() { return this->isTriggered(this->mode_); }
    102105      virtual bool isTriggered(TriggerMode mode);
     106      virtual void triggered(bool bIsTriggered);
    103107
    104108    private:
Note: See TracChangeset for help on using the changeset viewer.