ArcRotateCamera no rotation on Iphone

I have already commented here, but being an old thread I thought maybe it would make sense to create a new one.

I am experiencing no rotation with ArcRotateCamera (but probably the problem isn’t camera type specific), using Iphone7 IOS12 .
I know from a fact that Iphone7 with IOS14 works, and Iphone8 with IOS13 works too.

Looking at this PG getting mouse and no rotation seem highly correlated.

I have no idea what I could do to tackle this. Can anybody help?

I am referring to ‘rotation’ because being on BrowserStack that’s all I can check, but I am pretty also 2 fingers gestures are affected.

Thank you

Pinging @Cedric

Let me see if I can check on simulator …

Hi @Cedric,

I have tried having a look

  1. Iphone IOS12 does not have window.PointerEvent nor navigator.pointerEnabled, so BABYLON.Tools.GetPointerPrefix() returns ‘mouse’ Babylon.js/tools.ts at bfdfdab7a13bd22915c0eca320f08a61cb560d8d · BabylonJS/Babylon.js · GitHub
  2. Even adjusting for that, Pointer events in IOS12 seem to be ‘touch’ prefixed, rather than ‘pointer’, so the events attached via DeviceInputSystem._handlePointerActions that use prefix from GetPointerPrefix won’t fire. Babylon.js/deviceInputSystem.ts at bfdfdab7a13bd22915c0eca320f08a61cb560d8d · BabylonJS/Babylon.js · GitHub

I used this to check the event name. I get ‘pointer’ on IOS13 and above and ‘touch’ on IOS12 and below.

So I tried making a small change in GetPointerPrefix via Gitpod

if (eventPrefix === "mouse" && hasTouchend) {
  eventPrefix = "touch";
return prefix;

And now in Playground I get this error :frowning_face:


I am testing this in BrowserStack, and breakpoints don’t work. I don’t think I can manage to do much more than this.

This is the url to the Gitpod container

That’s far beyond my knowledge on input. Pinging @PolygonalSun

@PolygonalSun (or whoever is willing and able)
Any chance you could give me a hand with this?

Lemme take a look at this and see what’s going on

1 Like

Hey @PolygonalSun, have you figured out anything?
Sorry if I insist, but it is unfortunately imperative for us to support IOS 12 in our Babylonjs project.

Let me know if you have any news. Thank you

So here’s what I’ve got so far. If the event is being treated like a TouchEvent, rather than a PointerEvent, this would explain the error. First, we track all touches with pointerId, which TouchEvent doesn’t have. The biggest issue that I’ve been encountering is finding a way to debug this, as I don’t have a device with iOS 12.

The best way that I could think to fix this would be to find a good way to identify when dealing with TouchEvents and then have a proper way to assign and track their ids, as though they were pointerIds

Hey @PolygonalSun,
Thank a lot for looking into it.

I think I solved it! :partying_face:

Importing pepjs (Pointer Events Polyfill) seems enough get pointer events going

This PG works for me on IOS12 and even 11 (browserstack)

1 Like