17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-06 17:28:36 +01:00

feat(terrain): grade line fitted to the ground under the route within the limits; editor terrain shaped to the grade line with a formation and rounded slopes, with one step back; scenery ground triangles of chosen materials converted to editor terrain and taken out of the files on save, with a dated backup of each file; crack-free simplified terrain mesh, terrain streamed as far as the scenery is drawn, the nearest chunks first; smoothing brush

This commit is contained in:
maj00r
2026-10-05 02:21:55 +02:00
parent 3731520e33
commit a13a5548df
14 changed files with 1253 additions and 30 deletions

View File

@@ -77,6 +77,7 @@ class terrain_streamer
int cells() const { return m_cells; }
float cellsize() const { return m_cellsize; }
int radius() const { return m_radius; }
std::string const &texture() const { return m_texture; }
// writes every resident, edited chunk to disk (without unloading) - used on save
void flush();
@@ -108,6 +109,9 @@ class terrain_streamer
std::map<chunk_key, std::unique_ptr<editor_terrain>> m_chunks;
std::map<chunk_key, std::uint8_t> m_known; // cached per-chunk flag bits
// offsets of the chunks around the camera, the nearest first, for the radius in effect
std::vector<chunk_key> m_ring;
int m_ring_radius{-1};
};
// single, simulation-level streamer instance shared by the editor (authoring) and the scenery