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

Use the the system's DeviceType for the generic input profile #1019

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

javifernandez
Copy link
Member

The generic input profile is associated to the device::UnknownType which uses an empty VR controller in mozilla. The consequence is that there no controller is drawn during WebXR experiences for devices using the generic profile (eg Lynx).

This issue had been fixed already in PR #834, but it got reverted because it broke the logic to detect generic profiles as fallbacks (see PR #907)

The solution proposed in this PR is to assign the DeviceType provided by the system to the ControllerDelegate instance, instead of the one provided by the generic profile.

Fixes #833

if (mActiveMapping->controllerType == device::UnknownType)
delegate.SetControllerType(mIndex, DeviceUtils::GetDeviceTypeFromSystem(false));
else
delegate.SetControllerType(mIndex, mActiveMapping->controllerType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this to happen in OpenXRInputSource::Initialize(). We can directly modify the mapping that is added to the mMappings vector.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done.

Copy link
Member

@svillar svillar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there

app/src/main/cpp/ExternalVR.cpp Show resolved Hide resolved
app/src/openxr/cpp/OpenXRInputSource.cpp Outdated Show resolved Hide resolved
The generic input profile has the device::UknomnType enumeraton. This
PR changes it by the one provided by Android.
Copy link
Member

@svillar svillar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@svillar svillar merged commit 033f5bd into main Sep 29, 2023
18 checks passed
@svillar svillar deleted the lynx-webxr-controllers branch September 29, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No hand interaction at all in the Moonrider game
3 participants