[Orxonox-commit 4830] r9499 - code/branches/turret/src/modules/objects
moralelastix at orxonox.net
moralelastix at orxonox.net
Mon Dec 10 15:17:37 CET 2012
Author: moralelastix
Date: 2012-12-10 15:17:37 +0100 (Mon, 10 Dec 2012)
New Revision: 9499
Modified:
code/branches/turret/src/modules/objects/Turret.cc
Log:
Praktisch fertig
Modified: code/branches/turret/src/modules/objects/Turret.cc
===================================================================
--- code/branches/turret/src/modules/objects/Turret.cc 2012-12-10 14:06:52 UTC (rev 9498)
+++ code/branches/turret/src/modules/objects/Turret.cc 2012-12-10 14:17:37 UTC (rev 9499)
@@ -56,9 +56,13 @@
void Turret::rotatePitch(const Vector2& value)
{
- /*this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x*0.8f);
- Pawn::rotatePitch(value);*/
orxout()<< "Turret rotate Pitch"<< endl;
+
+ const Quaternion& orient = this->getOrientation();
+ Radian pitch = orient.getPitch();
+
+ if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))
+ SpaceShip::rotatePitch(value);
}
More information about the Orxonox-commit
mailing list