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

New Controller's setting to disable hand tracking #1514

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

javifernandez
Copy link
Member

There maybe be cases where the user wants to prevent the hand tracking to take the control when the controllers got untracked.

This change defines a new switch in the Controller's settings dialog to to disable the hand trakckig capabilities. This setting has been defined as non-persistent, so it will be reset just restarting Wolvic.

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.

It needs more work

@@ -121,6 +121,9 @@ public static boolean isLynx() {
public static boolean isSnapdragonSpaces() {
return BuildConfig.FLAVOR_platform.toLowerCase().contains("spaces");
}
public static boolean isMagicLeap2() {
return BuildConfig.FLAVOR_platform.toLowerCase().contains("aosp");
Copy link
Member

Choose a reason for hiding this comment

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

AOSP is not only for MagicLeap although currently it is indeed the main platform, but doing this kind of things will limit us for the future. Anyway this won't be needed if you follow my suggestions above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it, I've removed this and followed the suggestion above.

app/src/openxr/cpp/OpenXRInput.h Show resolved Hide resolved
auto gotHandTrackingInfo = false;
auto handFacesHead = false;
if (isControllerUnavailable || mUsingHandInteractionProfile) {
if (handTrackingEnabled && (isControllerUnavailable || mUsingHandInteractionProfile)) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm I am not sure this is enough. This should be enough indeed for devices like Meta or Pico in which we emulate the controller with the hands. However for devices supporting the hand interaction profile it will just prevent the hands from being rendered. The aim will still be available, so I think you could still be able to click on UI elements even if no pointer or hands are being rendered.

Copy link
Member Author

Choose a reason for hiding this comment

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

True; I've changed the implementation to consider the case of using the hand interaction profile.

@@ -973,6 +973,7 @@ BrowserWorld::InitializeJava(JNIEnv* aEnv, jobject& aActivity, jobject& aAssetMa
m.controllers->InitializeBeam();
m.controllers->SetPointerColor(vrb::Color(VRBrowser::GetPointerColor()));
m.rootController->AddNode(m.controllers->GetRoot());
VRBrowser::OnControllersAvailable();
Copy link
Member

Choose a reason for hiding this comment

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

Hmm this does not guarantee that the device has physical controllers. In the case of OpenXR this callback is executed whenever the device delegate has created the OpenXRInput object which does happen with or without physical controllers.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see; am I wrong assuming that a non-null ActiveInputMapping indicates the presence of physical controllers ? In that case, we can use the OnControllersReady callback, which is only called when there is an active input mapping, I know that this could happen as well for devices using the hand tracking input profile, but in that case we could check whether there is more than one input mapping.

What do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes I think we could assume that a non-null active input mapping (unless it's the hand interaction profile) means having physical controllers.

app/src/main/cpp/BrowserWorld.h Outdated Show resolved Hide resolved
app/src/openxr/cpp/DeviceDelegateOpenXR.cpp Outdated Show resolved Hide resolved
app/src/openxr/cpp/OpenXRInputSource.h Outdated Show resolved Hide resolved
app/src/openxr/cpp/OpenXRInput.cpp Outdated Show resolved Hide resolved
There maybe be cases where the user wants to prevent the hand tracking
to take the control when the controllers got untracked.

This change defines a new switch in the Controller's settings dialog to
to disable the hand trakckig capabilities. This setting has been defined
as non-persistent, so it will be reset just restarting Wolvic.
@svillar
Copy link
Member

svillar commented Sep 9, 2024

So I've finally tested this and I am no longer sure this is something we want in its current form. The thing is that the setting don't really disable hand tracking, it just disables the input source (and then effectively hand tracking), which means that we also disable the physical controller. The consequence is that if we leave the controller over the table then hand tracking code will still kick in and the controller will be hidden until we grab it again.

If that's what we want, the patch is good, but if not we should rethink how we want to do it (note that completely disabling hand tracking will require a restart of the app).

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.

2 participants