From d84f1a76ca09daa4445226c5acac8e361828a75a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gy=C3=B6rgy=20Straub?= Date: Fri, 6 Nov 2020 09:56:35 +0000 Subject: [PATCH] Fixed the rotation in primitive-shapes-example (y was inverted). Change-Id: Ia7264cb34255dc4a912b8f781dee05eef29ac484 --- examples/primitive-shapes/primitive-shapes-example.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/primitive-shapes/primitive-shapes-example.cpp b/examples/primitive-shapes/primitive-shapes-example.cpp index 38e08de..903300a 100644 --- a/examples/primitive-shapes/primitive-shapes-example.cpp +++ b/examples/primitive-shapes/primitive-shapes-example.cpp @@ -639,10 +639,13 @@ public: { //Rotate based off the gesture. Vector2 displacement = gesture.GetDisplacement(); - Quaternion q0 = mModel.GetProperty(Actor::Property::ORIENTATION).Get(); - 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(); mModel.SetProperty(Actor::Property::ORIENTATION, q * q0); -- 2.7.4