- Timestamp:
- Jul 21, 2011, 5:36:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai2/src/orxonox/controllers/AIController.cc
r8766 r8769 212 212 float random; 213 213 float maxrand = 100.0f / ACTION_INTERVAL; 214 if (this->waypoints_.size() > 0 && this->getControllableEntity() && this->mode_ == DEFAULT) //Waypoint functionality. 215 { 216 if (this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_) 217 this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size(); 218 219 this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition()); 220 } 214 221 if(this->mode_ == DEFAULT) 215 222 {
Note: See TracChangeset
for help on using the changeset viewer.