Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Vindicus999
2025-08-21 11:13:13 +00:00
50 changed files with 963 additions and 869 deletions
+17 -22
View File
@@ -649,10 +649,10 @@ void scenes::lobby::render(const XrFrameState & frame_state)
if (!new_gui_position and head_position)
new_gui_position = check_recenter_action(frame_state.predictedDisplayTime, head_position->first);
if (application::get_hand_tracking_supported())
if (left_hand and right_hand)
{
auto left = application::get_left_hand().locate(world_space, frame_state.predictedDisplayTime);
auto right = application::get_right_hand().locate(world_space, frame_state.predictedDisplayTime);
auto left = left_hand->locate(world_space, frame_state.predictedDisplayTime);
auto right = right_hand->locate(world_space, frame_state.predictedDisplayTime);
hand_model::apply(world, left, right);
@@ -798,7 +798,7 @@ void scenes::lobby::on_focused()
// assert(std::ranges::all_of(views, [height](const XrViewConfigurationView & view) { return view.recommendedImageRectHeight == height; }));
renderer.emplace(device, physical_device, queue, commandpool);
loader.emplace(device, physical_device, queue, application::queue_family_index(), renderer->get_default_material());
loader.emplace(device, physical_device, queue, queue_family_index, renderer->get_default_material());
lobby_entity = load_gltf("ground.gltf", layer_lobby).first;
@@ -835,12 +835,6 @@ void scenes::lobby::on_focused()
xyz_axes_right_controller = load_gltf("xyz-arrows.glb", layer_controllers).first;
#endif
if (application::get_hand_tracking_supported())
{
hand_model::add_hand(*this, XR_HAND_LEFT_EXT, "left-hand.glb", layer_controllers);
hand_model::add_hand(*this, XR_HAND_RIGHT_EXT, "right-hand.glb", layer_controllers);
}
recenter_left_action = get_action("recenter_left").first;
recenter_right_action = get_action("recenter_right").first;
@@ -862,21 +856,19 @@ void scenes::lobby::on_focused()
.haptic_output = get_action("right_haptic").first,
},
};
if (auto & hand = application::get_left_hand())
if (system.hand_tracking_supported())
{
imgui_inputs.push_back(
{
.hand = &hand,
});
}
if (auto & hand = application::get_right_hand())
{
imgui_inputs.push_back(
{
.hand = &hand,
});
left_hand = session.create_hand_tracker(XR_HAND_LEFT_EXT);
right_hand = session.create_hand_tracker(XR_HAND_RIGHT_EXT);
hand_model::add_hand(*this, XR_HAND_LEFT_EXT, "left-hand.glb", layer_controllers);
hand_model::add_hand(*this, XR_HAND_RIGHT_EXT, "right-hand.glb", layer_controllers);
imgui_inputs.push_back({.hand = &*left_hand});
imgui_inputs.push_back({.hand = &*right_hand});
}
face_tracker = xr::make_face_tracker(instance, system, session);
// 0.4mm / pixel
std::vector<imgui_context::viewport> vps{
{
@@ -977,6 +969,9 @@ void scenes::lobby::on_unfocused()
world.clear(); // Must be cleared before the renderer so that the descriptor sets are freed before their pools
input.reset();
left_hand.reset();
right_hand.reset();
face_tracker.emplace<std::monostate>();
loader.reset();
renderer.reset();