Changeset 9043 for code/branches/waypoints/src/orxonox/controllers
- Timestamp:
- Mar 16, 2012, 4:06:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/waypoints/src/orxonox/controllers/FormationController.cc
r9016 r9043 272 272 } 273 273 274 Vector2 coord = get2DView direction(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);274 Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 275 275 float distance = (target - this->getControllableEntity()->getPosition()).length(); 276 276 if(coord.x < 0.01 && coord.y < 0.01) 277 { 278 // I AM HERE 279 //this->getControllableEntity()->setOrientation() 280 } 277 281 278 282 if(this->state_ == FREE) … … 281 285 { 282 286 // Multiply with ROTATEFACTOR_FREE to make them a bit slower 283 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x *coord.x);284 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y *coord.y);285 } 286 287 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())287 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x); 288 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y); 289 } 290 291 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength()) 288 292 { 289 293 this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
Note: See TracChangeset
for help on using the changeset viewer.