Changeset 3033 for code/trunk/src/orxonox/objects/worldentities/triggers
- Timestamp:
- May 23, 2009, 9:57:52 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 7 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/gametypes (added) merged: 2827,2903,2905-2906,2933-2936,2952,2954,2961,2970-2971,2978,2985-2986,3019-3020
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/triggers/CMakeLists.txt
r2710 r3033 4 4 EventTrigger.cc 5 5 PlayerTrigger.cc 6 CheckPoint.cc 6 7 ) -
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
r3028 r3033 35 35 #include "core/XMLPort.h" 36 36 37 #include "orxonox/objects/worldentities/ ControllableEntity.h"37 #include "orxonox/objects/worldentities/pawns/Pawn.h" 38 38 39 39 namespace orxonox … … 109 109 WEMask.include(Class(WorldEntity)); 110 110 this->targetMask_ *= WEMask; 111 112 this->notifyMaskUpdate(); 111 113 } 112 114 … … 133 135 if(this->isForPlayer()) 134 136 { 135 ControllableEntity* player = dynamic_cast<ControllableEntity*>(entity);137 Pawn* player = dynamic_cast<Pawn*>(entity); 136 138 this->setTriggeringPlayer(player); 137 139 } -
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
r3028 r3033 63 63 protected: 64 64 virtual bool isTriggered(TriggerMode mode); 65 virtual void notifyMaskUpdate() {} 66 67 ClassTreeMask targetMask_; 65 68 66 69 private: 67 ClassTreeMask targetMask_;68 70 std::set<Ogre::Node*> targetSet_; 69 71 float distance_; -
code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r2662 r3033 60 60 @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger. 61 61 */ 62 inline ControllableEntity* getTriggeringPlayer(void) const62 inline Pawn* getTriggeringPlayer(void) const 63 63 { return this->player_; } 64 64 … … 77 77 @param player A pointer to the ControllableEntity that triggered the PlayerTrigger. 78 78 */ 79 inline void setTriggeringPlayer( ControllableEntity* player)79 inline void setTriggeringPlayer(Pawn* player) 80 80 { this->player_ = player; } 81 81 … … 88 88 89 89 private: 90 ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.90 Pawn* player_; //!< The player that triggered the PlayerTrigger. 91 91 bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities. 92 92 -
code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc
r3028 r3033 102 102 { 103 103 this->bFirstTick_ = false; 104 this-> fireEvent(false);104 this->triggered(false); 105 105 } 106 106 … … 144 144 this->bTriggered_ = (newState & 0x1); 145 145 this->bActive_ = newState & 2; 146 this-> fireEvent(this->bActive_);146 this->triggered(this->bActive_); 147 147 this->stateChanges_.pop(); 148 148 if (this->stateChanges_.size() != 0) … … 160 160 else 161 161 this->setBillboardColour(ColourValue(1.0, 0.0, 0.0)); 162 } 163 164 void Trigger::triggered(bool bIsTriggered) 165 { 166 this->fireEvent(bIsTriggered); 162 167 } 163 168 -
code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h
r3028 r3033 89 89 { return this->remainingActivations_; } 90 90 91 inline void setVisible(bool visibility) 92 { this->debugBillboard_.setVisible(visibility); } 93 91 94 void setDelay(float delay); 92 95 inline float getDelay() const … … 101 104 inline bool isTriggered() { return this->isTriggered(this->mode_); } 102 105 virtual bool isTriggered(TriggerMode mode); 106 virtual void triggered(bool bIsTriggered); 103 107 104 108 private:
Note: See TracChangeset
for help on using the changeset viewer.