Changeset 2261 for code/trunk/src/orxonox/objects/worldentities
- Timestamp:
- Nov 25, 2008, 11:56:40 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 12 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/questsystem2 (added) merged: 2109,2146,2159,2191,2193-2196,2205-2206,2208-2209,2221,2226,2228,2251,2258
- Property svn:mergeinfo changed
-
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/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/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/triggers/CMakeLists.txt
r2131 r2261 3 3 DistanceTrigger.cc 4 4 EventTrigger.cc 5 PlayerTrigger.cc 5 6 ) 6 7 -
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc (added) merged: 2193,2196,2205-2206,2209,2221
r2171 r2261 35 35 #include "core/XMLPort.h" 36 36 37 #include "orxonox/objects/worldentities/ControllableEntity.h" 38 37 39 namespace orxonox 38 40 { 39 41 CreateFactory(DistanceTrigger); 40 42 41 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator)43 DistanceTrigger::DistanceTrigger(BaseObject* creator) : PlayerTrigger(creator) 42 44 { 43 45 RegisterObject(DistanceTrigger); … … 45 47 this->distance_ = 100; 46 48 this->targetMask_.exclude(Class(BaseObject)); 49 this->setForPlayer(false); //!< Normally hasn't just ControllableEntities as targets. 47 50 } 48 51 … … 83 86 { 84 87 Identifier* targetId = ClassByString(targets); 88 89 //! Checks whether the target is (or is derived from) a ControllableEntity. 90 Identifier* controllableEntityId = Class(ControllableEntity); 91 if(targetId->isA(controllableEntityId)) 92 { 93 this->setForPlayer(true); 94 } 95 85 96 if (!targetId) 86 97 { … … 117 128 Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition(); 118 129 if (distanceVec.length() < this->distance_) 130 { 131 132 //! If the target is a player (resp. is a, or is derived from a, ControllableEntity) the triggeringPlayer is set to the target entity. 133 if(this->isForPlayer()) 134 { 135 ControllableEntity* player = dynamic_cast<ControllableEntity*>(entity); 136 this->setTriggeringPlayer(player); 137 } 138 119 139 return true; 140 } 120 141 } 121 142 return false; 122 123 143 } 124 144 … … 126 146 { 127 147 if (Trigger::isTriggered(mode)) 148 { 128 149 return checkDistance(); 150 } 129 151 else 130 152 return false; - Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h (added) merged: 2193,2196
r2171 r2261 30 30 #define _DistanceTrigger_H__ 31 31 32 #include " Trigger.h"32 #include "PlayerTrigger.h" 33 33 34 34 #include <set> … … 37 37 #include "core/BaseObject.h" 38 38 39 #include "orxonox/objects/worldentities/ControllableEntity.h" 40 39 41 namespace orxonox 40 42 { 41 class _OrxonoxExport DistanceTrigger : public Trigger43 class _OrxonoxExport DistanceTrigger : public PlayerTrigger 42 44 { 43 45 public: … … 66 68 std::set<Ogre::Node*> targetSet_; 67 69 float distance_; 70 68 71 }; 69 72 } - Property svn:mergeinfo changed
-
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.