18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 13:35:26 +01:00
Commit Graph

2 Commits

Author SHA1 Message Date
jerrrrycho 4cab14d288 fix(physics): SonarCloud findings of the fork running
- JoinedEnd() reads the track it is on once, without going through
  LeavingPath()'s null check, which made the analyser think the track
  could be null after it (S2259); the caller has checked it already
- the test loops count in integers (S2193, S886), one declaration a line
  (S1659)
2026-11-24 11:44:34 +01:00
jerrrrycho 1a44740d6b feat(physics): the geometry of a switch thrown under a train
A new core module, world/switchfork.h, for forked running: two axles
that follow each other in a train on the two ways of a switch thrown
between them.

- leaving_path(): the way an axle leaves a switch by. Its own way only
  when the switch was thrown since it ran onto it; -1 (as the switch is
  set, the call of before) otherwise.
- path_memory: the ways of the last four switches an axle ran over.
- forked(): an axle that ran onto a switch from its points took
  another way than the axle ahead of it.
- bogie_limit(): the angle a bogie turns under the body in the tightest
  curve the vehicle runs through, asin(a / 2R); R is the Rmin of the
  vehicle definition, or 150 m (TSI LOC&PAS 4.2.3.6) without one.
- buffer_head_width: 0.45 m (UIC 527-1), past which two coupled ends
  have no buffer face against the other.

Unit tests: the coach of td.scn forked on its switch derails 23 m into
it, the EU07 at 10 m, a coupled coach at 15.5 m.
2026-11-24 09:33:04 +01:00