Merge pull request from ada-tv/fix/openxr-odysseyplus

OpenXR controller bindings for Odyssey+
This commit is contained in:
ksuprynowicz 2025-04-13 18:53:23 +02:00 committed by GitHub
commit 5a538f18de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 1 deletions

View file

@ -96,6 +96,7 @@ bool OpenXrContext::initInstance() {
bool openglSupported = false;
bool userPresenceSupported = false;
bool odysseyControllerSupported = false;
qCInfo(xr_context_cat, "Runtime supports %d extensions:", count);
for (uint32_t i = 0; i < count; i++) {
@ -104,6 +105,8 @@ bool OpenXrContext::initInstance() {
openglSupported = true;
} else if (strcmp(XR_EXT_USER_PRESENCE_EXTENSION_NAME, properties[i].extensionName) == 0) {
userPresenceSupported = true;
} else if (strcmp(XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME, properties[i].extensionName) == 0) {
odysseyControllerSupported = true;
}
}
@ -113,10 +116,15 @@ bool OpenXrContext::initInstance() {
}
std::vector<const char*> enabled = {XR_KHR_OPENGL_ENABLE_EXTENSION_NAME};
if (userPresenceSupported) {
enabled.push_back(XR_EXT_USER_PRESENCE_EXTENSION_NAME);
}
if (odysseyControllerSupported) {
enabled.push_back(XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME);
}
XrInstanceCreateInfo info = {
.type = XR_TYPE_INSTANCE_CREATE_INFO,
.applicationInfo = {

View file

@ -403,7 +403,7 @@ bool OpenXrInputPlugin::InputDevice::initActions() {
{"left_haptic", "/user/hand/left/output/haptic"},
{"right_secondary_click", hand_right + "/menu/click"},
{"right_trigger_click", hand_right + "/select/click"},
{"right_trigger_value", hand_right + "/select/click"},
{"right_pose", hand_right + "/grip/pose"},
{"right_haptic", "/user/hand/right/output/haptic"},
}},
@ -468,6 +468,25 @@ bool OpenXrInputPlugin::InputDevice::initActions() {
{"right_pose", hand_right + "/grip/pose"},
{"right_haptic", "/user/hand/right/output/haptic"},
}},
{"/interaction_profiles/samsung/odyssey_controller", {
{"left_secondary_click", hand_left + "/menu/click"},
{"left_squeeze_value", hand_left + "/squeeze/click"},
{"left_trigger_value", hand_left + "/trigger/value"},
{"left_thumbstick", hand_left + "/thumbstick"},
{"left_thumbstick_click", hand_left + "/trackpad/click"},
{"left_thumbstick_touch", hand_left + "/trackpad/touch"},
{"left_pose", hand_left + "/grip/pose"},
{"left_haptic", "/user/hand/left/output/haptic"},
{"right_secondary_click", hand_right + "/menu/click"},
{"right_squeeze_value", hand_right + "/squeeze/click"},
{"right_trigger_value", hand_right + "/trigger/value"},
{"right_thumbstick", hand_right + "/thumbstick"},
{"right_thumbstick_click", hand_right + "/trackpad/click"},
{"right_thumbstick_touch", hand_right + "/trackpad/touch"},
{"right_pose", hand_right + "/grip/pose"},
{"right_haptic", "/user/hand/right/output/haptic"},
}},
{"/interaction_profiles/valve/index_controller", {
{"left_primary_click", hand_left + "/a/click"},
{"left_secondary_click", hand_left + "/b/click"},