- Timestamp:
- Nov 28, 2015, 10:30:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
r10883 r10885 21 21 * 22 22 * Author: 23 * Fabian 'x3n' Landau23 * Gani Aliguzhinov 24 24 * Co-authors: 25 * Dominik Solenicki25 * ... 26 26 * 27 27 */ … … 96 96 if (!myDivisionLeader_) 97 97 { 98 LeaderController* newDivisionLeader = findNewDivisionLeader();98 ActionpointController* newDivisionLeader = findNewDivisionLeader(); 99 99 this->myDivisionLeader_ = newDivisionLeader; 100 100 //spread copyOrientation called equally among the division 101 101 if (this->myDivisionLeader_) 102 102 { 103 this->actionCounter_ = 8;103 this->actionCounter_ = 5; 104 104 } 105 105 } … … 147 147 + (orient* (targetRelativePosition))); 148 148 //let ship finish rotating. also don't call copyOrientation to often as it is a slow function. 149 if (this->actionCounter_ % 9== 0 && !this->bHasTargetOrientation_)149 if (this->actionCounter_ % 6 == 0 && !this->bHasTargetOrientation_) 150 150 this->setAction (Action::FLY, targetAbsolutePosition, orient); 151 151 else … … 300 300 301 301 302 LeaderController* SectionController::findNewDivisionLeader()302 ActionpointController* SectionController::findNewDivisionLeader() 303 303 { 304 304 … … 306 306 return 0; 307 307 308 LeaderController* closestLeader = 0;308 ActionpointController* closestLeader = 0; 309 309 float minDistance = std::numeric_limits<float>::infinity(); 310 310 //go through all pawns 311 for (ObjectList< LeaderController>::iterator it = ObjectList<LeaderController>::begin(); it; ++it)311 for (ObjectList<ActionpointController>::iterator it = ObjectList<ActionpointController>::begin(); it; ++it) 312 312 { 313 313 //0ptr or not DivisionController? … … 338 338 return 0; 339 339 } 340 bool SectionController::setWingman(ActionpointController* wingman) 341 { 342 WingmanController* newWingman = orxonox_cast<WingmanController*>(wingman); 340 bool SectionController::setWingman(ActionpointController* newWingman) 341 { 343 342 344 343 if (!this->myWingman_) 345 344 { 346 345 this->myWingman_ = newWingman; 346 newWingman->takeActionpoints (this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_); 347 347 return true; 348 348 }
Note: See TracChangeset
for help on using the changeset viewer.