srimshady Posted December 17, 2015 Share Posted December 17, 2015 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 17, 2015 Share Posted December 17, 2015 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 srimshady 1 Quote Link to comment Share on other sites More sharing options...
srimshady Posted December 18, 2015 Author Share Posted December 18, 2015 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 valueYa 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. Quote Link to comment Share on other sites More sharing options...
srimshady Posted December 18, 2015 Author Share Posted December 18, 2015 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 valueAlso, is there a way to only change the x value of the sensibility or only the y? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 18, 2015 Share Posted December 18, 2015 Thanks to the open source nature of babylon.js, you can have a look at the code itself:https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.freeCamera.ts#L90 srimshady 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted December 18, 2015 Share Posted December 18, 2015 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 :orcamera.fovMode = BABYLON.Camera.FOVMODE_VERTICAL_FIXED or BABYLON.Camera.FOVMODE_VERTICAL_FIXED(code related : https://github.com/BabylonJS/Babylon.js/pull/392 ) srimshady 1 Quote Link to comment Share on other sites More sharing options...
srimshady Posted December 19, 2015 Author Share Posted December 19, 2015 Thanks to the open source nature of babylon.js, you can have a look at the code itself:https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.freeCamera.ts#L90Thank you so much! Quote Link to comment Share on other sites More sharing options...
srimshady Posted December 19, 2015 Author Share Posted December 19, 2015 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 :orcamera.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! Quote Link to comment Share on other sites More sharing options...
srimshady Posted December 19, 2015 Author Share Posted December 19, 2015 Thanks to the open source nature of babylon.js, you can have a look at the code itself:https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.freeCamera.ts#L90As 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. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted December 21, 2015 Share Posted December 21, 2015 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. Quote Link to comment Share on other sites More sharing options...
srimshady Posted December 21, 2015 Author Share Posted December 21, 2015 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.Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.