Changeset 10761 for code/branches/AI_HS15/src/orxonox/controllers
- Timestamp:
- Nov 3, 2015, 2:11:19 PM (9 years ago)
- Location:
- code/branches/AI_HS15/src/orxonox/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/CommonController.h
r10759 r10761 53 53 }; 54 54 55 } 56 //none for a formation flight without attacking, neutral when opponent and this have no 57 //advantage over each other, offensive when this spotted opponent first, 58 //defensive otherwise 59 namespace ManeuverType 60 { 61 enum Value 62 { 63 NONE, NEUTRAL, OFFENSIVE, DEFENCIVE 64 }; 65 66 } 67 //none for a formation flight 68 namespace Maneuver 69 { 70 enum Value 71 { 72 NONE, GUNSD, SCISSORS, COMBATSPREAD, DEFENSIVESPLIT, BREAK, BARRELROLL, SWOOP, IMMELMANN, 73 WINGOVER, LOWYOYO, HIGHYOYO, LAGDISPLACEMENTROLL 74 }; 55 75 } 56 76 … … 128 148 129 149 150 bool bHasObjectivePosition_; 151 Vector3 objectivePosition_; 152 bool bHasObjectiveOrientation_; 153 Quaternion objectiveOrientation_; 154 130 155 WeakPtr<ControllableEntity> target_; 131 156 bool bShooting_; 157 WeakPtr<ControllableEntity> objectiveTarget_; 158 132 159 133 160 134 161 FormationMode::Value formationMode_; 135 162 Rank::Value rank_; 136 137 163 ManeuverType::Value maneuverType_; 164 Maneuver::Value maneuver_; 138 165 139 166 private: -
code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
r10759 r10761 49 49 50 50 } 51 // void WingmanController::chooseManeuver() 52 // { 53 // if (this->maneuverType_ == ManeuverType::NONE) 54 // switch (this->maneuverType_ ) 55 // { 56 // case ManeuverType::NONE: 57 // { 58 59 // break; 60 // } 61 // case ManeuverType::NEUTRAL: 62 // { 63 64 // break; 65 // } 66 // case ManeuverType::OFFENSIVE: 67 // { 68 69 // break; 70 // } 71 // case ManeuverType::DEFENSIVE: 72 // { 73 74 // break; 75 // } 76 // } 77 // if (!this->myWingman_) 78 // return; 79 // Vector3* targetRelativePositionOfWingman; 80 // switch (this->formationMode_){ 81 // case FormationMode::WALL: 82 // { 83 // targetRelativePositionOfWingman = new Vector3 (-400, 0, 0); 84 // break; 85 // } 86 // case FormationMode::FINGER4: 87 // { 88 // targetRelativePositionOfWingman = new Vector3 (-400, 0, -200); 89 // break; 90 // } 91 // case FormationMode::VEE: 92 // { 93 // break; 94 // } 95 // case FormationMode::DIAMOND: 96 // { 97 // targetRelativePositionOfWingman = new Vector3 (400, -200, 0); 98 // break; 99 // } 100 // } 101 // Quaternion orient = this->getControllableEntity()->getWorldOrientation(); 102 103 // Vector3 targetAbsolutePositionOfWingman = ((this->getControllableEntity()->getWorldPosition()) + 104 // (this->getControllableEntity()->getWorldOrientation()* (*targetRelativePositionOfWingman))); 105 106 // myWingman_->setTargetOrientation(orient); 107 // myWingman_->setTargetPosition(targetAbsolutePositionOfWingman); 108 109 // } 51 110 52 111 void WingmanController::tick(float dt) … … 63 122 return; 64 123 //--------------------------Stay in formation-------------------------- 124 if (!this->target_) 125 { 126 //stay in formation 127 } 128 else 129 { 130 131 } 65 132 if (this->bHasTargetPosition_) 66 133 { 67 //targetPosition_ and targetOrientation_ are set by the Leader in its action()68 134 this->moveToTargetPosition(); 69 135 }
Note: See TracChangeset
for help on using the changeset viewer.