Changeset 2071 for code/branches/objecthierarchy/src/orxonox/objects
- Timestamp:
- Oct 31, 2008, 12:56:29 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
r2069 r2071 30 30 #include "DistanceTrigger.h" 31 31 32 #include <OgreNode.h> 33 32 34 #include "core/CoreIncludes.h" 33 35 #include "core/XMLPort.h" 34 36 35 namespace orxonox {36 37 namespace orxonox 38 { 37 39 CreateFactory(DistanceTrigger); 38 40 … … 82 84 Identifier* targetId = ClassByString(targets); 83 85 if (!targetId) 86 { 87 COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl; 84 88 return; 89 } 85 90 86 91 this->targetMask_.include(targetId); -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
r2029 r2071 34 34 #include <set> 35 35 36 #include <OgreNode.h>37 38 36 #include "core/ClassTreeMask.h" 39 37 #include "core/BaseObject.h" 40 38 41 namespace orxonox {42 39 namespace orxonox 40 { 43 41 class _OrxonoxExport DistanceTrigger : public Trigger 44 42 { 45 43 public: 46 44 DistanceTrigger(BaseObject* creator); 47 ~DistanceTrigger();45 virtual ~DistanceTrigger(); 48 46 49 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); … … 62 60 63 61 protected: 64 bool isTriggered(TriggerMode mode);62 virtual bool isTriggered(TriggerMode mode); 65 63 66 64 private: … … 69 67 float distance_; 70 68 }; 71 72 69 } 73 70 74 #endif /* _ Trigger_H__ */71 #endif /* _DistanceTrigger_H__ */ -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.cc
r2069 r2071 58 58 this->bSwitch_ = false; 59 59 this->bStayActive_ = false; 60 this->delay_ = 0.0; 60 this->delay_ = 0.0f; 61 this->remainingTime_ = 0.0f; 62 this->timeSinceLastEvent_ = 0.0f; 61 63 this->remainingActivations_ = -1; 62 64 … … 98 100 this->fireEvent(false); 99 101 } 102 103 // Check if the object is active (this is NOT Trigger::isActive()!) 104 if (!this->BaseObject::isActive()) 105 return; 100 106 101 107 bool newTriggered = this->isTriggered() ^ this->bInvertMode_; -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.h
r2069 r2071 52 52 public: 53 53 Trigger(BaseObject* creator); 54 ~Trigger();54 virtual ~Trigger(); 55 55 56 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
Note: See TracChangeset
for help on using the changeset viewer.