Hi there,
I’d like to use the UniversalCamera like it was an ArcRotateCamera but without setting the target
So when i click the right mouse button i’d like to make panning. the default is rotation (both for left or right click). Is it possible to change this feature using onPointerObservable and then do some job?
Second question: i’ve activated also the zoom-in with mouse wheel (camera.inputs.addMouseWheel();) but it’s too fast. Is there a way to reduce the speed?
The basic idea is, if you don’t want the default rotation behavior, you’ll have to remove the default mouse input behaviors and add your own. You can absolutely use onPointerObservable. In the provided link, I used camera.inputs.removeMouse();(Line 17) to remove the default behaviors. Next, you’ll want to check out Lines 98-120.
When a POINTERDOWN is detected, a pointer lock will be enabled on the engine. This means that your mouse cursor will not actually be moving but will still provide deltas of change (movementX and movementY).
For POINTERMOVE events, if there’s been a pointer lock placed on your cursor, we take that delta data and change the position of the camera. Note that if you incorporate any type of rotation, you will have to translate the relative movement of the cursor to the global movement of the camera.
Finally, when the button is released (POINTERUP), we release the lock and the cursor is free to do stuff.