Skip to content

Commit

Permalink
[OpenXR] Remove Khronos simple interaction profile
Browse files Browse the repository at this point in the history
We do have interaction profiles for all the supported
devices with physical controllers. We don't really need
it for the hand tracking only devices which should
work fine after the previous work that allows Wolvic
to run without any active mapping.

Allowing multiple interaction profiles has some
drawbacks and thus it's better to remove it. For example
in the case of Meta devices, if the Khronos simple
interaction profile is enabled, then we start to
receive not valid hand tracking data (like all the
flags being zero).

Fixes #1430
  • Loading branch information
svillar committed May 23, 2024
1 parent 2a5250d commit 39a9df7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
22 changes: 2 additions & 20 deletions app/src/openxr/cpp/OpenXRInputMappings.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace crow {
constexpr const char* kPathThumbstick { "input/thumbstick" };
constexpr const char* kPathThumbrest { "input/thumbrest" };
constexpr const char* kPathTrackpad { "input/trackpad" };
constexpr const char* kPathSelect { "input/select" };
constexpr const char* kPathMenu { "input/menu" };
constexpr const char* kPathBack { "input/back" };
constexpr const char* kPathHaptic { "output/haptic" };
Expand Down Expand Up @@ -391,25 +390,8 @@ namespace crow {
},
};

// Default fallback: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/generic/generic-button.json
const OpenXRInputMapping KHRSimple {
"/interaction_profiles/khr/simple_controller",
IS_3DOF,
"vr_controller_oculusgo.obj",
"vr_controller_oculusgo.obj",
device::UnknownType,
std::vector<OpenXRInputProfile> { "generic-button" },
std::vector<OpenXRButton> {
{ OpenXRButtonType::Trigger, kPathSelect, OpenXRButtonFlags::Click, OpenXRHandFlags::Both },
},
{},
std::vector<OpenXRHaptic> {
{ kPathHaptic, OpenXRHandFlags::Both },
},
};

const std::array<OpenXRInputMapping, 11> OpenXRInputMappings {
OculusTouch, OculusTouch2, MetaQuestTouchPro, Pico4x, PicoNeo3, Hvr6DOF, Hvr3DOF, LenovoVRX, MagicLeap2, MetaTouchPlus, KHRSimple
const std::array<OpenXRInputMapping, 10> OpenXRInputMappings {
OculusTouch, OculusTouch2, MetaQuestTouchPro, Pico4x, PicoNeo3, Hvr6DOF, Hvr3DOF, LenovoVRX, MagicLeap2, MetaTouchPlus
};

} // namespace crow
9 changes: 1 addition & 8 deletions app/src/openxr/cpp/OpenXRInputSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,8 @@ XrResult OpenXRInputSource::Initialize()
systemDoF = DoF::IS_6DOF;
}
for (auto& mapping: OpenXRInputMappings) {
// Always populate default/fall-back profiles
if (mapping.controllerType == device::UnknownType) {
mMappings.push_back(mapping);
// Use the system's deviceType instead to ensure we get a valid VRController on WebXR sessions
mMappings.back().controllerType = mDeviceType;
if (mDeviceType != mapping.controllerType)
continue;
} else if (mDeviceType != mapping.controllerType) {
continue;
}

if (systemDoF != mapping.systemDoF)
continue;
Expand Down

0 comments on commit 39a9df7

Please sign in to comment.