mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-02 17:29:14 +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:
@@ -129,6 +129,16 @@ class NvRenderer : public gfx_renderer, public MaResourceRegistry {
|
||||
virtual TSubModel const *Pick_Control() const override;
|
||||
virtual scene::basic_node const *Pick_Node() const override;
|
||||
virtual glm::dvec3 Mouse_Position() const override;
|
||||
// matrices of the most recent colour pass, for overlays drawn on top of the rendered world
|
||||
virtual glm::mat4 Camera_View_Matrix() const override {
|
||||
return static_cast<glm::mat4>(m_camera_view);
|
||||
}
|
||||
virtual glm::mat4 Camera_Projection_Matrix() const override {
|
||||
return static_cast<glm::mat4>(m_camera_projection);
|
||||
}
|
||||
virtual glm::dvec3 Camera_Position() const override {
|
||||
return m_camera_position;
|
||||
}
|
||||
virtual void Update(double const Deltatime) override;
|
||||
virtual void Update_Pick_Control() override;
|
||||
virtual void Update_Pick_Node() override;
|
||||
@@ -222,6 +232,12 @@ class NvRenderer : public gfx_renderer, public MaResourceRegistry {
|
||||
|
||||
glm::dvec3 m_mouse_ro;
|
||||
glm::dvec3 m_mouse_rd;
|
||||
|
||||
// colour pass camera, kept so overlays can place world points on screen. the view matrix is
|
||||
// camera-relative (rotation only), matching the camera-relative rendering used throughout
|
||||
glm::dmat4 m_camera_view{1.};
|
||||
glm::dmat4 m_camera_projection{1.};
|
||||
glm::dvec3 m_camera_position{0.};
|
||||
TSubModel const *m_picked_submodel = nullptr;
|
||||
|
||||
using section_sequence = std::vector<scene::basic_section *>;
|
||||
|
||||
Reference in New Issue
Block a user