srimshady

FreeCamera Angular Sensibility

Recommended Posts

Hey guys I have a quick question. How does babylon.js get its angular sensibility value? I need to precisely recreate a mouse sensitivity with freecamera from another fps game. For example, CS:GO multiplies the sensitivity by .022 to get it's sensitivity. What does babylon do to get it's default sens? Also, how does the fov value work? Let's say I want a vertical fov of 74, what would I set it to on the camera? .74? Thank you guys for any help.

Share this post


Link to post
Share on other sites

Hello freeCamera.angularSensibility is what you may want to check (it is a divider so mouse movements are divided by 2000 by default)

 

for fov, it is on camera.fov and it is a radian value

Ya I know about the angularSensibility. However it is not equating to the same mouse movement I'm getting in other games. If I set Unity 3D 5's sensitivity to 10, it is much less than if set angularSensibility to 10 or 100. Basically any simple ratio it doesn't really equate between any game and babylon . So how does it get it's value for sensitivity? Also, if I set fov to 1.29154, will that be 74 degrees fov vertically (as in the horizontal fov will change depending on aspect ratio)? Thanks for any help.

Share this post


Link to post
Share on other sites

Hello freeCamera.angularSensibility is what you may want to check (it is a divider so mouse movements are divided by 2000 by default)

 

for fov, it is on camera.fov and it is a radian value

Also, is there a way to only change the x value of the sensibility or only the y?

Share this post


Link to post
Share on other sites

angularSensibility is an "arbitrary" value (we got it simply by trying and applying the one that work the best in most cases), you can set the value that fits your needs but you can't compare this sensibility with other game engine camera movement sensibility (each engine has it's own "internal way of defining things").

 

Concerning horizontal or vertical fov , you can specifiy the way you want it to be with :or

camera.fovMode = BABYLON.Camera.FOVMODE_VERTICAL_FIXED or BABYLON.Camera.FOVMODE_VERTICAL_FIXED

(code related : https://github.com/BabylonJS/Babylon.js/pull/392 )

Share this post


Link to post
Share on other sites

angularSensibility is an "arbitrary" value (we got it simply by trying and applying the one that work the best in most cases), you can set the value that fits your needs but you can't compare this sensibility with other game engine camera movement sensibility (each engine has it's own "internal way of defining things").

 

Concerning horizontal or vertical fov , you can specifiy the way you want it to be with :or

camera.fovMode = BABYLON.Camera.FOVMODE_VERTICAL_FIXED or BABYLON.Camera.FOVMODE_VERTICAL_FIXED

(code related : https://github.com/BabylonJS/Babylon.js/pull/392 )

After a while of testing i figured out how to set angular sensibility to be the exact same as the game I wanted. Thank you for the fov info!

Share this post


Link to post
Share on other sites

As you can tell I'm very new to gamedev with js. How would I go about extending/modifying this class to use in my project. Thanks for any help for this noob.

 

You can simply get the JS file, modify it as you need, and load your modified file just after the babylon.js loading in your HTML page.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.