Rodrico Posted April 19, 2017 Share Posted April 19, 2017 Hi folks, I'm using ArcRotateCamera attached to my scene which default behavior is 1) MouseClick+Drag changes .alpha and .beta 2) Ctrl+MouseClick+Drag changes camera.position 3) MiddleMouseClick+Drag changes .alpha and .beta I'd like to know whether there is some way how to switch behavior of 1) and 2) so with ctrl+drag and/or middle+drag it rotates and with simple click+drag it moves camera.position, or should I add handlers on mouse events? Thanks for your ideas. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 19, 2017 Share Posted April 19, 2017 Hello out of the box this is not supported but easy to do This file controls the mouseclicks + drag: https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/babylon.arcRotateCameraPointersInput.ts and more precisely here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/Inputs/babylon.arcRotateCameraPointersInput.ts#L97 More about inputs:http://doc.babylonjs.com/tutorials/customizing_camera_inputs Other option is to do what you said: do not call camera.attachControl and just handle the mouse events. Quote Link to comment Share on other sites More sharing options...
Rodrico Posted April 20, 2017 Author Share Posted April 20, 2017 Thanks a lot. Those sources explained me a lot how it works and how to extend my code. 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.