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

feat(editor): a switch joined to a track goes along with it as a whole when the gizmo moves, turns or tilts the track

The switch, with the switches joined to it, keeps its shape and one grade over its whole length: it is moved,
turned and tilted to the end of the track, and the tracks at its other ends follow it.
This commit is contained in:
maj00r
2026-10-11 14:19:11 +02:00
parent fe9d78b172
commit f0ccd375a0
3 changed files with 112 additions and 36 deletions

View File

@@ -671,8 +671,12 @@ class editor_mode : public application_mode, private editor_track::observer
TTrack *track{nullptr};
editor_track::point_ref own;
editor_track::point_ref theirs;
glm::dvec3 point{0.0};
glm::dvec3 tangent{0.0};
double roll{0.0};
std::vector<editor_track::joint> joints;
bool moved{false};
std::vector<std::pair<TTrack *, std::vector<segment_data>>> cluster;
std::vector<std::pair<TTrack *, std::vector<editor_track::joint>>> joints;
};
std::vector<switch_joint> switches;
};
@@ -684,6 +688,7 @@ class editor_mode : public application_mode, private editor_track::observer
void track_gizmo_stretch(TTrack &Track, double const Length);
void track_gizmo_control(TTrack &Track, glm::dvec3 Control);
void track_gizmo_point(TTrack &Track, glm::dvec3 const &Position);
void track_gizmo_switches(TTrack &Track);
void track_gizmo_begin(TTrack &Track, bool const Pointmode, gizmo_operation const Operation);
void track_gizmo_turn(TTrack &Track, int const Axis, double const Angle);
void track_gizmo_length(TTrack &Track, double Length);