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

6 Commits

Author SHA1 Message Date
jerrrrycho
c554fff1ae test(physics): the coaches of the Baltyk case at their masses of the log, 36 t and 41.6 t 2026-11-16 01:17:08 +01:00
jerrrrycho
b5a0a8121d fix(physics): vehicles put down inside each other don't crush; automatic couplers have no side buffers
The rerun of calkowo_v2_kontenera with the energy budget still crushed and overrode its two
locomotives, at 9-13 km/h: the scenery puts the SM42 onto the SU45 with their middles 2.7 m
apart. The springs at the stops of both ends and the neighbours found at either end shake
such a pair up past the energy of the buffers. Pressed past the stop of their buffers and the
crush of their ends by more than 0.5 m (more than a hit takes them in a step), the pair is
inside each other: no crush, the legacy collision pushes them apart, and the log tells it once
(Bad scenery: A and B are inside each other ...).

An automatic coupler, or its adapter, has no buffers at the side: its draft gear takes in what
its springs of the .fiz do, so the budget leaves no EN 15551 capacity to such a pair. The
EN57-2000 hitting a standing one at 20 km/h (en57_2000_crush_new) crushes again.

The PoC cases of the energy budget, for the record: 15 km/h straight crushes 3 ends (0.18 m)
where it crushed 2 (0.16 m), the same empty pushed off; at 25-40 km/h fewer ends deep in the
trains crush on the straight, a few more in the curve, the locomotive overrides in all of them.
2026-11-16 01:00:36 +01:00
jerrrrycho
0f61567bcb fix(physics): only the energy of a hit past the buffers of EN 15551 crushes the ends
Found running every scenario of the install with physics.collisions new: two locomotives
(SU45 117 t, SM42 84 t) put down by calkowo_v2_kontenera inside each other crushed both their
ends at 5 km/h right after the start, deeper hit after hit, until both overrode (0.60 m); in
baltyk_sdm the coaches of a train pushed into a vehicle derailed at the end of the track (a
wall) crushed at 5-8 km/h. Some 50 kJ of relative motion, which the buffers take in with room
to spare. The crush went by the closing velocity at the stop of the buffers alone: buffers
pressed all the way from the start of the contact (put down overlapping, or knocked onto each
other by a hit elsewhere) left the whole hit to the underframes, every step anew.

Each pair now counts the energy of its contact (collision::contact_energy): what the springs
of the buffers take in while they're pressed and the pair closes in, kept down to what they
hold once they spring back, reset when they part. A hit may crush only what it brings to the
stop past what the buffers of EN 15551 of both ends would take in, by their BufferCategory
(the key now also gives that energy) or 30 kJ a buffer by default:

    budget = 1/2 mu v^2 - max(0, capacity - absorbed)

collision::hit() stops the crush once its work reaches the budget, the rest springs back.
The crush of a whole hit thus never takes more than the hit brought past the buffers; a train
behind pushing the pair on brings in more through the velocity of the next step. The monitor
goes by the same budget. The log of a crush tells the energies.

Pressing alone, a locomotive pushing a braked train at a stand, and vehicles put down
overlapping don't crush. The crash cases keep crushing: the hits of two masses, EU07 into a
430W, the EN 15227 units at 36 km/h and the 15 km/h PoC cases as before; at 25-40 km/h fewer
ends deep in the trains crush (the buffers of the couplings there take in their energy).
2026-11-16 00:26:18 +01:00
jerrrrycho
8070f79a3a feat(physics): physics.collisions new|old|monitor, apart from the model of the derailment
The crush of the ends, the override and the push off the track went by physics.derailment new. They have a switch of
their own now, physics.collisions, new by default: the derailment in a curve and the collisions can each be new or the
legacy ones. old is exactly the legacy rule of the safe closing speed weighed by the masses. monitor runs as old, and
for a hit on the buffers the crush model would not take elastically it logs once what the crush of the whole hit would
be (collision monitor: the closing speed, the crush of each end, the force, whether the draw gear tears off and which
vehicle would ride up onto the other one), without changing anything. The push off the track is not monitored: it
builds up from the crushed ends of the new model. The road vehicles keep the legacy rule with any value.

The tests that pin the legacy collisions pin physics.collisions old.
2026-11-15 20:09:57 +01:00
jerrrrycho
65fa4a1cc6 fix(physics): the traffic of the roads keeps the legacy collisions; the log of a crush tells what it went by
Found running line 107 with every train driven by the AI: two cars of its
traffic (Fiat 126p, Skoda 1100) met head-on at 119 km/h. With physics.derailment
new they bounced off each other elastically: their couplers have no steel to
speak of, so the steel took the hit and the legacy rule of 15 km/h was off. The
crush of the ends is for rail vehicles now; road vehicles keep the legacy rule
and derail as before.

The log of a crushed end, of an override and of a push off the track tells the
masses and the kinds of the vehicles, the crush and the force each end gives
at, the force of the hit and of the springs, the closing velocity and the
force, time and Y/Q of a push.
2026-11-15 13:32:08 +01:00
jerrrrycho
369f58a04a feat(physics): collisions crush the ends of the vehicles, override and push them off the track
With physics.derailment new, CollisionDetect() hands a hit on the stop of the
buffers harder than the steel takes elastically to crush_hit() (collision.h):

- the weaker end crushes for good at its crush force, the vehicles take the
  limited impulse, the depth stays with the end (TCoupling::crush) and lets the
  buffers of the pair meet closer, in both models of the coupling
- the crush lets the lighter vehicle, or the one with its buffers higher, climb
  onto the other one; the end crushed by 0.15 m tears off its draw gear, with
  the brake hose both parts of the train brake in emergency, and an automatic
  coupler torn off doesn't couple again
- after the collisions of each step the force pressing the ends pushes a light
  vehicle off the track by Y / Q held for 0.05 s
- off the rails in a collision the vehicle is upright off the rails as by the
  criteria of the speed: it slides with the friction of the ballast and keeps
  taking the hits and passing the forces on, instead of standing as a wall.
  CollisionDerail and the log tell the override from the push off; a crushed
  end logs the collision

It works in CollisionDetect(), which both models of the coupling reach once
their buffers go solid, so the trains of the AI the physical model of the
coupling doesn't cover crush alike. Hits the steel takes, and the draw gear
going solid, stay the legacy collision. physics.derailment old and off keep
the legacy collisions: the rule of 15 km/h weighed by the masses, the chance
of the coupler smashed, a derailed vehicle a wall; the tests of that rule run
with old.

The buffers of a category of EN 15551 and the crush, crash zone, anticlimber
and buffer height of an end are new optional keys of BuffCoupl.
2026-11-15 12:41:41 +01:00