Heya,
On mobile device, pinch zoom triggers OnPickTrigger. So when pinch zooming over a model the model gets selected. Is this expected behavior?
Heya,
On mobile device, pinch zoom triggers OnPickTrigger. So when pinch zooming over a model the model gets selected. Is this expected behavior?
As a workaround to actionManager I used onPointerObservable and checked the time between pointerdown and pick.
scene.onPointerObservable.add((e) => {
switch (e.type) {
case BABYLON.PointerEventTypes.POINTERDOWN:
if (e.pickInfo.pickedMesh) {
startTime = performance.now()
}
break;
case BABYLON.PointerEventTypes.POINTERPICK:
if (e.pickInfo.pickedMesh) {
endTime = performance.now()
if (endTime - startTime < 250)
//
}
break;
}
});
But I’m guessing there is a more elegant solution to this using actions?
AFAIK, a POINTERPICK shouldn’t happen during a pinch gesture. Lemme take a closer look and verify something.
So, I’m able to intermittently repro this. I suspect that the code that determines if a pointer is swiping or not isn’t accounting for the multi-pointer gesture. I think I know how to fix this but let me test a couple of things.
Sorry to bother you here again, but is there a solution to this problem?
@PolygonalSun
cc @amoebachant
Hi @superTigery, sorry I’ve been traveling for Thanksgiving and wasn’t able to look at this sooner. I am able to repro this as well and we’ll need to do a fix to prevent the pinch from firing the pick trigger.
Here’s a simple repro: https://playground.babylonjs.com/#T9Z53V#1 (pinch zoom on the sphere and you’ll see the light toggles intensity when it shouldn’t).
I looked for a quick workaround, but onPointerUp is raised before Pick is triggered, so it’s not simple to detect if you’re in the pinch case and ignore the pick trigger using an ExecuteCodeAction.
I’ll let you know when we have a fix ready, or if I find another workaround for you in the meantime.
Thanks again for your patience!
Thank you for your patient explanation. I am looking forward to it and I am very sorry that I interrupted your traveling
Hi @superTigery, no worries, you didn’t interrupt my travels, I was just slower to respond than normal.
I just checked in a fix so that multi-touch operations such as a pinch won’t trigger the picking of a mesh. It should be available in the next patch update later this week.
Thanks for bringing this to my attention and have a great day!