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

feat(editor): Alt while laying turns the straight to 1:9, 1:6.6... of a straight track

Besides the steps of 15 degrees, Alt snaps the laid straight to the
ratios of the switches (1:4.8 to 1:26.5) of the straight track the
straight crosses, or of one within 30 m of where it starts; the label at
the cursor says which ratio to which track. The first click with Alt
within 2 m of a straight track puts the start on its axis, so a branch
or a crossing at 1:9 starts exactly on the track.
This commit is contained in:
maj00r
2026-10-19 18:48:54 +02:00
parent 438cb4ea3a
commit 907068c69c
6 changed files with 106 additions and 17 deletions

View File

@@ -1343,6 +1343,7 @@ class editor_mode : public application_mode, private editor_track::observer
editor_track::path_style style;
std::string status;
double status_time{-100.0};
std::string skew; // what Alt turned the straight to
struct step
{
editor_track::snap_target start;
@@ -1354,7 +1355,9 @@ class editor_mode : public application_mode, private editor_track::observer
bool m_norms_free{true};
alignment::limits laying_norms() const;
bool render_norms_choice();
glm::dvec3 lay_angle_snap(glm::dvec3 const &Mouse) const;
glm::dvec3 lay_angle_snap(glm::dvec3 const &Mouse, std::string &Label) const;
// the straight track Alt turns the laid straight to: the nearest one the straight from From to To crosses, or one along From
TTrack const *skew_reference(glm::dvec3 const &From, glm::dvec3 const &To, double const Reach) const;
void lay_after_history(bool const Undo);
void lay_back();
void render_lay_ui();