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

feat(editor): curves take over the adjoining straights

This commit is contained in:
maj00r
2026-10-04 00:14:03 +02:00
parent 676bf39136
commit cdd5c242d1
6 changed files with 297 additions and 38 deletions

View File

@@ -137,6 +137,16 @@ class editor_track
double split{0.5};
};
static bool find_curve(TTrack &Track, straight_tolerance const &Tolerance, double const Gauge, curve &Curve);
// regular straight paths continuing a chain end in line, which the chain can take over
struct straight_run
{
std::vector<TTrack *> tracks;
std::vector<bool> outward;
double length{0.0};
};
static straight_run straight_beyond(chain const &Chain, bool const Atend, straight_tolerance const &Tolerance);
static double run_reserve(straight_run const &Run);
static TTrack *take_straight(straight_run const &Run, TTrack *Edge, glm::dvec3 const &Joint, glm::dvec3 const &Cut, std::vector<std::pair<TTrack *, state>> &States, std::vector<TTrack *> &Created);
struct switch_template
{
TTrack *source{nullptr};