add frame controller profile

This commit is contained in:
galister
2026-09-27 17:14:33 +09:00
parent ef81d500ca
commit 596e661d7e
8 changed files with 767 additions and 53 deletions
+62
View File
@@ -477,6 +477,68 @@ static std::vector<interaction_profile> interaction_profiles{
"/user/hand/right/input/squeeze/value",
},
},
interaction_profile{
.profile_name = "/interaction_profiles/valve/frame_controller_valve",
.required_extensions = {"XR_VALVE_frame_controller_interaction"},
.input_sources = {
"/user/hand/right/output/haptic",
"/user/hand/left/output/haptic",
"/user/hand/right/input/grip/pose",
"/user/hand/left/input/grip/pose",
"/user/hand/right/input/aim/pose",
"/user/hand/left/input/aim/pose",
"/user/hand/right/input/a/touch",
"/user/hand/right/input/a/click",
"/user/hand/right/input/b/touch",
"/user/hand/right/input/b/click",
"/user/hand/right/input/x/touch",
"/user/hand/right/input/x/click",
"/user/hand/right/input/y/touch",
"/user/hand/right/input/y/click",
"/user/hand/right/input/menu/touch",
"/user/hand/right/input/menu/click",
"/user/hand/right/input/system/touch",
"/user/hand/right/input/system/click",
"/user/hand/right/input/bumper/touch",
"/user/hand/right/input/bumper/click",
"/user/hand/right/input/squeeze/touch",
"/user/hand/right/input/squeeze/click",
"/user/hand/right/input/squeeze/value",
"/user/hand/right/input/trigger/touch",
"/user/hand/right/input/trigger/click",
"/user/hand/right/input/trigger/value",
"/user/hand/right/input/thumbstick/touch",
"/user/hand/right/input/thumbstick/click",
"/user/hand/right/input/thumbstick",
"/user/hand/left/input/dpad_up/touch",
"/user/hand/left/input/dpad_up/click",
"/user/hand/left/input/dpad_left/touch",
"/user/hand/left/input/dpad_left/click",
"/user/hand/left/input/dpad_down/touch",
"/user/hand/left/input/dpad_down/click",
"/user/hand/left/input/dpad_right/touch",
"/user/hand/left/input/dpad_right/click",
"/user/hand/left/input/view/touch",
"/user/hand/left/input/view/click",
"/user/hand/left/input/system/touch",
"/user/hand/left/input/system/click",
"/user/hand/left/input/bumper/touch",
"/user/hand/left/input/bumper/click",
"/user/hand/left/input/squeeze/touch",
"/user/hand/left/input/squeeze/click",
"/user/hand/left/input/squeeze/value",
"/user/hand/left/input/trigger/touch",
"/user/hand/left/input/trigger/click",
"/user/hand/left/input/trigger/value",
"/user/hand/left/input/thumbstick/touch",
"/user/hand/left/input/thumbstick/click",
"/user/hand/left/input/thumbstick",
},
},
interaction_profile{
.profile_name = "/interaction_profiles/yvr/touch_controller_yvr",
.input_sources = {
+2
View File
@@ -18,6 +18,7 @@
*/
#include "lobby.h"
#include "application.h"
#include "configuration.h"
#include "constants.h"
@@ -1438,6 +1439,7 @@ scene::meta & scenes::lobby::get_meta_scene()
"/interaction_profiles/bytedance/pico4s_controller",
"/interaction_profiles/yvr/touch_controller_yvr",
"/interaction_profiles/htc/vive_focus3_controller",
"/interaction_profiles/valve/frame_controller_valve",
},
{
{"left_aim", "/user/hand/left/input/aim/pose"},
+32 -6
View File
@@ -55,13 +55,28 @@ using namespace beman::inplace_vector;
// clang-format off
static const std::unordered_map<std::string, device_id> device_ids = {
{"/user/hand/left/input/x/click", device_id::X_CLICK},
{"/user/hand/left/input/x/touch", device_id::X_TOUCH},
{"/user/hand/left/input/y/click", device_id::Y_CLICK},
{"/user/hand/left/input/y/touch", device_id::Y_TOUCH},
{"/user/hand/left/input/menu/click", device_id::MENU_CLICK},
{"/user/hand/left/input/dpad_up/click", device_id::DPAD_UP_CLICK},
{"/user/hand/left/input/dpad_up/touch", device_id::DPAD_UP_TOUCH},
{"/user/hand/left/input/dpad_down/click", device_id::LEFT_X_CLICK},
{"/user/hand/left/input/dpad_down/touch", device_id::LEFT_X_TOUCH},
{"/user/hand/left/input/dpad_left/click", device_id::DPAD_LEFT_CLICK},
{"/user/hand/left/input/dpad_left/touch", device_id::DPAD_LEFT_TOUCH},
{"/user/hand/left/input/dpad_right/click", device_id::LEFT_Y_CLICK},
{"/user/hand/left/input/dpad_right/touch", device_id::LEFT_Y_TOUCH},
{"/user/hand/left/input/x/click", device_id::LEFT_X_CLICK},
{"/user/hand/left/input/x/touch", device_id::LEFT_X_TOUCH},
{"/user/hand/left/input/y/click", device_id::LEFT_Y_CLICK},
{"/user/hand/left/input/y/touch", device_id::LEFT_Y_TOUCH},
{"/user/hand/left/input/view/click", device_id::VIEW_CLICK},
{"/user/hand/left/input/view/touch", device_id::VIEW_TOUCH},
{"/user/hand/left/input/menu/click", device_id::LEFT_MENU_CLICK},
{"/user/hand/left/input/system/click", device_id::LEFT_MENU_CLICK},
{"/user/hand/left/input/system/touch", device_id::LEFT_SYSTEM_TOUCH},
{"/user/hand/left/input/bumper/click", device_id::LEFT_BUMPER_CLICK},
{"/user/hand/left/input/bumper/touch", device_id::LEFT_BUMPER_TOUCH},
{"/user/hand/left/input/squeeze/click", device_id::LEFT_SQUEEZE_CLICK},
{"/user/hand/left/input/squeeze/force", device_id::LEFT_SQUEEZE_FORCE},
{"/user/hand/left/input/squeeze/touch", device_id::LEFT_SQUEEZE_TOUCH},
{"/user/hand/left/input/squeeze/value", device_id::LEFT_SQUEEZE_VALUE},
{"/user/hand/left/input/trigger/value", device_id::LEFT_TRIGGER_VALUE},
{"/user/hand/left/input/trigger/click", device_id::LEFT_TRIGGER_CLICK},
@@ -94,9 +109,19 @@ static const std::unordered_map<std::string, device_id> device_ids = {
{"/user/hand/right/input/a/touch", device_id::A_TOUCH},
{"/user/hand/right/input/b/click", device_id::B_CLICK},
{"/user/hand/right/input/b/touch", device_id::B_TOUCH},
{"/user/hand/right/input/system/click", device_id::SYSTEM_CLICK},
{"/user/hand/right/input/x/click", device_id::RIGHT_X_CLICK},
{"/user/hand/right/input/x/touch", device_id::RIGHT_X_TOUCH},
{"/user/hand/right/input/y/click", device_id::RIGHT_Y_CLICK},
{"/user/hand/right/input/y/touch", device_id::RIGHT_Y_TOUCH},
{"/user/hand/right/input/system/click", device_id::RIGHT_SYSTEM_CLICK},
{"/user/hand/right/input/system/touch", device_id::RIGHT_SYSTEM_TOUCH},
{"/user/hand/right/input/menu/click", device_id::RIGHT_MENU_CLICK},
{"/user/hand/right/input/menu/touch", device_id::RIGHT_MENU_TOUCH},
{"/user/hand/right/input/bumper/click", device_id::RIGHT_BUMPER_CLICK},
{"/user/hand/right/input/bumper/touch", device_id::RIGHT_BUMPER_TOUCH},
{"/user/hand/right/input/squeeze/click", device_id::RIGHT_SQUEEZE_CLICK},
{"/user/hand/right/input/squeeze/force", device_id::RIGHT_SQUEEZE_FORCE},
{"/user/hand/right/input/squeeze/touch", device_id::RIGHT_SQUEEZE_TOUCH},
{"/user/hand/right/input/squeeze/value", device_id::RIGHT_SQUEEZE_VALUE},
{"/user/hand/right/input/trigger/value", device_id::RIGHT_TRIGGER_VALUE},
{"/user/hand/right/input/trigger/click", device_id::RIGHT_TRIGGER_CLICK},
@@ -1361,6 +1386,7 @@ scene::meta & scenes::stream::get_meta_scene()
"/interaction_profiles/bytedance/pico4s_controller",
"/interaction_profiles/yvr/touch_controller_yvr",
"/interaction_profiles/htc/vive_focus3_controller",
"/interaction_profiles/valve/frame_controller_valve",
},
{
{"left_aim", "/user/hand/left/input/aim/pose"},
+1
View File
@@ -676,6 +676,7 @@ void scenes::stream::on_interaction_profile_changed(const XrEventDataInteraction
DO_PROFILE(yvr, touch_controller_yvr)
DO_PROFILE(samsung, odyssey_controller)
DO_PROFILE(valve, index_controller)
DO_PROFILE(valve, frame_controller_valve)
// FIXME: remove once support for pre-1.1 profiles is dropped
if (profile == "/interaction_profiles/facebook/touch_controller_pro")