Changeset 8792 for code/branches
- Timestamp:
- Jul 27, 2011, 9:21:29 PM (13 years ago)
- Location:
- code/branches/ai2/src/orxonox/controllers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai2/src/orxonox/controllers/AIController.cc
r8791 r8792 241 241 WorldEntity* wPoint = this->waypoints_[this->waypoints_.size()-1]; 242 242 if(wPoint) 243 { 243 244 this->moveToPosition(wPoint->getWorldPosition()); //BUG ?? sometime wPoint->getWorldPosition() causes crash 244 if (wPoint->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_) 245 this->waypoints_.pop_back(); // if goal is reached, remove it from the list 245 if (wPoint->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_) 246 this->waypoints_.pop_back(); // if goal is reached, remove it from the list 247 } 248 else 249 this->waypoints_.pop_back(); // remove invalid waypoints 246 250 247 251 } -
code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
r8791 r8792 105 105 {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end()); 106 106 for (size_t i = 0; i < this->waypoints_.size(); ++i) 107 this->waypoints_[i]->destroy(); 107 { 108 if(this->waypoints_[i]) 109 this->waypoints_[i]->destroy(); 110 } 111 //this->waypoints_.clear(); 108 112 this->removeFromFormation(); 109 113 this->weaponModes_.clear(); … … 1196 1200 { 1197 1201 if(!defaultWaypoint_) 1198 this->updatePointsOfInterest("PickupSpawner", 60.0f); // long search radius if there is no default goal1202 this->updatePointsOfInterest("PickupSpawner", 200.0f); // long search radius if there is no default goal 1199 1203 else 1200 1204 this->updatePointsOfInterest("PickupSpawner", 20.0f); // take pickup en passant if there is a default waypoint -
code/branches/ai2/src/orxonox/controllers/ArtificialController.h
r8786 r8792 173 173 174 174 //WAYPOINT DATA 175 std::vector<W orldEntity*> waypoints_;175 std::vector<WeakPtr<WorldEntity> > waypoints_; 176 176 size_t currentWaypoint_; 177 177 float squaredaccuracy_;
Note: See TracChangeset
for help on using the changeset viewer.