From dab6bc9ffa3074d4d54c0d909c0a1801c4626ee4 Mon Sep 17 00:00:00 2001
From: Vanessa Karolek <vaka1997@uni-koblenz.de>
Date: Tue, 1 Jun 2021 19:28:46 +0200
Subject: [PATCH] [#42][Fix] mirror rotation around X axis

For convenience reasons:
- Right mouse movement leads to camera movement to the left (background changes to the right)
- Left mouse movement leads to camera movement to the right (background changes to the left)
---
 modules/camera/src/vkcv/camera/TrackballCamera.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/camera/src/vkcv/camera/TrackballCamera.cpp b/modules/camera/src/vkcv/camera/TrackballCamera.cpp
index fb392d1b..c7a95307 100644
--- a/modules/camera/src/vkcv/camera/TrackballCamera.cpp
+++ b/modules/camera/src/vkcv/camera/TrackballCamera.cpp
@@ -69,7 +69,7 @@ namespace vkcv {
 
     void TrackballCamera::updatePosition(double deltaTime) {
         glm::mat4 rotationY = glm::rotate(glm::mat4(1.0f), glm::radians(m_yaw), glm::vec3(0.0f, -1.0f, 0.0f));
-        glm::mat4 rotationX = glm::rotate(rotationY, glm::radians(m_pitch), glm::vec3(1.0f, 0.0f, 0.0f));
+        glm::mat4 rotationX = glm::rotate(rotationY, -glm::radians(m_pitch), glm::vec3(1.0f, 0.0f, 0.0f));
         glm::vec3 translate = glm::vec3(0.0f,0.0f,m_radius);
         translate = glm::vec3(rotationX * glm::vec4(translate, 0.0f));
         m_position = m_center + translate;
-- 
GitLab