- Timestamp:
- Oct 23, 2015, 2:18:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/LeaderController.cc
r10681 r10682 51 51 52 52 } 53 /* 54 Wingmen and Leaders attack target_, which is a member variable of their classes. 55 Wingmen's target_ is set to sectionTarget_, which is a member variable of SectionController class, unless 56 Wingman covers Leader's rear. 57 Leader's target_ must always equal sectionTarget_. 58 if section has a target, its Leader shoots at it, but doesn't follow. 59 Every section is a part of division. Division consisting of one Section is still a division. 60 Division's leader's target_ must always equal divisionTarget_, which is a member variable of DivisionController. 61 Division leader ONLY can follow target_ while in formation flight. 62 If Division doesn't have a target, Division Leader stays in place, unless it has a waypoint. 63 Division Leader's sectionTarget_ must equal divisionTarget_, 64 but the other section, that is not a leading section, can attack any target that is near divisonTarget_ 53 65 66 */ 54 67 void LeaderController::tick(float dt) 55 68 { 69 if (!this->isActive()) 70 return; 71 72 //--------------------------Stay in division-------------------------- 73 this->keepDivisionTick(); 74 /*keepDivisionTick(){ 75 if (this->divisionLeader_ && this->divisionLeader_->getControllableEntity() && desiredRelativePosition_){ 76 Vector3 desiredAbsolutePosition = ((this->divisionLeader_->getControllableEntity()->getWorldPosition()) + 77 (this->divisionLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_))); 78 this->moveToPosition (desiredAbsolutePosition); 79 } 80 } 81 */ 82 //If ordered to attack -> follow target and shoot 83 if (this->bAttackOrder_) 84 { 56 85 57 86 } 87 //If ordered to move -> move to a target Point 88 else if (this->bMoveOrder_) 89 { 90 91 } 92 else 93 //No orders -> Don't move, but shoot at whatever is close, unless Boss is shooting at it. 94 //(Section shoots same target, Boss's section shoots another target) 95 { 96 97 } 98 99 58 100 SUPER(LeaderController, tick, dt); 59 101 }
Note: See TracChangeset
for help on using the changeset viewer.