Camera alpha and beta don't update during scroll

While creating a proof of concept, I encountered an issue with alpha and beta of the current camera not updating during scrolling.

My current Babylon version is 4.1.0-alpha.17

It happens in all these browsers, so likely not a browser issue:

  • Chrome Version 76.0.3809.132 (Official Build) (64-bit)
  • Edge Chromium Version 78.0.249.1 (Official build) dev (64-bit)
  • Edge 18.17763
  • Firefox 68.0.2 (64-bit)

How to reproduce:
Since it relies on scrolling, I am not able to get a demo to work in the playground, but here is a demo page: https://eloquent-kowalevski-bf2f65.netlify.com

When scrolling the page, the model of the camera “snaps” into position when the scrolling is done. In code I am updating the camera target, fov, alpha and beta. The “snapping” only happens for alpha and beta. It can best be seen when scrolling by holding the middle mouse button and moving the mouse. The rotation of the Babylon-camera doesn’t change until the scrolling stops. Here’s a video of what I mean: https://giphy.com/gifs/XBoaddYotA3kDU3f05/html5

The issue is that the actual value is getting updated - when you open the console, you can see the current alpha value of the active camera.

Here is the babylon code: BabylonScene.vue · GitHub

Let me know if I can do anything else to help tracking down the issue.

I guess the zoom from the camera (attached to the wheel) might conflict with your custom code.

Should you just not called attachControl in your case ?

1 Like

Good point, that shouldn’t have been there. I’ve removed attachControl and also set the third param of scene.createDefaultCamera to false, but unfortunately the issue still exists.

I’ve updated the example and for completeness, here’s the updated gist.

Can you repro in a playground with keyboards for instance instead of scroll event ?