diff options
Diffstat (limited to 'gfx/manualCameraController.cpp')
-rw-r--r-- | gfx/manualCameraController.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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; |