A good FPS camera rotation with mouse and default sensitivity

Started by
2 comments, last by JoeJ 1 month ago

Hello everybody!
I was doing apparently wrong the FPS mouse rotation since all the time applying the elpased time on mouse movement.
So I was basically doing: mouse delta * elapsed.
Which is apparently completely wrong and it was the starting point of why it's not as good as Quake or Doom Eternal.
So it looks like the more proper way would be to do: mouse delta * sensitivity.
Since it give a pixel distance I guess it's an eulers added at end and not a radians.
What is the proper way and the good default value?

For example Doom Eternal has a sensitivity of 3.0 by default, but is it just a value that is multipled with mouse delta and that's it?
Doom Eternal also has a default of 40 of something called sensitivity vertically and horizontally, I don't understand why they have this added on top of sensitivity.
Counter Strike has a default of sensitivity of 1.25f and that's it on his side.

Is it the good way like that or can it be better: rotation += ToRadians(mouseDelta * sensitivity);
Thanks to share experience and skills about this important topic!

Advertisement

The reason why you don't want to multiply with the time step is that the mouse delta already is integrated over the time step, so multiplying it would be redundant.

You may actually want to divide by delta time instead, depending on what you are doing with it. For instance, in my engine I divide by delta time to turn the mouse delta into an angular velocity, then integrate that velocity back to a change in rotation by eventually multiplying with delta time. If you need the angular velocity for other reasons, this is the way to do it. Otherwise, you can just multiply mouse delta with a sensitivity factor (depends on OS API and hardware), and interpret that value as the change in rotation.

Alundra said:
For example Doom Eternal has a sensitivity of 3.0

Sensitivity numbers are not consistent across games. There is no standard or industry norm. You can do what you want.

Alundra said:
rotation += ToRadians(mouseDelta * sensitivity);

It's fine, but there is no need to introduce angle units and conversations.
Actually this only exposes you were confused about it at some point, so i would remove it.

You might however want to use a scaling constant to set the sensitivity from the options menu, just for the sake of defining some ‘intuitive' range like 1-100 or whatever.

This topic is closed to new replies.

Advertisement