From c1dd444fded1b1c24e4df723e5a48d104ec2d03c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 5 Mar 2021 19:40:27 +0000 Subject: Fixing manual camera scrolling, now just a matrix multiplication --- gfx/manualCameraController.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gfx') diff --git a/gfx/manualCameraController.cpp b/gfx/manualCameraController.cpp index e29ea36..21eefc8 100644 --- a/gfx/manualCameraController.cpp +++ b/gfx/manualCameraController.cpp @@ -47,9 +47,7 @@ ManualCameraController::handleInput(SDL_Event & e) pitch = std::clamp(pitch - 0.01F * e.motion.yrel, 0.1F, half_pi); } else { - const auto sc {sincosf(direction)}; - focus.x += sc.x * e.motion.yrel + sc.x * e.motion.xrel; - focus.y += sc.x * -e.motion.xrel + sc.x * e.motion.yrel; + focus += rotate_flat(-direction) * glm::vec2 {e.motion.xrel, e.motion.yrel}; } } return true; -- cgit v1.2.3