I'd like to request a change in behavior. The way the camera moves when zooming using Ctrl + Scroll Wheel is very... odd. When you scroll, the camera moves with the vector of mouse screen position - screen center. While not entirely useless, it's very difficult to figure out where you land with each zooming level.
The way I'd request the movement to behave, is for the cursor to stay on the same world coordinate position when zooming. I'll demonstrate with a few lines of pseudo-code.
Current way is something along these lines:
Code: Select all
// Zoom delta in range [-1, 1].
Camera.Size *= Pow(1.1, delta);
Camera.Position += ((GetMouseScreenPos() / GetScreenSize()) + (GetScreenSize() / 2)) * Camera.Size * SomeScalar;
Code: Select all
var oldMouseWorldPos = Camera.Transform(GetMouseScreenPos());
// Zoom delta in range [-1, 1].
Camera.Size *= Pow(1.1, delta);
var newMouseWorldPos = Camera.Transform(GetMouseScreenPos());
Camera.Position += oldMouseWorldPos - newMouseWorldPos;