I am creating a FPS game online. I want the user to be able to use a sensitivity they are familiar with from games they've played. In this case, I want them to use their Fortnite sensitivity.
I am trying to figure out the Math behind it all.
I have figured out how to change the sensitivity in the PointerLockerControls.js file and can edit it from my main js file.
function onMouseMove( event ) {
if ( scope.isLocked === false ) return;
var movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;
var movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;
euler.setFromQuaternion( camera.quaternion );
this.speedFactorX = 0.002;
this.speedFactorY = 0.002;
euler.y -= movementX * scope.speedFactorX;
euler.x -= movementY * scope.speedFactorY;
euler.x = Math.max( - PI_2, Math.min( PI_2, euler.x ) );
camera.quaternion.setFromEuler( euler );
}
I want to know what type of unit the '0.002' is.
In fortnite, I have my sensitivity at '0.08'. Obviously, this is way too fast to replace the speed factor values.
What kind of math do I need to match the users sensitivity in fortnite, to the speed factor values?
Hope someone can understand what I mean. Thanks!
This may help with the fortnite values - https://jscalc.io/calc/RTCJTLMts42GYfWf
I will be using the fortnite slider.