fix: correct camera mouse-Y inversion (mouse-down should look down by default)

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.
This commit is contained in:
Kelsi 2026-03-12 21:06:07 -07:00
parent 91535fa9ae
commit 7b3578420a

View file

@ -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