Commit d84f1a76ca09daa4445226c5acac8e361828a75a
1 parent
770d0315
Fixed the rotation in primitive-shapes-example (y was inverted).
Change-Id: Ia7264cb34255dc4a912b8f781dee05eef29ac484
Showing
1 changed file
with
6 additions
and
3 deletions
examples/primitive-shapes/primitive-shapes-example.cpp
| ... | ... | @@ -639,10 +639,13 @@ public: |
| 639 | 639 | { |
| 640 | 640 | //Rotate based off the gesture. |
| 641 | 641 | Vector2 displacement = gesture.GetDisplacement(); |
| 642 | - Quaternion q0 = mModel.GetProperty(Actor::Property::ORIENTATION).Get<Quaternion>(); | |
| 643 | - Vector2 rotation { displacement.y / X_ROTATION_DISPLACEMENT_FACTOR, // Y displacement rotates around X axis | |
| 644 | - displacement.x / Y_ROTATION_DISPLACEMENT_FACTOR }; // X displacement rotates around Y axis | |
| 642 | + Vector2 rotation { | |
| 643 | + -displacement.y / X_ROTATION_DISPLACEMENT_FACTOR, // Y displacement rotates around X axis | |
| 644 | + displacement.x / Y_ROTATION_DISPLACEMENT_FACTOR // X displacement rotates around Y axis | |
| 645 | + }; | |
| 646 | + | |
| 645 | 647 | Quaternion q = Quaternion(Radian(rotation.x), Radian(rotation.y), Radian(0.f)); |
| 648 | + Quaternion q0 = mModel.GetProperty(Actor::Property::ORIENTATION).Get<Quaternion>(); | |
| 646 | 649 | |
| 647 | 650 | mModel.SetProperty(Actor::Property::ORIENTATION, q * q0); |
| 648 | 651 | ... | ... |