From ffd5cf882a11fcac7046438fdfd01841381d485f Mon Sep 17 00:00:00 2001 From: perillamint Date: Tue, 11 Nov 2025 06:19:21 +0900 Subject: [PATCH] Initial Galaxy XR port (#585) Co-authored-by: Patrick Nicolas --- AndroidManifest.xml | 20 ++++++++++++++++++++ client/hardware.cpp | 34 ++++++++++++++++++++++++++++++++++ client/hardware.h | 1 + client/scenes/lobby_gui.cpp | 2 ++ 4 files changed, 57 insertions(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7f9b6505..e53a7388 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -47,6 +47,9 @@ + + + @@ -62,6 +65,12 @@ + + + + + + + + + @@ -91,6 +103,14 @@ + + + + diff --git a/client/hardware.cpp b/client/hardware.cpp index 63b64123..5685fd36 100644 --- a/client/hardware.cpp +++ b/client/hardware.cpp @@ -103,6 +103,11 @@ static model guess_model_() if (model == "VIVE XR Series") return model::htc_vive_xr_elite; } + if (manufacturer == "samsung") + { + if (model == "SM-I610") + return model::samsung_galaxy_xr; + } spdlog::info("Unknown model, manufacturer={}, model={}, device={}", manufacturer, model, device); #endif @@ -165,6 +170,8 @@ XrViewConfigurationView override_view(XrViewConfigurationView view, model m) return scale_view(view, 2448); case model::htc_vive_xr_elite: return scale_view(view, 1920); + case model::samsung_galaxy_xr: + return scale_view(view, 3552); case model::lynx_r1: case model::unknown: return view; @@ -191,6 +198,7 @@ bool need_srgb_conversion(model m) case model::htc_vive_focus_3: case model::htc_vive_focus_vision: case model::htc_vive_xr_elite: + case model::samsung_galaxy_xr: case model::unknown: return true; } @@ -204,6 +212,27 @@ const char * permission_name(feature f) case feature::microphone: return "android.permission.RECORD_AUDIO"; case feature::hand_tracking: + switch (guess_model()) + { + case model::samsung_galaxy_xr: + return "android.permission.HAND_TRACKING"; + case model::oculus_quest: + case model::oculus_quest_2: + case model::meta_quest_pro: + case model::meta_quest_3: + case model::meta_quest_3s: + case model::pico_neo_3: + case model::pico_4: + case model::pico_4s: + case model::pico_4_pro: + case model::pico_4_enterprise: + case model::htc_vive_focus_3: + case model::htc_vive_focus_vision: + case model::htc_vive_xr_elite: + case model::lynx_r1: + case model::unknown: + break; + } return nullptr; case feature::eye_gaze: switch (guess_model()) @@ -220,6 +249,8 @@ const char * permission_name(feature f) case model::pico_4_pro: case model::pico_4_enterprise: return "com.picovr.permission.EYE_TRACKING"; + case model::samsung_galaxy_xr: + return "android.permission.EYE_TRACKING_FINE"; case model::htc_vive_focus_3: case model::htc_vive_focus_vision: case model::htc_vive_xr_elite: @@ -243,6 +274,8 @@ const char * permission_name(feature f) case model::pico_4_pro: case model::pico_4_enterprise: return "com.picovr.permission.FACE_TRACKING"; + case model::samsung_galaxy_xr: + return "android.permission.FACE_TRACKING"; case model::htc_vive_focus_3: case model::htc_vive_focus_vision: case model::htc_vive_xr_elite: @@ -294,6 +327,7 @@ std::string controller_name() case model::htc_vive_focus_vision: case model::htc_vive_xr_elite: return "htc-vive-focus-3"; + case model::samsung_galaxy_xr: case model::lynx_r1: case model::unknown: return "generic-trigger-squeeze"; diff --git a/client/hardware.h b/client/hardware.h index 29d73cbd..089fdb2c 100644 --- a/client/hardware.h +++ b/client/hardware.h @@ -41,6 +41,7 @@ enum class model htc_vive_xr_elite, htc_vive_focus_vision, lynx_r1, + samsung_galaxy_xr, unknown }; diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index b12759b5..aa38d4e8 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -1143,6 +1143,8 @@ void scenes::lobby::gui_first_run() CenterTextH(_("Welcome to WiVRn")); ImGui::PopFont(); + config.set_feature(feature::hand_tracking, true); + while (optional_feature_index < optional_features.size() and (not optional_features[optional_feature_index].supported or config.check_feature(optional_features[optional_feature_index].f)))