BaseCameraPointersInput doesn't handle 3+ touch points well

Hi all, seeing some interesting behavior when a user makes 3+ finger gestures on a phone.

This line assumes that if the pointer id is not from pointA it must be from pointB, but most devices support up to 5 touch points (navigator.maxTouchPoints).

So, when the user touches with three fingers, implementers or onMultiTouch will get move events for both the second and third fingers as if they were both move events for pointB. I think this class should just ignore move events for touch events that have pointerId different from this._pointA.pointerId and this._pointB.pointerId

Hello @heuristics7 , how are you doing?

Your assumption seems right. I will just double check with @PolygonalSun since he has a better understanding of the input system.

BaseCameraPointersInput should only support 2 inputs but running through the logic, it does look like a third input would mess things up. I think that it should be an easy enough fix so let me verify some things.

I’ve got a fix for it and once I write a quick test for it, I’ll create the PR for it. I’ll update when that’s live.

Thanks for the quick response!

PR is live: BaseCameraPointerInputs: Fixed logic to ignore extra touches by PolygonalSun · Pull Request #13468 · BabylonJS/Babylon.js (


PR is merged

1 Like