Issue with DeviceOrientationCamera when a scene is righthanded

I’m afraid I found a bug that relates to how DeviceOrientationCamera behaves when a scene is right handed.

When a scene uses a right handed coordinate system and a DeviceOrientationCamera, the translation on a phone is inverted on the x-axis.

Here is a example showing the issue:
https://playground.babylonjs.com/#14KRGG#1368

Does anyone have an idea how I might work around this? Can I somehow invert the x-axis on the camera, so it behaves correct?

Wow, we haven’t had an issue with this camera in ages! I think most people started using the XR camera instead, but it is only working on Android devices.

It is more than possible that we don’t convert the values correctly when in RHS. Should be a straight-forward fix, i’ll look into that later today

2 Likes

Yes unfortunate I’m also dependent on iPhone…
If Apple could just release WebXR this would have been much easier :slight_smile:

CC Tim Cook :wink:

Fix was pushed - Fix mirroring on RHS for device orientation camera by RaananW · Pull Request #15425 · BabylonJS/Babylon.js (github.com)

2 Likes