From 7b3578420ad3a4448e0b4d2e7a7f4669d4538d2a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 21:06:07 -0700 Subject: [PATCH] fix: correct camera mouse-Y inversion (mouse-down should look down by default) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SDL yrel > 0 means the mouse moved downward. In WoW, moving the mouse down should decrease pitch (look down), but the previous code did += yrel which increased pitch (look up). This made the camera appear inverted — moving the mouse down tilted the view upward. The invertMouse option accidentally produced the correct WoW-default behaviour. Fix: negate the default invert factor so mouse-down = look down without InvertMouse, and mouse-down = look up when InvertMouse is enabled. --- src/rendering/camera_controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rendering/camera_controller.cpp b/src/rendering/camera_controller.cpp index a34f05f1..22c5304f 100644 --- a/src/rendering/camera_controller.cpp +++ b/src/rendering/camera_controller.cpp @@ -1903,7 +1903,9 @@ void CameraController::processMouseMotion(const SDL_MouseMotionEvent& event) { // Directly update stored yaw/pitch (no lossy forward-vector derivation) yaw -= event.xrel * mouseSensitivity; - float invert = invertMouse ? -1.0f : 1.0f; + // SDL yrel > 0 = mouse moved DOWN. In WoW, mouse-down = look down = pitch decreases. + // invertMouse flips to flight-sim style (mouse-down = look up). + float invert = invertMouse ? 1.0f : -1.0f; pitch += event.yrel * mouseSensitivity * invert; // WoW-style pitch limits: can look almost straight down, limited upward