add runtime-initialized 'hmd_traits' struct to streamline hmd-specific checks

This commit is contained in:
amwatson
2026-05-10 19:11:17 +02:00
committed by xytovl
parent 86c19fc5cc
commit d70c1fb414
9 changed files with 261 additions and 233 deletions
+3 -3
View File
@@ -421,10 +421,10 @@ void scenes::stream::on_focused()
{
gui_status_last_change = instance.now();
std::string profile = controller_name();
const std::string_view profile = runtime_hmd_traits().controller_profile;
input.emplace(
*this,
"assets://controllers/" + profile + "/profile.json",
"assets://controllers/" + std::string(profile) + "/profile.json",
layer_controllers,
layer_rays,
get_action("left_trigger").first,
@@ -434,7 +434,7 @@ void scenes::stream::on_focused()
for (auto i: {xr::spaces::aim_left, xr::spaces::aim_right, xr::spaces::grip_left, xr::spaces::grip_right})
{
auto [p, q] = input->offset[i] = controller_offset(controller_name(), i);
auto [p, q] = input->offset[i] = controller_offset(profile, i);
auto rot = glm::degrees(glm::eulerAngles(q));
spdlog::info("Initializing offset of space {} to ({}, {}, {}) mm, ({}, {}, {})°",