-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
auto gotHandTrackingInfo = false; | ||
auto handFacesHead = false; | ||
if (isControllerUnavailable || mUsingHandInteractionProfile) { | ||
if (handTrackingEnabled && (isControllerUnavailable || mUsingHandInteractionProfile)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
1dacfe8
to
efaa0f7
Compare
app/src/main/cpp/BrowserWorld.cpp
Outdated
@@ -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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
efaa0f7
to
4b63eff
Compare
4b63eff
to
76454ec
Compare
76454ec
to
9208465
Compare
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.
9208465
to
13a4ce4
Compare
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). |
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.