17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 08:39:19 +02:00

feat(editor): laid track follows the ground between the clicks

- the height along the new track is a smooth curve through points on the ground under the foot of the ballast, added where the track would hang or sink more than 0.1 m, at least 10 m apart; the paths are cut there, each joint keeps one grade on both sides
- the clicked ends and the free ends joined keep their height and grade as before; no grade limits
- self-test layclicks: how far the foot of the ballast goes over and under the ground along the paths laid
This commit is contained in:
maj00r
2026-10-11 12:12:48 +02:00
parent cfc2b2c64a
commit 6284f4e0d3
4 changed files with 207 additions and 68 deletions

View File

@@ -548,7 +548,7 @@ editor_mode::~editor_mode()
editor_track::observe(nullptr);
}
std::vector<double> editor_mode::ground_heights(std::vector<glm::dvec3> const &Points, bool const Fresh, std::vector<char> *Found)
std::vector<double> editor_mode::ground_heights(std::vector<glm::dvec3> const &Points, bool const Fresh, std::vector<char> *Found) const
{
std::vector<double> heights;
heights.reserve(Points.size());
@@ -2449,7 +2449,7 @@ editor_terrain *editor_mode::terrain_at(double X, double Z)
return m_streamer.terrain_at(X, Z);
}
std::vector<editor_terrain *> editor_mode::active_terrains()
std::vector<editor_terrain *> editor_mode::active_terrains() const
{
std::vector<editor_terrain *> out;
out.reserve(m_streamer.resident());