I am working on a first person view, and I just want my mouse click to be enabled.
How do I disable keyboard and mouse middle scroll button so that camera stays where it is.
Regards,
Nipun David
I am working on a first person view, and I just want my mouse click to be enabled.
How do I disable keyboard and mouse middle scroll button so that camera stays where it is.
Regards,
Nipun David
Hi @Deltakosh ,
So I used the lowerRadiusLimit, and upperRadiusLimit on camera and adjusted set them to 1.
But something weird is happening in my code when the upperRadiusLimit = 1, my environment sort of a shrinked. I am attaching screenshot
<Engine canvasId='sample-canvas'
antialias={true}
adaptToDeviceRatio={true} >
<Scene onMeshPicked={meshPicked} onSceneMount={onSceneMount}>
<EnvironmentHelper
options={{
enableGroundShadow: true,
groundYBias: 1}}
mainColor={Color3.FromHexString('#ededed')}/>
</Scene>
</Engine>
since I am using babylon with react I am using the above environment helper to draw the gray room which you can see on the screenshot below but it shrinks when I change the camera radius limit, not sure what is the reason please suggest the right way.
this seems to work fine in the example I created using the above code - line 58,59,60
https://www.babylonjs-playground.com/#SRZRWV#303
regards,
Nipun David
You must set upper and lower radius compatible with your radius, meaning lower <= radius <= upper.
If your radius is initially not in this range, it will be reset and so your camera will change position.
that is not the issue when I set the values with out the react-environment it is working fine but when I enabled the that react-component the size of the default environment reduces a lot (last image above)
so instead of using react-component i used
scene.createDefaultEnvironment()
in onSceneMount()
and it solved it. I think there is some internal issue with the linking of react components in the core babylonJS components.
anyway I found the workaround.