mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
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:
parent
91535fa9ae
commit
7b3578420a
1 changed files with 3 additions and 1 deletions
|
|
@ -1903,7 +1903,9 @@ void CameraController::processMouseMotion(const SDL_MouseMotionEvent& event) {
|
||||||
|
|
||||||
// Directly update stored yaw/pitch (no lossy forward-vector derivation)
|
// Directly update stored yaw/pitch (no lossy forward-vector derivation)
|
||||||
yaw -= event.xrel * mouseSensitivity;
|
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;
|
pitch += event.yrel * mouseSensitivity * invert;
|
||||||
|
|
||||||
// WoW-style pitch limits: can look almost straight down, limited upward
|
// WoW-style pitch limits: can look almost straight down, limited upward
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue