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

feat(track): the foot of the ballast stays on the ground as designed

Rails, sleepers and the top of the ballast go with the unevenness, the
slope of the ballast takes up the difference.
This commit is contained in:
maj00r
2026-10-31 18:27:19 +01:00
parent 6aed9ec5bd
commit 3dbe8a75f8
6 changed files with 31 additions and 4 deletions

View File

@@ -109,6 +109,13 @@ inline double along( double const Full, double const Atstart, double const Atend
return ends + ( Full - ends ) * std::min( smooth( Distance / fade ), smooth( ( Length - Distance ) / fade ) );
}
// how much of the displacement a point of the profile takes, by its depth under the rail top: all of it down to the foot of the rail,
// none at the foot of the ballast, which stays on the ground as designed
inline double bed_share( double const Depth, double const Rail, double const Height ) {
return Height > 0.0 ? std::clamp( 1.0 - ( Depth - Rail ) / Height, 0.0, 1.0 ) : 1.0;
}
// distance from the joint behind the point
inline double rail_phase( double const Along, double const Rail ) {