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

2 Commits

Author SHA1 Message Date
jerrrrycho 885c28c1ef fix: SonarQube findings of the buffer stops
- The notice of a finished hit is taken out of the contact with std::exchange before it goes to the scenery, so
  what the scenery does with it can't reach the one held in the contact.
- The loops count whole steps (an int, the number of steps taken with ceil) instead of adding a floating step.
- The local final of bufferstop::contact() is ending (final is a contextual keyword).

Unit tests 1294/1294.
2026-12-02 17:04:29 +01:00
jerrrrycho 7578f2c3a0 feat(physics): buffer stops at the free ends of the tracks
A free end of a rail track marked bufferstop1 / bufferstop2 <kind> in the
scenery is a buffer stop (physics/bufferstop.h): rigid, buffered, hydraulic
or friction. With physics.collisions new a vehicle running into it meets the
stages of the stop in series: the buffers of both, the absorber or the brake
elements of a sliding stop, then the frame, whose hit goes through
collision::hit() and whose ride-up goes through collision::override_of(),
the stop an immovable body. It is held, the frame deforms, it rides up
(Enfield 2021), demolishes the stop (Kirkby 2021) or overruns a sliding one.
The log tells each hit once, and the memory cells __simulation.bufferstop
and <track>:bufferstop and their events tell the scenery.

physics.bufferstops marked (the default) takes the marked ends only, auto
also the ends with a model of a stop within 3 m, off none. Every other free
end keeps the derailment off the end of the track, and so does every end
with physics.collisions old; monitor logs what the stop would have done.
2026-12-02 12:33:36 +01:00