diff --git a/client/application.cpp b/client/application.cpp index 026aa151..6da77f71 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -131,7 +131,7 @@ static std::vector interaction_profiles{ "/user/hand/right/input/thumbrest/touch", }}, interaction_profile{ - " /interaction_profiles/facebook/touch_controller_pro", + "/interaction_profiles/facebook/touch_controller_pro", {"XR_FB_touch_controller_pro"}, { "/user/hand/left/output/haptic", @@ -185,7 +185,7 @@ static std::vector interaction_profiles{ "/user/hand/right/input/thumb_fb/proximity_fb", }}, interaction_profile{ - " /interaction_profiles/meta/touch_pro_controller", + "/interaction_profiles/meta/touch_pro_controller", {"XR_VERSION_1_1"}, { "/user/hand/left/output/haptic", @@ -241,7 +241,7 @@ static std::vector interaction_profiles{ }}, interaction_profile{ - " /interaction_profiles/meta/touch_controller_plus", + "/interaction_profiles/meta/touch_controller_plus", {"XR_META_touch_controller_plus"}, { "/user/hand/left/output/haptic", @@ -289,7 +289,7 @@ static std::vector interaction_profiles{ }}, interaction_profile{ - " /interaction_profiles/meta/touch_plus_controller", + "/interaction_profiles/meta/touch_plus_controller", {"XR_VERSION_1_1"}, { "/user/hand/left/output/haptic", @@ -999,20 +999,23 @@ void application::initialize_actions() for (const scene::suggested_binding & j: i->bindings) { - // Skip unsupported profiles - if (!suggested_bindings.contains(j.profile_name)) - continue; - - std::vector & xr_bindings = suggested_bindings[j.profile_name]; - - for (const scene::action_binding & k: j.paths) + for (const auto & profile: j.profile_names) { - XrAction a = i->actions_by_name[k.action_name].first; - assert(a != XR_NULL_HANDLE); + // Skip unsupported profiles + if (!suggested_bindings.contains(profile)) + continue; - xr_bindings.push_back(XrActionSuggestedBinding{ - .action = a, - .binding = string_to_path(k.input_source)}); + std::vector & xr_bindings = suggested_bindings[profile]; + + for (const scene::action_binding & k: j.paths) + { + XrAction a = i->actions_by_name[k.action_name].first; + assert(a != XR_NULL_HANDLE); + + xr_bindings.push_back(XrActionSuggestedBinding{ + .action = a, + .binding = string_to_path(k.input_source)}); + } } } } diff --git a/client/scene.h b/client/scene.h index 7d2533cb..d7412a14 100644 --- a/client/scene.h +++ b/client/scene.h @@ -43,7 +43,7 @@ public: struct suggested_binding { - std::string profile_name; + std::vector profile_names; std::vector paths; }; diff --git a/client/scenes/lobby.cpp b/client/scenes/lobby.cpp index 44533091..f60e8cd2 100644 --- a/client/scenes/lobby.cpp +++ b/client/scenes/lobby.cpp @@ -1256,7 +1256,17 @@ scene::meta & scenes::lobby::get_meta_scene() }, .bindings = { suggested_binding{ - "/interaction_profiles/oculus/touch_controller", + { + "/interaction_profiles/oculus/touch_controller", + "/interaction_profiles/facebook/touch_controller_pro", + "/interaction_profiles/meta/touch_pro_controller", + "/interaction_profiles/meta/touch_controller_plus", + "/interaction_profiles/meta/touch_plus_controller", + "/interaction_profiles/bytedance/pico_neo3_controller", + "/interaction_profiles/bytedance/pico4_controller", + "/interaction_profiles/bytedance/pico4s_controller", + "/interaction_profiles/htc/vive_focus3_controller", + }, { {"left_aim", "/user/hand/left/input/aim/pose"}, {"left_trigger", "/user/hand/left/input/trigger/value"}, @@ -1274,79 +1284,9 @@ scene::meta & scenes::lobby::get_meta_scene() }, }, suggested_binding{ - "/interaction_profiles/bytedance/pico_neo3_controller", { - {"left_aim", "/user/hand/left/input/aim/pose"}, - {"left_trigger", "/user/hand/left/input/trigger/value"}, - {"left_squeeze", "/user/hand/left/input/squeeze/value"}, - {"left_scroll", "/user/hand/left/input/thumbstick"}, - {"left_haptic", "/user/hand/left/output/haptic"}, - {"right_aim", "/user/hand/right/input/aim/pose"}, - {"right_trigger", "/user/hand/right/input/trigger/value"}, - {"right_squeeze", "/user/hand/right/input/squeeze/value"}, - {"right_scroll", "/user/hand/right/input/thumbstick"}, - {"right_haptic", "/user/hand/right/output/haptic"}, - - {"recenter_left", "/user/hand/left/input/x/click"}, - {"recenter_right", "/user/hand/right/input/a/click"}, + "/interaction_profiles/khr/simple_controller", }, - }, - suggested_binding{ - "/interaction_profiles/bytedance/pico4_controller", - { - {"left_aim", "/user/hand/left/input/aim/pose"}, - {"left_trigger", "/user/hand/left/input/trigger/value"}, - {"left_squeeze", "/user/hand/left/input/squeeze/value"}, - {"left_scroll", "/user/hand/left/input/thumbstick"}, - {"left_haptic", "/user/hand/left/output/haptic"}, - {"right_aim", "/user/hand/right/input/aim/pose"}, - {"right_trigger", "/user/hand/right/input/trigger/value"}, - {"right_squeeze", "/user/hand/right/input/squeeze/value"}, - {"right_scroll", "/user/hand/right/input/thumbstick"}, - {"right_haptic", "/user/hand/right/output/haptic"}, - - {"recenter_left", "/user/hand/left/input/x/click"}, - {"recenter_right", "/user/hand/right/input/a/click"}, - }, - }, - suggested_binding{ - "/interaction_profiles/bytedance/pico4s_controller", - { - {"left_aim", "/user/hand/left/input/aim/pose"}, - {"left_trigger", "/user/hand/left/input/trigger/value"}, - {"left_squeeze", "/user/hand/left/input/squeeze/value"}, - {"left_scroll", "/user/hand/left/input/thumbstick"}, - {"left_haptic", "/user/hand/left/output/haptic"}, - {"right_aim", "/user/hand/right/input/aim/pose"}, - {"right_trigger", "/user/hand/right/input/trigger/value"}, - {"right_squeeze", "/user/hand/right/input/squeeze/value"}, - {"right_scroll", "/user/hand/right/input/thumbstick"}, - {"right_haptic", "/user/hand/right/output/haptic"}, - - {"recenter_left", "/user/hand/left/input/x/click"}, - {"recenter_right", "/user/hand/right/input/a/click"}, - }, - }, - suggested_binding{ - "/interaction_profiles/htc/vive_focus3_controller", - { - {"left_aim", "/user/hand/left/input/aim/pose"}, - {"left_trigger", "/user/hand/left/input/trigger/value"}, - {"left_squeeze", "/user/hand/left/input/squeeze/value"}, - {"left_scroll", "/user/hand/left/input/thumbstick"}, - {"left_haptic", "/user/hand/left/output/haptic"}, - {"right_aim", "/user/hand/right/input/aim/pose"}, - {"right_trigger", "/user/hand/right/input/trigger/value"}, - {"right_squeeze", "/user/hand/right/input/squeeze/value"}, - {"right_scroll", "/user/hand/right/input/thumbstick"}, - {"right_haptic", "/user/hand/right/output/haptic"}, - - {"recenter_left", "/user/hand/left/input/x/click"}, - {"recenter_right", "/user/hand/right/input/a/click"}, - }, - }, - suggested_binding{ - "/interaction_profiles/khr/simple_controller", { {"left_aim", "/user/hand/left/input/aim/pose"}, {"left_trigger", "/user/hand/left/input/select/click"}, diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index e74954d3..e38448fd 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -1230,35 +1230,25 @@ scene::meta & scenes::stream::get_meta_scene() }, .bindings = { suggested_binding{ - "/interaction_profiles/oculus/touch_controller", + { + "/interaction_profiles/oculus/touch_controller", + "/interaction_profiles/facebook/touch_controller_pro", + "/interaction_profiles/meta/touch_pro_controller", + "/interaction_profiles/meta/touch_controller_plus", + "/interaction_profiles/meta/touch_plus_controller", + "/interaction_profiles/bytedance/pico_neo3_controller", + "/interaction_profiles/bytedance/pico4_controller", + "/interaction_profiles/htc/vive_focus3_controller", + }, { {"plots_toggle_1", "/user/hand/left/input/thumbstick/click"}, {"plots_toggle_2", "/user/hand/right/input/thumbstick/click"}, }, }, suggested_binding{ - "/interaction_profiles/bytedance/pico_neo3_controller", { - {"plots_toggle_1", "/user/hand/left/input/thumbstick/click"}, - {"plots_toggle_2", "/user/hand/right/input/thumbstick/click"}, + "/interaction_profiles/khr/simple_controller", }, - }, - suggested_binding{ - "/interaction_profiles/bytedance/pico4_controller", - { - {"plots_toggle_1", "/user/hand/left/input/thumbstick/click"}, - {"plots_toggle_2", "/user/hand/right/input/thumbstick/click"}, - }, - }, - suggested_binding{ - "/interaction_profiles/htc/vive_focus3_controller", - { - {"plots_toggle_1", "/user/hand/left/input/thumbstick/click"}, - {"plots_toggle_2", "/user/hand/right/input/thumbstick/click"}, - }, - }, - suggested_binding{ - "/interaction_profiles/khr/simple_controller", {}, }, },