17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 02:19:13 +01:00

refactor(track): what goes with unevenness in one place, readable

The rules stay in TrackUneven.h with no dependence on the engine, as they can
be tested. Their use on the tracks moves out of Track.cpp to TrackUneven.cpp,
split into steps: the group of switches, the values of its paths, the meeting
of two ends. One set of helpers for the paths of a track takes the place of
the same conditions written out in several places, and the value at the ends
of a switch is worked out in one place. The clatter of an axle leaves the long
Update of a vehicle. The fields in the editor say themselves when they show.

No change in behaviour.
This commit is contained in:
maj00r
2026-10-31 19:05:56 +01:00
parent 371de52342
commit 2b8d7d7cf3
10 changed files with 405 additions and 295 deletions

View File

@@ -127,6 +127,9 @@ public:
set_uneven( bool const Uneven, int const Path = 0 ) {
m_uneven = Uneven;
m_path = Path; }
glm::dvec3
end_point( int const End ) const {
return End == 0 ? Point1 : Point2; }
// a point of the path and the unit vector across it in the plan
void
plan_frame( double const Distance, glm::dvec3 &Point, glm::dvec3 &Across ) const;