Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MobileVR: Orientation is progressive and needs to be initialized #91305

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

BastiaanOlij
Copy link
Contributor

@BastiaanOlij BastiaanOlij commented Apr 29, 2024

Somewhere in converting our native mobile implementation from Godot 3 to Godot 4 we broke the orientation logic.
Orientation used to be a member variable which is cumulative, either mixing in new magneto data or adjusting with gyro data.
In the new logic orientation is a local variable that is not initialised and we lost this cumulation of values. As we store the new orientation in the head transform, we can initialise our variable with this value as well.

Tested on Pixel 6 and works fine on that now.

This fixes the orientation issue reported in #89755
I could not reproduce the flickering issue reported in that same issue, however I believe that may be a Qualcomm issue, or something entirely unrelated.

This PR also does not address:

  • predicting head location at display time
  • configuring sensor data update rate to a higher than default setting

Test project, works both on desktop (but without the gyro) and on mobile (though no inputs to move, just for testing orientation):
TestMobileVR.zip

@BastiaanOlij BastiaanOlij added bug topic:xr cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Apr 29, 2024
@BastiaanOlij BastiaanOlij added this to the 4.3 milestone Apr 29, 2024
@BastiaanOlij BastiaanOlij requested a review from a team as a code owner April 29, 2024 11:52
@BastiaanOlij BastiaanOlij self-assigned this Apr 29, 2024
@akien-mga akien-mga changed the title MobileVR: orientation is progressive and needs to be initialised MobileVR: Orientation is progressive and needs to be initialized Apr 29, 2024
@akien-mga akien-mga merged commit f03301c into godotengine:master Apr 29, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@AlanZhouSS
Copy link

Test project :TestMobileVR.zip
I use Godot 3.5 and mobileVR works fine on my device. When I use the new Godot 4.2 or 4.3rc1, the screen is in a messy rotation state. My device is rokid max + station

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release topic:xr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants