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

Controller's 3D models might not be loaded with multiple interaction profiles #1445

Closed
svillar opened this issue Jun 11, 2024 · 0 comments · Fixed by #1446
Closed

Controller's 3D models might not be loaded with multiple interaction profiles #1445

svillar opened this issue Jun 11, 2024 · 0 comments · Fixed by #1446
Assignees

Comments

@svillar
Copy link
Member

svillar commented Jun 11, 2024

The current code assumes that there is a perfect 1-to-1 match between interaction profiles (or mappings as in the code) and devices. That was true by the FxR time. However that assumption is no longer true since we added support for cross device interaction profiles like hand interaction.

The OpenXR backend code triggers the 3D model loading after verifying that there is an active mapping. That works for most of the cases. However it does break in the following scenario:

  1. A device supports more than 1 profile, for example a specific profile for the device + hand interaction
  2. Wolvic is started without controllers, meaning that hand interaction profile is used. The hand interaction profile does not specify any 3D model so nothing happens.
  3. User picks up the controllers. The controllers ready callback is not called because it was deleted in the previous call to MaybeNotifyControllersReady() so no 3D model for the controllers would be loaded
@svillar svillar self-assigned this Jun 11, 2024
svillar added a commit that referenced this issue Jun 12, 2024
Now that hand interaction profile is available for some devices it
might happen that the user uses it at start time. That profile, as
it's meant to be used for hand tracking, does not require any
3D model (the hand 3D model uses hand tracking joints that are
not related to the hand interaction profile). This means that the
callback of OnControllersReady() in BrowserWorld will not load
any 3D model, and then DeviceDelegateOpenXR will uninstall the
callback. Then if the user ever grabs a physical controller,
the interaction profile will be updated (as we get notified by
the runtime), but no 3D models would be ever loaded for those
controllers as the callback is now null.

In order to fix that, the callback for OnControllersReady now
returns a boolean representing whether or not the 3D models
where loaded. If it's true then we can uninstall the callback
after completion. If it's false then we leave the callback
ready for eventual interaction profile changes.

Note that this do not support having multiple physical controllers
for a single device, but that scenario is unlikely to happen.

We have also moved the callback signature to a typedef, that
is not really required but it's better for robustness and
maintenance as it allows us to modify it in a single place.

Fixes #1445
svillar added a commit that referenced this issue Jun 14, 2024
Now that hand interaction profile is available for some devices it
might happen that the user uses it at start time. That profile, as
it's meant to be used for hand tracking, does not require any
3D model (the hand 3D model uses hand tracking joints that are
not related to the hand interaction profile). This means that the
callback of OnControllersReady() in BrowserWorld will not load
any 3D model, and then DeviceDelegateOpenXR will uninstall the
callback. Then if the user ever grabs a physical controller,
the interaction profile will be updated (as we get notified by
the runtime), but no 3D models would be ever loaded for those
controllers as the callback is now null.

In order to fix that, the callback for OnControllersReady now
returns a boolean representing whether or not the 3D models
where loaded. If it's true then we can uninstall the callback
after completion. If it's false then we leave the callback
ready for eventual interaction profile changes.

Note that this do not support having multiple physical controllers
for a single device, but that scenario is unlikely to happen.

We have also moved the callback signature to a typedef, that
is not really required but it's better for robustness and
maintenance as it allows us to modify it in a single place.

Fixes #1445
svillar added a commit that referenced this issue Jun 18, 2024
Now that hand interaction profile is available for some devices it
might happen that the user uses it at start time. That profile, as
it's meant to be used for hand tracking, does not require any
3D model (the hand 3D model uses hand tracking joints that are
not related to the hand interaction profile). This means that the
callback of OnControllersReady() in BrowserWorld will not load
any 3D model, and then DeviceDelegateOpenXR will uninstall the
callback. Then if the user ever grabs a physical controller,
the interaction profile will be updated (as we get notified by
the runtime), but no 3D models would be ever loaded for those
controllers as the callback is now null.

In order to fix that, the callback for OnControllersReady now
returns a boolean representing whether or not the 3D models
where loaded. If it's true then we can uninstall the callback
after completion. If it's false then we leave the callback
ready for eventual interaction profile changes.

Note that this do not support having multiple physical controllers
for a single device, but that scenario is unlikely to happen.

We have also moved the callback signature to a typedef, that
is not really required but it's better for robustness and
maintenance as it allows us to modify it in a single place.

Fixes #1445
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 a pull request may close this issue.

1 participant