Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
813 stars 105 forks source link

[Vison Glass] Don't invert the vertical axis #1462

Closed felipeerias closed 4 months ago

felipeerias commented 4 months ago

Correct a bug that happens often when using the Vision Glass: moving the phone upwards makes the pointer move downwards, and viceversa

felipeerias commented 4 months ago

@svillar @javifernandez

There might be a problem with how we get the rotation information, because sometimes the vertical axis is inverted.

This bug does not happen all the time, which is why I am marking this PR as a draft for now.

felipeerias commented 4 months ago

This bug can be reproduced by launching Wolvic and turning slowly to your right. At one point (~90-180 degrees) the controller starts to misbehave. Turn back to your starting position and it works fine again. The recenter button does not fix the bug.

If you monitor the quaternion that we receive from the system while moving the phone slowly, there is a point where the values change from

X > 0, Y < 0, Z < 0

to

X < 0, Y > 0, Z > 0

Roughly the same direction but pointing in the opposite way. I think that this might be the root cause of the bug.

svillar commented 4 months ago

Does it make sense to have this opened? We won't ever merge it as it is now

felipeerias commented 4 months ago

I have opened issue https://github.com/Igalia/wolvic/issues/1484 to discuss this bug.