- Timestamp:
- Oct 30, 2015, 11:07:34 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc
r10722 r10725 34 34 35 35 RegisterClass(DivisionController); 36 static const float ACTION_INTERVAL = 1.0f; 36 37 37 38 DivisionController::DivisionController(Context* context) : LeaderController(context) 38 39 { 39 40 RegisterObject(DivisionController); 41 this->setFormationMode(WALL); 42 40 43 bIsDivisionLeader_ = true; 44 this->myFollower_ = 0; 45 this->myWingman_ = 0; 46 this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DivisionController::action, this))); 47 41 48 } 42 49 43 50 DivisionController::~DivisionController() 44 51 { 45 if (this->isInitialized()) 46 { 47 if (this->myFollower_) 48 this->myFollower_->myDivisionLeader_ = 0; 49 if (this->myWingman_) 50 this->myWingman_->myLeader_ = 0; 51 } 52 } void DivisionController::tick(float dt) 52 53 } 54 void DivisionController::tick(float dt) 53 55 { 54 56 SUPER(DivisionController, tick, dt); 55 57 56 58 } 59 void DivisionController::action() 60 { 61 /* setDesiredPositionOfFollower(); 62 setDesiredPositionOfWingman();*/ 63 } 64 57 65 bool DivisionController::setFollower(LeaderController* myFollower) 58 66 { … … 67 75 } 68 76 } 77 78 /* void DivisionController::setDesiredPositionOfWingman() 79 { 80 if (!this->myWingman_) 81 return; 82 83 switch (this->formationMode_){ 84 case WALL: 85 { 86 myWingman_->desiredRelativePosition_ = new Vector3 (200, 0, 0); 87 break; 88 } 89 case FINGER4: 90 { 91 break; 92 } 93 case VEE: 94 { 95 break; 96 } 97 case DIAMOND: 98 { 99 break; 100 } 101 } 102 103 } 104 void DivisionController::setDesiredPositionOfFollower() 105 { 106 if (!this->myFollower_) 107 return; 108 109 switch (this->formationMode_){ 110 case WALL: 111 { 112 myWingman_->desiredRelativePosition_ = new Vector3 (-200, 0, 0); 113 break; 114 } 115 case FINGER4: 116 { 117 break; 118 } 119 case VEE: 120 { 121 break; 122 } 123 case DIAMOND: 124 { 125 break; 126 } 127 } 128 129 }*/ 69 130 void DivisionController::XMLPort(Element& xmlelement, XMLPort::Mode mode) 70 131 {
Note: See TracChangeset
for help on using the changeset viewer.