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

2 Commits

Author SHA1 Message Date
jerrrrycho ee93aa11c8 feat(physics): a switch run through from its frog end is damaged; physics.derailment new keeps it out of use and splits a vehicle running onto it from its points
A rail vehicle running onto a switch from its frog end by the way the switch
is not set to pushes its blades over. Before, the switch was just thrown to
that way and nothing remembered it. Now the switch is marked as run through,
the log tells it once per run-through, and the scenery can react through the
memory cell and event __simulation.runthrough.

With physics.derailment new the damaged switch stays out of use for the run:
switch events no longer throw it, a vehicle running onto it from its points
pushes the loose blades over under its first axle and runs forked (the #496
limits derail it, cause split_switch), and a run-through above 60 km/h derails
the vehicle at the switch (cause run_through). In monitor mode the run does
not change; the log tells what new would do. Every switch is still taken as
trailable, as before.
2026-12-02 07:37:53 +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