Igalia / wolvic

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

Fix position/orientation computations of flat widgets with curved parents #1381

Closed svillar closed 5 months ago

svillar commented 5 months ago

Some widgets are always rendered flat even in curved mode, like the tray bar. What we do in multiwindow environments is basically rotate it following the rotation of their parent windows. However that was not working well when not using OpenXR layers and non-default window distances.

Replaced the code by a different computation that provides much better and natural results as the widgets now face the user and it's much easier to type in the keyboard for example. Speaking of which, we had to force the keyboard not to be in curved mode. We were doing that for the layers case but we do it now as well for the non-layers case as we started to suffer from the same issues.

svillar commented 5 months ago

Well, it's an improvement, but the tray and keyboard widgets are still not parallel to the window's 'x' axis.

The behavior is the same in other devices without layers support, so I guess we can merge this and continue fine-tuning the alignment in a follow up patch.

Note that making it parallel to the window x axis will make them face a point in front of the user. The reason for that is that windows do not face the user but the center of a cylinder which is not located in the same position as the user.