Add interactable GUI in stream scene

This commit is contained in:
Guillaume Meunier
2025-07-26 11:18:58 +02:00
parent 366bc2c793
commit 96083cd02e
5 changed files with 557 additions and 27 deletions
+8
View File
@@ -627,6 +627,9 @@ std::vector<imgui_context::controller_state> imgui_context::read_controllers_sta
controller_state & new_state = new_states.emplace_back();
if (not controllers_enabled)
continue;
if (ctrl.hand)
{
if (auto joints = ctrl.hand->locate(world, display_time))
@@ -1180,6 +1183,11 @@ void imgui_context::set_current()
ImPlot::SetCurrentContext(plot_context);
}
void imgui_context::set_controllers_enabled(bool value)
{
controllers_enabled = value;
}
bool imgui_context::is_modal_popup_shown() const
{
return ImGui::GetTopMostAndVisiblePopupModal() != nullptr;
+3 -1
View File
@@ -155,6 +155,7 @@ private:
XrSpace world;
size_t focused_controller = (size_t)-1;
XrTime last_display_time = 0;
bool controllers_enabled = true;
bool button_pressed = false;
bool fingertip_touching = false;
@@ -163,7 +164,7 @@ private:
ImVector<ImWchar> glyph_ranges;
bool glyph_range_dirty = true;
ImGuiID hovered_item = 0; // Hovered item in the current frame, reset at the beginning of the frame
ImGuiID hovered_item = 0; // Hovered item in the current frame, reset at the beginning of the frame
ImGuiID hovered_item_prev = 0; // Hovered item at the previous frame
#if WIVRN_SHOW_IMGUI_DEMO_WINDOW
@@ -219,4 +220,5 @@ public:
void vibrate_on_hover();
void set_hovered_item();
void set_controllers_enabled(bool value);
};