BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.83k stars 3.4k forks source link

[Native] Pointer capture release #13920

Closed CedricGuillemet closed 1 year ago

CedricGuillemet commented 1 year ago

Reported by forum user: "Actually another strange blocker issue we encountered and can replicate in the sample app, is that if we use a gizmo with JSC or Hermes, mesh picking and gizmo dragging stops working immediately after dragging the camera (pan, rotate etc) for the first time, and can’t be restored without an app restart. There is no issue when using V8, which makes no sense I realise. It’s as though the native camera controls hijack drag events and won’t let go, but only when using JSC or Hermes JS engines." and a video: https://drive.google.com/file/d/1lfepPOMaM8IX4K5puqOGfQRf-M4dksaH/view I could repro with his branch on Android. After hours of debugging, I've found the buttons is undefined here: https://github.com/BabylonJS/Babylon.js/blob/7cee15e89e995cd466e18e5a1b78e0b6432f85da/packages/dev/core/src/Inputs/scene.inputManager.ts#L937 if I change the test, everything is fine. I've also tested on web but execution never reaches that particular line as _pointerCaptures is already false at this point: https://github.com/BabylonJS/Babylon.js/blob/7cee15e89e995cd466e18e5a1b78e0b6432f85da/packages/dev/core/src/Inputs/scene.inputManager.ts#L928

I tried to repro with BabylonNative but I can't click & drag the gizmo. Any reason for that?

brian-hay commented 1 year ago

The original report came from me.

I'm unsure if this needs a separate ticket but something related that I've noticed is that dragging/picking is also broken if I use hardware scaling other than 1.0 in Babylon React Native.

CedricGuillemet commented 1 year ago

The original report came from me.

I'm unsure if this needs a separate ticket but something related that I've noticed is that dragging/picking is also broken if I use hardware scaling other than 1.0 in Babylon React Native.

I think this should be captured in this issue : https://github.com/BabylonJS/BabylonReactNative/issues/392

PolygonalSun commented 1 year ago

Fixed in BJS: https://github.com/BabylonJS/Babylon.js/pull/14043

sebavan commented 1 year ago

Update is live in Babylon Native.