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

feat(editor): the plain straight a switch branch leads into gets its end moved to where the branch lands instead of a short straight being added: shortened when it reaches past, lengthened when it ends short; straights drawn with handles count (the trimmed end loses them), so a switch slid up to a track that ends close to the crossing now places

This commit is contained in:
maj00r
2026-10-12 00:36:13 +02:00
parent b27d1772a7
commit 704511fe5e
5 changed files with 26 additions and 15 deletions

View File

@@ -221,13 +221,14 @@ class editor_track
double shortfall{0.0};
bool reverse{false};
double insert{0.0};
glm::dvec3 landing{0.0};
std::vector<segment_data> pieces;
};
static double branch_radius(segment_data const &Diverging);
static double reverse_insert(double const Speed);
static double diverging_speed(double const Radius);
static std::optional<double> branch_shift(branch_end const &From, glm::dvec2 const &Slide, double const Radius, branch_end const &To, double const Kink);
static branch_link link_branch(branch_end const &From, double const Radius, branch_end const &To, double const Kink, double const Insert);
static branch_link link_branch(branch_end const &From, double const Radius, branch_end const &To, double const Kink, double const Insert, bool const Stretch);
struct snap_target
{