From 3c148bd1dd449fd79ff0a3e9cddc33d5cface1bf Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 5 Jul 2026 15:04:04 +0200 Subject: [PATCH] Remove HTC ray workaround for XR elite firmware 2 --- client/hmd_traits.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/client/hmd_traits.cpp b/client/hmd_traits.cpp index 9655186d..c4b7f44c 100644 --- a/client/hmd_traits.cpp +++ b/client/hmd_traits.cpp @@ -19,6 +19,7 @@ #include "hmd_traits.h" +#include "utils/strings.h" #include "xr/to_string.h" #include @@ -203,8 +204,28 @@ void hmd_traits::init() { // Accepts OpenXR 1.1 but doesn't actually implement it max_openxr_api_version = XR_API_VERSION_1_0; + // Doesn't handle additive blend, so needs specific ray model - controller_ray_model = "assets://ray-htc.glb"; + // Fixed in XR elite firmware version 2.0 + bool need_htc_ray = true; + const auto version = get_property("ro.product.version"); + if (version) + { + auto digits = utils::split(*version, "."); + if (not digits.empty()) + { + try + { + auto major = std::stoi(digits[0]); + if (major >= 2 and model == "VIVE XR Series") + need_htc_ray = false; + } + catch (...) + {} + } + } + if (need_htc_ray) + controller_ray_model = "assets://ray-htc.glb"; controller_profile = "htc-vive-focus-3";