class mrpt::imgui::CImGuiBackgroundScene
Overview
A 3D scene drawn as the background of the application window, behind all the ImGui panels, with orbit/pan/zoom camera control where no panel covers it.
This is the usual main view of simulators and viewers built on CImGuiAppShell : panels float or dock on top of the 3D world.
mrpt::imgui::CImGuiBackgroundScene bg; bg.view.setScene(myScene); app.run([&]() { bg.render(app); // first, so it stays behind the panels ... panels ... });
The scene is rendered straight into the window framebuffer (no FBO), with its MSAA, through CImGuiSceneView::renderAsBackground().
#include <mrpt/imgui/CImGuiBackgroundScene.h> class CImGuiBackgroundScene { public: // fields CImGuiSceneView view; // construction CImGuiBackgroundScene(); // methods void render(const CImGuiAppShell& shell); void render(const std::array<float, 4>& rect); bool isHovered() const; };
Fields
CImGuiSceneView view
The scene, its camera controller, and the overlay/click callbacks.
Methods
void render(const CImGuiAppShell& shell)
Renders the scene over the central node of the shell dockspace (the area not covered by docked panels).
Call it every frame, before any other window.
void render(const std::array<float, 4>& rect)
Renders the scene over the given rectangle (x, y, width, height), in ImGui coordinates.
bool isHovered() const
True if the mouse was over the visible part of the scene in the last frame (i.e.
not over any panel).