- Timestamp:
- Nov 12, 2015, 9:30:14 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc
r10793 r10796 77 77 executingMoveToPoint_ = !this->moveAndRoll(dt); 78 78 } 79 else 80 { 81 if (this->target_) 82 { 83 this->positionOfTarget_ = getPredictedPosition( 84 this->getControllableEntity()->getWorldPosition(), 85 hardcoded_projectile_speed, 86 this->target_->getWorldPosition(), 87 this->target_->getVelocity() 88 ); 89 Vector3 diffVector = this->positionOfTarget_ - this->getControllableEntity()->getWorldPosition(); 90 float diffLength = diffVector.length(); 91 /* Quaternion rotationToTarget = (this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).getRotationTo(diffVector); 92 Vector3* targetPosition = new Vector3 ( 0, 0, -200 ); 93 Vector3 target = rotationToTarget * (*targetPosition);*/ 94 if (diffLength > 200) 95 this->setTargetPosition( this->positionOfTarget_ - 0.6f*diffVector); 96 97 else 98 this->setTargetPosition( this->getControllableEntity()->getWorldPosition() ); 99 executingMoveToPoint_ = true; 100 } 101 102 103 if (this->maneuverType_ == ManeuverType::OFFENSIVE) 104 { 105 this->attack(); 106 this->moveAndRoll(dt); 107 } 108 } 79 109 if (this->bShooting_) 80 110 doFire(); … … 104 134 } 105 135 }*/ 106 this->chooseManeuverType();136 //this->chooseManeuverType(); 107 137 switch (this->maneuverType_) 108 138 { … … 113 143 break; 114 144 } 115 case ManeuverType::DEFEN SIVE:145 case ManeuverType::DEFENCIVE: 116 146 { 117 147 this->gunsD(); 148 break; 118 149 } 119 150 case ManeuverType::OFFENSIVE: 120 151 { 121 152 this->attack(); 153 break; 154 } 155 case ManeuverType::NEUTRAL: 156 { 157 this->scissors(); 158 } 159 default: 160 { 161 this->gunsD(); 162 break; 122 163 } 123 164 } 124 165 125 if (!executingMoveToPoint_)166 /*if (!executingMoveToPoint_) 126 167 { 127 168 Vector3* targetPosition = new Vector3 (0, 0, -2000); … … 129 170 executingMoveToPoint_ = true; 130 171 } 131 172 */ 132 173 if (this->myFollower_ && this->target_) 133 174 this->myFollower_->setTarget(this->target_);
Note: See TracChangeset
for help on using the changeset viewer.