17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 02:17:28 +01:00

fix(editor): laying leaves the terrain as it is: the track takes from the ground only the heights of the points clicked, from point to point by default, and no formation is led into the terrain after it, nor after a track dragged from a free end; the terrain made from the model never makes a chunk there is anew, made from the model or by hand, edited or not, only the missing ones, the formations laid anew as the tracks lie

The terrain under the tracks and the end of Tracks onto the terrain took every chunk along the tracks away and made it again from the model, the changes made by hand with them (79 chunks on test2). The heights while laying are kept under a key of their own, so the fitted ones chosen when they were the default are left behind; fitted stays a choice.
This commit is contained in:
maj00r
2026-10-24 18:20:22 +02:00
parent da336b9530
commit 336c940c28
6 changed files with 26 additions and 25 deletions

View File

@@ -332,6 +332,7 @@ class editor_mode : public application_mode, private editor_track::observer, pri
double band{300.0}; // m from the tracks the chunks made along them reach
bool shape{true}; // the formation and the slopes of the tracks as modifiers of the terrain
bool grow{true}; // while a track is laid, the terrain is made around the cursor where there's none
bool laying{false}; // the tracks committed are being laid: they leave the terrain as it is
bool grown{false}; // the chunks waiting were all asked for by growing: the formations aren't made anew after them
double grow_time{-10.0};
double slope{1.5};
@@ -413,8 +414,9 @@ class editor_mode : public application_mode, private editor_track::observer, pri
double nmt_offset_at(double const X, double const Z) const;
std::vector<heightmap::chunk_key> nmt_keys_around() const;
std::vector<heightmap::chunk_key> nmt_keys_along_tracks() const;
// Rebuild: the chunks there already are made anew too, and the formation laid before is forgotten, as when the tracks moved
void nmt_make(std::vector<heightmap::chunk_key> const &Keys, bool const Rebuild = false);
// only the chunks there are none of yet: a chunk there is, made from the model or by hand, edited or not, is never made anew.
// Reshape: the formations of the tracks laid anew as the tracks lie now, as when they moved
void nmt_make(std::vector<heightmap::chunk_key> const &Keys, bool const Reshape = false);
enum class nmt_chunk
{
waiting, // for its squares of the model