Weird behavior with UniversalCamera and rotation property

For me it also works in Firefox for Android, so it might be OS dependent. My original tests were on Windows.

1 Like

I tested on Mac where it worked too, so I guess the issue using quaternions is only on FireFox on Windows so far then…

But on other devices and browsers it seems like if it works when we convert from Euler angles to quaternion manually then it should be able to work when we let Babylon do that conversion for us… :thinking: :beers:

Here’s a PR that fixes the issue in the below playground, which is the one that was created by @roland. Previously _rotateUpVectorWithCameraRotationMatrix was called only when the z property of the rotation changed, but now it is called if any property of the rotation vector changes. This fixed the issue for me on Chrome and Firefox on Mac. :slight_smile:

https://playground.babylonjs.com/#F68Z6N#4

1 Like

Who is da maaaan? You are da maaan! :muscle:

Thank you for solving the puzzle for usšŸ˜Ž

1 Like

Welp, my PR fixed one issue but looks like I broke some other things that fail validation… Hopefully it will help narrow down the search for a solution thou and I can take another try at it later tomorrow, but the puzzle continues… :wink: :sleeping:

1 Like

It’s the up vector test - Load GUI From Snippet Server | Babylon.js Playground (babylonjs.com)

It seems to not rotate when your changes are on:

image

1 Like

Thanks @RaananW, I made a little update to the PR that validates successfully and fixes that issue, by converting the rotation vector to a temp quaternion and then comparing that quaternion’s z value to the cached value. The idea was to update the upVector under the same circumstances as when a quaternion is used, which fixes the issue flagged in the playground.

Edit: on GitHub it says that it’s passed all the checks successfully now! :slightly_smiling_face:

1 Like

Hey @Blake, I just pulled your branch down and I just wanted to verify that your PR fixes just Scenario F and the modified form of Scenario F in that PG that rotates everything around. Is that correct? Reason I’m asking is because Scenario B shows no change.

1 Like

Yes it’s only Scenario F that I was working on, it looks like it’s merged now thou, so I’ll look into the others next when I get the chance, IDK if I’ll have as much luck thou on any of those ones. :slight_smile: :beers:

3 Likes

Sounds good man! I appreciate you pushing up that fix.

2 Likes

Hi! Just checking up @PolygonalSun is there still an issue for the other scenarios? Want me to create a GitHub issue to track it? :slight_smile:

1 Like