- Timestamp:
- Jun 14, 2011, 8:53:28 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
r8213 r8706 57 57 The creator of this trigger. 58 58 */ 59 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator) , beaconMask_(NULL)59 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator) 60 60 { 61 61 RegisterObject(DistanceTrigger); … … 64 64 this->targetMask_.exclude(Class(BaseObject)); 65 65 this->targetName_ = ""; 66 this->beaconMask_.exclude(Class(BaseObject)); 67 this->beaconMask_.include(Class(DistanceTriggerBeacon)); 66 68 } 67 69 … … 72 74 DistanceTrigger::~DistanceTrigger() 73 75 { 74 // Delete the beacon mask if it exists. 75 if(this->beaconMask_ != NULL) 76 delete this->beaconMask_; 76 77 77 } 78 78 … … 159 159 // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons. 160 160 if(this->beaconMode_ == distanceTriggerBeaconMode::identify) 161 targetMask = *this->beaconMask_;161 targetMask = this->beaconMask_; 162 162 163 163 // Iterate through all objects that are targets of the DistanceTrigger. … … 205 205 entity = entity->getParent(); 206 206 207 Pawn* player = orxonox_cast<Pawn*>(entity); 208 this->setTriggeringPlayer(player); 207 Pawn* pawn = orxonox_cast<Pawn*>(entity); 208 if(pawn != NULL) 209 this->setTriggeringPawn(pawn); 210 else 211 CCOUT(2) << "Pawn was NULL." << endl; 209 212 } 210 213 … … 228 231 { 229 232 this->beaconMode_ = mode; 230 if(this->beaconMode_ == distanceTriggerBeaconMode::identify && this->beaconMask_ == NULL)231 {232 this->beaconMask_ = new ClassTreeMask();233 this->beaconMask_->exclude(Class(BaseObject));234 this->beaconMask_->include(Class(DistanceTriggerBeacon));235 }236 233 } 237 234 … … 280 277 Check whether the DistanceTrigger is triggered. 281 278 It is triggered if it is triggered according only to its mode (i.e. its sub-triggers) and if a target is in range. 282 @param 279 @param mode 280 The mode for which it is tested, whether the DistanceTrigger is triggered. 281 @return 283 282 Returns true if it is triggered ,false if not. 284 283 */
Note: See TracChangeset
for help on using the changeset viewer.