mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-31 09:59:06 +01:00
Merge the track layout editor into cpp20-modules, ported to modules
The editor branch was written against headers and the PCH, both of which this
branch has done away with, so its own files were ported rather than merged: the
five headers it added are now interface units and their .cpp files module
implementation units.
- editor/{puwg1992,polandmap,turnouts,orthophoto} become eu07.editor.* modules,
application/planpanel becomes eu07.application.planpanel. The plan tool keeps
to its own module rather than joining the eu07.simcore partitions: it stands on
the editor's libraries and eu07.application.uilayer, not on the simulation core,
so :editoruilayer can export import it without a cycle.
- glm arrives by import eu07.glm, never by include, as the rest of the tree does.
maj0sted is header-only and glm-free, so its headers stay includes in the global
module fragment - every unit that names those types includes them itself, since
a global fragment is not visible across units.
- the one textual conflict was :editoruilayer's include block against this
branch's imports; resolved this branch's way plus the planpanel import.
Builds with clang 22 (-DWITH_BETTER_RENDERER=OFF) and starts into the editor on
empty ground with -editor alone.
This commit is contained in:
@@ -156,6 +156,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;
|
||||
@@ -249,6 +259,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