- Timestamp:
- Jul 29, 2012, 11:02:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/orxonox/controllers/FormationController.cc
r9336 r9337 1051 1051 return; 1052 1052 1053 Vector2 coord = get2DView direction(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);1053 Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 1054 1054 float distance = (target - this->getControllableEntity()->getPosition()).length(); 1055 1055 … … 1057 1057 { 1058 1058 // Multiply with ROTATEFACTOR_FREE to make them a bit slower 1059 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);1060 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);1059 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * clamp(coord.x * 10, -1.0f, 1.0f)); 1060 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * clamp(coord.y * 10, -1.0f, 1.0f)); 1061 1061 this->getControllableEntity()->moveFrontBack(SPEED_FREE); 1062 1062 }
Note: See TracChangeset
for help on using the changeset viewer.