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

6 Commits

Author SHA1 Message Date
jerrrrycho da69df97b8 feat(physics): flank collisions at switches, short of the fouling point
Two vehicles on the rails beside each other at a switch, up to its
fouling point, now meet by their bodies (physics.collisions new, the
default; physics.collisions.flank no turns it off). Before, they passed
through each other there, or, on the switch itself, the vehicle on the
other way was taken for the one ahead and gave a phantom end-on hit.

The neighbour search follows the ways of a switch: the way of the
searcher's own axle, on the next switch the way joined to the track it
comes from. A vehicle on the other way is skipped unless the two are in
line end to end, their facing ends less than 2.2 m apart across so that
a pair of buffers meets (flank::EndsMeet()).

The flank contacts: the fouling zones of all rail switches are made
once (the tracks along each way up to the fouling point, 3.50 m between
the axes as found by fouling::find(), and 30 m past it); only a moving
vehicle with an axle in a zone is checked against the vehicles on the
other way of that switch. The footprints collide as for the vehicles
off the track; the side of a body crushes at 250 kN, past 0.5 m and at
an end at 2 MN, never more than stops the closing within the step. The
force slows both along their rails and loads their wheels across: a
vehicle with its end in the contact climbs at Nadal's limit held over
the 2 m window of EN 14363, a body hit along its side only at three
times the limit at once. It leaves the rails with the new derailment
cause flank_collision (14). Pairs in line end to end stay with the
collision of the ends.

Tests: tests/unit/test_flank_contact.cpp (the neighbours on a 1:9
switch, the crush forces, Skierniewice 2023, a graze at 5 km/h, steps
of 0.01 to 0.05 s); scenario cases eu07_td_switch_flank_foul,
_foul_buffers and _clear on td.scn. The coach of eu07_td_crew_refused
stood 0.6 m into the way of track 1 and is moved clear of the fouling
point.
2026-12-02 11:03:00 +01:00
jerrrrycho a81d149541 feat: a memory cell of its own for the derailment of a vehicle
report_derailment() writes the memory cell at once and only queues the
events, which run later in Events.update(). A collision derails both
vehicles in one frame, so when <A>:derailed ran, __simulation.derailment
already held B. The scenery can now declare the memory cell
<vehicle>:derailed, written the same way and with the same three fields
as __simulation.derailment, for the events of that one vehicle to read.

Documented that __simulation.derailment keeps only the last derailment
of a frame; eu07_td_off_track_end_scenery_told checks the cell of the
locomotive now.
2026-11-30 00:15:50 +01:00
jerrrrycho 61aaaa7c62 Merge staging into feat/derailment-event
# Conflicts:
#	physics/derailment.cpp
#	physics/derailment.h
#	tests/scenarios/README.md
#	tests/unit/test_derailment.cpp
2026-11-30 00:12:29 +01:00
jerrrrycho c1d1f1aead Merge staging into feat/derailment-event
# Conflicts:
#	McZapkie/Mover.cpp
#	vehicle/DynObj.cpp
2026-11-29 14:57:22 +01:00
jerrrrycho 1e825cb596 Merge staging into feat/derailment-trust-limits
# Conflicts:
#	McZapkie/Mover.cpp
2026-11-29 14:56:21 +01:00
Hirek 5a537e69f2 refactor(physics): McZapkie/ becomes physics/, its files get English names
The folder of the vehicle physics was named after the author of its first
version (2001). Its name now says what it holds, and so do its files:

  McZapkie/MOVER.h, Mover.cpp       -> physics/mover.h, mover.cpp
  McZapkie/hamulce.h, hamulce.cpp   -> physics/brakes.h, brakes.cpp
  McZapkie/Oerlikon_ESt.h, .cpp     -> physics/oerlikonest.h, .cpp
  friction, collision, couplerphysics, derailment: same names in physics/

Every include names the folder ("physics/mover.h"); the McZapkie include
directory is gone from CMakeLists.txt. The comments and documents that
named the old paths name the new ones. The credits to McZapkie stay.

Renames only: git sees every file as renamed (98-100%). 1142/1142 tests,
golden traces exact against staging 62f7a29b.
2026-11-27 17:11:46 +01:00