Only ask actual hand tracking in lobby

This commit is contained in:
Patrick Nicolas
2026-10-27 22:08:34 +01:00
parent 8c5afd9a27
commit 500a60b685
8 changed files with 42 additions and 49 deletions
+11 -13
View File
@@ -980,29 +980,27 @@ 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.joints)
auto left = left_hand->locate(world_space, frame_state.predictedDisplayTime).joints;
if (left)
{
if (left.is_input_source())
stick_finger_to_gui(*left.joints, windows);
stick_finger_to_gui(*left, windows);
hide_left_controller = true;
}
auto right = right_hand->locate(world_space, frame_state.predictedDisplayTime);
if (right.joints)
auto right = right_hand->locate(world_space, frame_state.predictedDisplayTime).joints;
if (right)
{
if (right.is_input_source())
stick_finger_to_gui(*right.joints, windows);
stick_finger_to_gui(*right, windows);
hide_right_controller = true;
}
hand_model::apply(world, left.joints ? &*left.joints : nullptr, right.joints ? &*right.joints : nullptr);
hand_model::apply(world, left ? &*left : nullptr, right ? &*right : nullptr);
if (not new_gui_position and head_position and left.joints and left.is_input_source())
new_gui_position = check_recenter_gesture(xr::spaces::palm_left, *left.joints, *head_position);
if (not new_gui_position and head_position and left)
new_gui_position = check_recenter_gesture(xr::spaces::palm_left, *left, *head_position);
if (not new_gui_position and head_position and right.joints and right.is_input_source())
new_gui_position = check_recenter_gesture(xr::spaces::palm_right, *right.joints, *head_position);
if (not new_gui_position and head_position and right)
new_gui_position = check_recenter_gesture(xr::spaces::palm_right, *right, *head_position);
}
if (head_position and new_gui_position)