- Timestamp:
- May 17, 2010, 1:22:26 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
r6864 r6906 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 #include "DistanceTriggerBeacon.h" 38 39 39 40 namespace orxonox … … 51 52 52 53 this->distance_ = 100.0f; 54 this->targetName_ = BLANKSTRING; 55 this->singleTargetMode_ = false; 53 56 } 54 57 … … 70 73 71 74 XMLPortParam(DistanceMultiTrigger, "distance", setDistance, getDistance, xmlelement, mode); 75 XMLPortParam(DistanceMultiTrigger, "targetname", setTargetName, getTargetName, xmlelement, mode); 72 76 } 73 77 … … 128 132 continue; 129 133 134 // If the DistanceMultiTrigger is in single-target-mode. 135 if(this->singleTargetMode_) 136 { 137 // If the object that is a target is no DistanceTriggerBeacon, then the DistanceMultiTrigger can't be in single-target-mode. 138 if(!(*it)->isA(ClassIdentifier<DistanceTriggerBeacon>::getIdentifier())) 139 this->singleTargetMode_ = false; 140 // If the target name and the name of the DistancTriggreBeacon don't match. 141 else if(entity->getName().compare(this->targetName_) != 0) 142 continue; 143 } 144 130 145 Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition(); 131 146 // If the object is in range. … … 136 151 continue; 137 152 153 // Change the entity to the parent of the DistanceTriggerBeacon (if in single-target-mode), which is the entity to which the beacon is attached. 154 if(this->singleTargetMode_) 155 entity = entity->getParent(); 156 138 157 // If no queue has been created, yet. 139 158 if(queue == NULL)
Note: See TracChangeset
for help on using the changeset viewer.