- Timestamp:
- Oct 31, 2015, 12:20:00 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
r10725 r10729 34 34 35 35 RegisterClass(WingmanController); 36 static const int RADIUS_TO_SEARCH_FOR_LEADER = 7000;37 static const float ACTION_INTERVAL = 1.0f; 36 37 38 38 WingmanController::WingmanController(Context* context) : CommonController(context) 39 39 { … … 41 41 this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this))); 42 42 this->myLeader_ = 0; 43 this->desiredRelativePosition_ = 0;44 43 } 45 44 … … 88 87 void WingmanController::action() 89 88 { 90 //this->target_ = this->sectionTarget_;91 89 if (!this->myLeader_) 92 90 { … … 145 143 146 144 147 /*void WingmanController::keepSectionTick() 148 { 149 if (this->myLeader_ && this->myLeader_->getControllableEntity()) 150 //orxout(internal_error) << "MOVING" << endl; 151 152 if (this->myLeader_ && this->myLeader_->getControllableEntity() && desiredRelativePosition_) 153 { 154 Vector3 desiredAbsolutePosition = ((this->myLeader_->getControllableEntity()->getWorldPosition()) + 155 (this->myLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_))); 156 this->moveToPosition (desiredAbsolutePosition); 157 } 158 }*/ 145 159 146 void WingmanController::tick(float dt) 160 147 { 161 /*//-------------------------------------------------------148 //------------------------------------------------------- 162 149 163 150 … … 165 152 return; 166 153 //--------------------------Stay in formation-------------------------- 167 this->keepSectionTick();*/ 168 154 if (this->bHasTargetPosition_) 155 { 156 //targetPosition_ and targetOrientation_ are set by the Leader in its action() 157 this->moveToTargetPosition(); 158 } 169 159 170 160 //--------------------------Attack same target as the Leader-------------------------- … … 175 165 this->doFire(); 176 166 } 177 */167 */ 178 168 179 169 //orxout(internal_error) << "I am " << this << endl; … … 190 180 } 191 181 192 //**********************************************NEW 193 /*void WingmanController::defaultBehaviour(float maxrand) 194 { 195 196 }*/ 182 197 183 198 184 }
Note: See TracChangeset
for help on using the changeset viewer.