EDIT (happy news):
- get this, is awesome, so the whole bug report below is totally accurate, except that I was using preview.babylonjs.org/library…
- I can confirm that in the “preview” CDN, this bug is apparent. The multitouch is broken for the arcRotateCamera
- HOWEVER, I can report that in cdn.babylonjs.org/library… the multitouch pinch zoom is working perfectly.
Bug Report
I have been looking at the source code here: Babylon.js/arcRotateCameraPointersInput.ts at master · BabylonJS/Babylon.js · GitHub
It seems that when the second finger touch comes down in order to begin a pinch, the onTouch
method is causing a rotation of the camera alpha/beta before the multitouch pinch is registered and takes over control of the camera.
Firstly this appears to me to be a bug in the implementation, but perhaps I am missing something.
Secondly, I would like to check, because if its not a bug, and I need to make my own inputController for the camera, then I am thinking this:
Can I use the onButtonDown
method to findout if the current buttonDown is part of a multitouch behaviour?
I am pretty sure that this worked perfectly up until recently.
I have tried using the browser css touch-action: pinch-zoom
to try and intercept this such that a second touch event doesnt reach the canvas, however this does not appear to do anything.
I mean there are two refactors of arcRotateCameraPointersInput which relate to the number of buttons being pushed, here: Port ArcRotateCameraPointersInput to use BaseCameraPointersInput. · BabylonJS/Babylon.js@410a9af · GitHub, and here: Refactor so buttonCount is not passed in onButtonDown/Up. · BabylonJS/Babylon.js@90ae842 · GitHub
This behaviour used to work fine.
Im going to change category to bug
Ive looked at the implementation of BaseCameraPointersInput
, and it looks like its not calling onTouch… or rather it looks like the code is designed to not call onTouch on the second finger touch.
Im not really set up to debug and test the libraries in my development environment.
If the answer to the question is not clear, then I will set up to debug the library myself. Currently Im just pulling from CDN