0
\$\begingroup\$

The commonly used equation for camera rotation with a mouse does not involve time. This make sense since higher frame rates have smaller changes in mouse position and vise-versa so it all evens out. If time slows down or speeds up, however, camera rotation from the mouse does not adjust accordingly. Just as you move slower when time is slowed, logically I also want rotating to be slower.

One option is to multiply the change-in-position of the mouse with the same multiplier I'm using on time, but shouldn't it be possible to have change-in-rotation and change-in-time in the same equation, independent from framerate?

\$\endgroup\$
1
  • \$\begingroup\$ Usually the ratio between mouse movement distance to camera turning amount is tuned for player comfort and usability. So you might not want to scale it exactly in lock-step with your time scale - otherwise you could easily create a camera that moves uncomfortably fast or slow, frustrating players rather than building immersion. I'd be tempted to use a separate scaling curve dedicated just to the camera control, to allow tuning that feel independently from the rest of the time distortion effects. \$\endgroup\$
    – DMGregory
    Apr 5 at 17:12
0
\$\begingroup\$

I'm not quite sure what you mean in the last sentence, but usually the equation used for change-in-rotation multiplied by the time scale is actually framerate independent.
As you said, the mouse position change is framerate independent. And to get the rotation change according to time scale you multiply the mouse position change vector by time scale. The time scale is just from 0 to whatever where 0 is 'time has stopped', 1 is normal time, 2 is double time speed, etc, and it doesn't depend on framerate delta time.

\$\endgroup\$
2
  • \$\begingroup\$ You're right, applying the same scale multiplier used on time solves the problem. I still don't know why time can't be involved directly with camera rotation though. I find it weird, but oh well I got the end result I wanted. \$\endgroup\$
    – ddxm
    Apr 6 at 5:07
  • \$\begingroup\$ Well... There are many different types of camera behaviors used in games, some of them change with time scale, some move to the target position slower but keep the normal rotation speed, some need to move and rotate completely independent of the time scale. And the game engines simply provide the basic data - mouse position change between frames - without the additional calculations that highly likely might be not needed actually - the less unnecessary calculations the better. If the dev needs some additional modifications to that, he does it on his own. \$\endgroup\$
    – Ermiq
    Apr 6 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.