[Orxonox-commit 463] r3039 - trunk/src/orxonox/objects/worldentities/pawns

landauf at orxonox.net landauf at orxonox.net
Sun May 24 18:09:24 CEST 2009


Author: landauf
Date: 2009-05-24 18:09:23 +0200 (Sun, 24 May 2009)
New Revision: 3039

Modified:
   trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
   trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc
Log:
changed rotation convertion.

+pitch is a counterclockwise rotation around the x axis (pointing to the right)
+yaw is a counterclockwise rotation around the y axis (pointing upwards)
+roll is a counterclockwise rotation around the z axis (pointing backwards)

This corresponds to the implementation of Ogre and Bullet, so we don't have to apply magic "-" signs anymore.

Don't get misleaded by wikipedia, they use another convention using a weird mix of clockwise and counterclockwise rotation. Our system is rather like this, except for the names of the axes:
http://developer.valvesoftware.com/w/images/7/7e/Roll_pitch_yaw.gif

So a rotation around an axis is counterclockwise if the clock faces in the direction of the axis. I hope you get it. ;)

(This will break the AI even more, but it will be fixed in a later commit.)


Modified: trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
===================================================================
--- trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	2009-05-24 15:42:50 UTC (rev 3038)
+++ trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	2009-05-24 16:09:23 UTC (rev 3039)
@@ -159,7 +159,7 @@
 
     void SpaceShip::rotateYaw(const Vector2& value)
     {
-        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
 
         Pawn::rotateYaw(value);
     }

Modified: trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	2009-05-24 15:42:50 UTC (rev 3038)
+++ trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	2009-05-24 16:09:23 UTC (rev 3039)
@@ -176,7 +176,7 @@
 
     void Spectator::rotateYaw(const Vector2& value)
     {
-        this->yaw_ -= value.y;
+        this->yaw_ += value.y;
 
         ControllableEntity::rotateYaw(value);
     }




More information about the Orxonox-commit mailing list