Changeset 10858
- Timestamp:
- Nov 25, 2015, 2:53:58 PM (9 years ago)
- Location:
- code/branches/campaignHS15/src/orxonox/controllers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc
r10856 r10858 53 53 { 54 54 this->myFollower_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_); 55 if (this->myWingman_) 56 { 57 this->myWingman_->setAction(Action::FIGHTALL); 58 } 55 59 } 56 60 else if (this->myWingman_) -
code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc
r10856 r10858 102 102 switch (myDivisionLeader_->getAction()) 103 103 { 104 // case Action::FLY: 105 // { 106 // // Vector3 targetRelativePosition = getFormationPosition(); 107 // // Quaternion orient = 108 // // this->myDivisionLeader_->getControllableEntity()->getWorldOrientation(); 109 // // Vector3 targetAbsolutePosition = 110 // // ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) + 111 // // (orient* (targetRelativePosition))); 112 // // this->setAction (Action::FLY, targetAbsolutePosition, orient); 113 // break; 114 // } 115 // case Action::FIGHT: 116 // { 117 118 // // this->setAction (Action::FLY, targetAbsolutePosition, orient); 119 // break; 120 // } 104 case Action::FIGHT: 105 { 106 if (!this->hasTarget()) 107 { 108 this->chooseTarget(); 109 } 110 break; 111 } 112 case Action::FIGHTALL: 113 { 114 if (!this->hasTarget()) 115 { 116 this->chooseTarget(); 117 } 118 break; 119 } 120 case Action::ATTACK: 121 { 122 if (!this->hasTarget()) 123 { 124 this->chooseTarget(); 125 } 126 break; 127 } 121 128 default: 122 129 { … … 150 157 } 151 158 } 159 } 160 if (this->hasTarget()) 161 { 162 //----choose where to go---- 163 this->maneuver(); 164 //----fire if you can---- 165 this->bShooting_ = this->canFire(); 152 166 } 153 167 } … … 210 224 211 225 } 212 this->set Action (Action::FIGHT,orxonox_cast<ControllableEntity*>(target));226 this->setTarget (orxonox_cast<ControllableEntity*>(target)); 213 227 } 214 228 else -
code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc
r10856 r10858 98 98 switch (this->myLeader_->getAction()) 99 99 { 100 // case Action::FLY: 101 // { 102 // // Vector3 targetRelativePosition = getFormationPosition(); 103 // // Quaternion orient = 104 // // this->myDivisionLeader_->getControllableEntity()->getWorldOrientation(); 105 // // Vector3 targetAbsolutePosition = 106 // // ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) + 107 // // (orient* (targetRelativePosition))); 108 // // this->setAction (Action::FLY, targetAbsolutePosition, orient); 109 // break; 110 // } 111 // case Action::FIGHT: 112 // { 113 114 // // this->setAction (Action::FLY, targetAbsolutePosition, orient); 115 // break; 116 // } 100 case Action::FIGHT: 101 { 102 if (!this->hasTarget()) 103 { 104 this->setTarget(this->myLeader_->getTarget()); 105 } 106 break; 107 } 108 case Action::FIGHTALL: 109 { 110 if (!this->hasTarget()) 111 { 112 this->setTarget(this->myLeader_->getTarget()); 113 } 114 break; 115 } 116 case Action::ATTACK: 117 { 118 if (!this->hasTarget()) 119 { 120 this->setTarget(this->myLeader_->getTarget()); 121 } 122 break; 123 } 117 124 default: 118 125 { … … 146 153 } 147 154 } 155 } 156 if (this->hasTarget()) 157 { 158 //----choose where to go---- 159 this->maneuver(); 160 //----fire if you can---- 161 this->bShooting_ = this->canFire(); 148 162 } 149 163 }
Note: See TracChangeset
for help on using the changeset viewer.