- 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/SectionController.cc
r10722 r10725 38 38 { 39 39 RegisterObject(SectionController); 40 this->setFormationMode(WALL); 41 40 42 bIsDivisionLeader_ = false; 41 43 this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&SectionController::action, this))); 42 44 this->myWingman_ = 0; 45 this->myDivisionLeader_ = 0; 46 this->desiredRelativePosition_ = 0; 47 48 orxout(internal_error) << this << "Was created" << endl; 43 49 44 50 } … … 46 52 SectionController::~SectionController() 47 53 { 48 if (this->isInitialized()) 49 { 50 if (this->myDivisionLeader_) 51 this->myDivisionLeader_->myFollower_ = 0; 52 if(this->myWingman_) 53 this->myWingman_->myLeader_ = 0; 54 } 55 } 56 54 55 } 56 /*void SectionController::setDesiredPositionOfWingman() 57 { 58 if (!this->myWingman_) 59 return; 60 61 switch (this->formationMode_){ 62 case WALL: 63 { 64 myWingman_->desiredRelativePosition_ = new Vector3 (-200, 0, 0); 65 break; 66 } 67 case FINGER4: 68 { 69 break; 70 } 71 case VEE: 72 { 73 break; 74 } 75 case DIAMOND: 76 { 77 break; 78 } 79 } 80 81 } 82 */ 57 83 LeaderController* SectionController::findNewDivisionLeader() 58 84 { … … 112 138 LeaderController* newDivisionLeader = findNewDivisionLeader(); 113 139 this->myDivisionLeader_ = newDivisionLeader; 114 /*if (newDivisionLeader)140 if (newDivisionLeader) 115 141 orxout(internal_error) << "new DivisionLeader set" << endl; 116 else 117 orxout(internal_error) << "0 division leader" << endl;*/118 } 119 }142 143 } 144 /* setDesiredPositionOfWingman(); 145 */ } 120 146 /* 121 147 Wingmen and Leaders attack target_, which is a member variable of their classes. … … 132 158 133 159 */ 160 /* void SectionController::keepDivisionTick() 161 { 162 163 164 if (this->myDivisionLeader_ && this->myDivisionLeader_->getControllableEntity() && desiredRelativePosition_) 165 { 166 167 Vector3 desiredAbsolutePosition = ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) + 168 (this->myDivisionLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_))); 169 this->moveToPosition (desiredAbsolutePosition); 170 } 171 }*/ 134 172 void SectionController::tick(float dt) 135 {/* 173 { 174 175 176 /* 136 177 if (!this->isActive()) 137 178 return; 138 179 139 180 //--------------------------Stay in division-------------------------- 140 this->keepDivisionTick();*/ 141 /*keepDivisionTick(){ 142 if (this->divisionLeader_ && this->divisionLeader_->getControllableEntity() && desiredRelativePosition_){ 143 Vector3 desiredAbsolutePosition = ((this->divisionLeader_->getControllableEntity()->getWorldPosition()) + 144 (this->divisionLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_))); 145 this->moveToPosition (desiredAbsolutePosition); 146 } 147 } 181 this->keepDivisionTick(); 148 182 */ 149 /*//If ordered to attack -> follow target and shoot150 if (this->bAttackOrder_)151 {152 153 }154 183 //If ordered to move -> move to a target Point 155 184 156 185 //No orders -> Don't move, but shoot at whatever is close, unless Boss is shooting at it. 157 186 //(Section shoots same target, Boss's section shoots another target) 158 { 159 160 }*/ 187 161 188 162 189 //orxout(internal_error) << "my Wingman is " << this->myWingman_ << endl;
Note: See TracChangeset
for help on using the changeset viewer.