18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 23:57:09 +01:00
Commit Graph

2 Commits

Author SHA1 Message Date
jerrrrycho
7b41be3127 feat(physics): a vehicle passes on the curvature of a buckle under it
TTrackShape::buckle_curvature, set by TDynamicObject next to the radius: the
mean of the curvatures of the buckle at the outer axles, each averaged over
the wheelbase of its bogie (TTrackFollower::BuckleCurvature(),
TTrack::buckle_curvature()), positive bending with the curve.
check_derailment() takes it into derailment::track_state::buckle_curvature,
and a vehicle derailed with a buckle under it says so in the log ("derailed
on buckled track").
2026-11-15 12:29:36 +01:00
jerrrrycho
822182d26e feat(track): welded track buckles in the heat, drawn and followed by the axles
world/TrackBuckle.h: the buckle of continuous welded rail as plain functions.

- the shape: a main lobe and a side lobe of the other way on each side, a
  cosine under a cos^2 window over three lobes, so the side lobes come to a
  quarter of the main one and the curvature runs on smoothly into the straight
  track; peak curvature 11/9 pi^2 a / L^2. A straight track 0.4 m by 14 m, a
  curve (R < 1500 m) 0.2 m by 11 m out of the curve (Kish, Samavedam)
- the heat: rail = air + 17 K in full sun (by the height of the sun and the
  clouds), the force E*A*alpha*dT, the limits of the rise above the neutral
  temperature (26 C, PLK) a track buckles at under a train and by itself:
  good 40/55 K, average 32/45, weak or worked lately 22/32, lowered in curves
  and by an uneven line; the chance of a pass growing between them
- the draws by an FNV-1a hash of the name of the track and the seed

The buckle is a part of TSegment::stray() across the path, so the rails, the
sleepers and the axles on it follow it (the direction stays as designed); the
path is divided every 1 m where it has one. Its curvature is kept apart from
the unevenness (TSegment::buckle_bend()).

- scenery: "buckle <mm>;<m>;<m>[;<side>]" and "cwr <C>;<grade>[;<worked>]"
  of a plain rail track, written back
- event "trackbuckle <mm> [<m> [<m> [<side>]]]" buckles the target tracks
  during the game (0 straightens them), making their geometry again
- physics.trackbuckling off|scenery|auto in eu07.ini, scenery by default; auto
  also buckles the weak places (one in 10 km of track, and the tracks worked
  on lately) by the temperature of the rails, by themselves or under a train
  going fast or braking
2026-11-15 12:28:41 +01:00