- Timestamp:
- Oct 19, 2015, 5:15:17 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
r10670 r10673 205 205 float maxrand = 100.0f / ACTION_INTERVAL; 206 206 ControllableEntity* controllable = this->getControllableEntity(); 207 if (this->state_ == SLAVE) 208 { 209 Vector3 desiredAbsolutePosition = this->myMaster_->getControllableEntity()->getWorldPosition() + this->myMaster_->getControllableEntity()->getWorldOrientation()*desiredRelativePosition_; 210 211 orxonox::WeakPtr<MovableEntity> waypoint = new MovableEntity(this->center_->getContext()); 212 waypoint->setPosition(desiredAbsolutePosition); 213 214 this->addWaypoint(waypoint); 207 if (this->state_ == SLAVE && controllable && this->mode_ == DEFAULT) 208 { 209 210 if (this->myMaster_ && this->myMaster_->getControllableEntity() && desiredRelativePosition_){ 211 Vector3 desiredAbsolutePosition = this->myMaster_->getControllableEntity()->getWorldPosition() + this->myMaster_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_); 212 this->moveToPosition (desiredAbsolutePosition); 213 //WorldEntity* waypoint = new WorldEntity(this->getContext()); 214 //waypoint->setPosition(desiredAbsolutePosition); 215 216 //this->addWaypoint(waypoint); 217 218 } 219 215 220 } 216 221 //DOES: Either move to the waypoint or search for a Point of interest
Note: See TracChangeset
for help on using the changeset viewer.