[Babylon.js v4.1.0-beta.24] ArcRotateCamera doesn't change view with mouse movement in Safari, but works fine in Chrome

I cloned @renjianfeng’s BabylonTPSDemo, which uses Babylon.js v3.1-alpha and the ArcRotateCamera works perfectly in Chrome/Windows and Safari/Mac. However, when I change its index.html to use Babylon.js v4.1.0-beta.24, the ArcRotateCamera only responds to mouse movement in Chrome/Windows and fails to respond on Safari/Mac.

Please refer to the same playground in the Question: Raycast to check if player is standing on ground. This is a simplified version of @renjianfeng’s demo. Again, ArcRotateCamera only responds to mouse movement in Chrome/Windows and fails to respond on Safari/Mac.

The canvas.requestPointerLock() method seems to be working on Safari/Mac. But after activating pointer lock by clicking inside the scene, ArcRotateCamera doesn’t rotate according to mouse movements in Safari/Mac.

I can’t really test it because I don’t currently have a mac next to me, but can I ask why you are using an alpha version of 4.1? have you tried this with latest 4.2 alpha? or with 4.1 stable? does it react the same?

1 Like

Pinging @cedric who may be able to test

1 Like

I can repro the issue!

2 Likes

Thank you for checking in, @RaananW! As you mentioned, I should have updated to 4.2 in my local environment. However, according to the console log, it seems that the Playground uses Babylon.js v4.2.0-alpha.9 and has a similar issue on Safari/Mac.

Thank you @Deltakosh and @Cedric for helping repro the issue!

I should have mentioned earlier: ArcRotateCamera behaves as expected on Chrome/Mac (and Chrome/Windows), but not on Safari/Mac.

1 Like

Sounds good! I’ll try to find a fix next monday.

1 Like

I filled an issue [Input] PointerEvents and Safari · Issue #7995 · BabylonJS/Babylon.js · GitHub

2 Likes

Hi, shouldn’t the types for PointerInfo be updated? it seems that event now should rather be of type:

event: PointerEvent | MouseEvent | MouseWheelEvent;

Otherwise for desktop safari using pointer event specific fields (like pointerId) would lead to bugs since they’re not defined for mouse events :thinking:

1 Like

IIRC, @sebavan did some changes regarding this issue.

1 Like

I agree the typings might not be fully adequate but it is normally all handled in the input manager.

1 Like