Avoid showing both hand and controller in lobby

This commit is contained in:
Patrick Nicolas
2026-02-07 10:21:32 +01:00
parent 3acf9f26f2
commit 915aed8df1
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -973,14 +973,14 @@ void scenes::lobby::render(const XrFrameState & frame_state)
auto windows = imgui_ctx->windows();
auto left = left_hand->locate(world_space, frame_state.predictedDisplayTime);
if (left and xr::hand_tracker::check_flags(*left, XR_SPACE_LOCATION_POSITION_TRACKED_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT, 0))
if (left)
{
stick_finger_to_gui(*left, windows);
hide_left_controller = true;
}
auto right = right_hand->locate(world_space, frame_state.predictedDisplayTime);
if (right and xr::hand_tracker::check_flags(*right, XR_SPACE_LOCATION_POSITION_TRACKED_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT, 0))
if (right)
{
stick_finger_to_gui(*right, windows);
hide_right_controller = true;
+2 -2
View File
@@ -74,8 +74,8 @@ std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> xr::
if (!locations.isActive)
return std::nullopt;
// bail if none of the joints are valid/tracked
if (!std::ranges::any_of(joints_pos, [](const auto & loc) { return loc.locationFlags != 0; }))
// bail if any of the joint is invalid
if (std::ranges::any_of(joints_pos, [](const auto & loc) { return loc.locationFlags == 0; }))
return std::nullopt;
std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT> joints;