mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-28 11:07:29 +01:00
Put the editor viewport into a top-down orthographic plan view
Opening the Plan tool now switches the whole colour pass to an orthographic projection and pins the camera looking straight down, so the plan is drawn against the loaded scenery rather than in a window of its own. Closing the tool hands the camera's orientation back; leaving the editor clears the view outright. The wheel changes how much ground fits on screen instead of moving the camera, which with no perspective would change nothing but the clipping. Both configured backends follow: the experimental renderer swaps the pass projection (and fits its shadow cascades to it), the modern GL renderer uses its existing ortho helpers. Everything reading the pass projection - the mouse ray, the frustum test - picks the change up on its own. The experimental renderer also publishes its colour pass camera now, which it previously left at the interface defaults, so overlays can place world points on screen.
This commit is contained in:
@@ -83,8 +83,19 @@ plan_panel::plan_panel(std::string const &Name, bool const Isopen) : ui_panel(Na
|
||||
solve();
|
||||
}
|
||||
|
||||
void plan_panel::update()
|
||||
{
|
||||
// the plan belongs on the scenery itself, so opening the tool puts the viewport into the
|
||||
// distortion-free view from above and closing it hands the camera back
|
||||
Global.editor_ortho = is_open;
|
||||
}
|
||||
|
||||
void plan_panel::render_contents()
|
||||
{
|
||||
ImGui::Text("view: top-down, %.0f m across", Global.editor_ortho_extent * 2.0f);
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("(wheel over the scenery zooms it)");
|
||||
|
||||
render_toolbar();
|
||||
render_canvas();
|
||||
render_gaps();
|
||||
|
||||
Reference in New Issue
Block a user