Fixed the rotation in primitive-shapes-example (y was inverted). 91/247191/2
authorGyörgy Straub <g.straub@partner.samsung.com>
Fri, 6 Nov 2020 09:56:35 +0000 (09:56 +0000)
committerGyörgy Straub <g.straub@partner.samsung.com>
Mon, 9 Nov 2020 12:08:28 +0000 (12:08 +0000)
Change-Id: Ia7264cb34255dc4a912b8f781dee05eef29ac484

examples/primitive-shapes/primitive-shapes-example.cpp

index 38e08de..903300a 100644 (file)
@@ -639,10 +639,13 @@ public:
       {
         //Rotate based off the gesture.
         Vector2 displacement = gesture.GetDisplacement();
-        Quaternion q0 = mModel.GetProperty(Actor::Property::ORIENTATION).Get<Quaternion>();
-        Vector2 rotation { displacement.y / X_ROTATION_DISPLACEMENT_FACTOR, // Y displacement rotates around X axis
-          displacement.x / Y_ROTATION_DISPLACEMENT_FACTOR }; // X displacement rotates around Y axis
+        Vector2 rotation {
+          -displacement.y / X_ROTATION_DISPLACEMENT_FACTOR, // Y displacement rotates around X axis
+          displacement.x / Y_ROTATION_DISPLACEMENT_FACTOR // X displacement rotates around Y axis
+        };
+
         Quaternion q = Quaternion(Radian(rotation.x), Radian(rotation.y), Radian(0.f));
+        Quaternion q0 = mModel.GetProperty(Actor::Property::ORIENTATION).Get<Quaternion>();
 
         mModel.SetProperty(Actor::Property::ORIENTATION, q * q0);