18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 05:57:08 +01:00

refactor(physics): the motion of the vehicle is private to it

The speed along the couplers, the location, the offsets from the track axis,
the accelerations, the distance counter and the distance moved since the last
check, the flat of the wheels and the truck hunting, the distance of the
derailment check, whether the vehicle is inside a consist and in the coupler
model, the analog demand of the integrated controller and the flow of the pipe
stabiliser are private to physics::Vehicle. TDynamicObject places and moves the
vehicle, the scenery puts road vehicles on their way and the contacts push them
through the operations (SetV(), SetLoc(), SetOffsetTrackH(), ...), and the
jolts of the track are ShakeVertically() and ShakeHorizontally(), the same
additions as before.

No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
2026-11-29 12:43:38 +01:00
parent 0b5459ef7b
commit f65411a668
68 changed files with 387 additions and 348 deletions
+4 -4
View File
@@ -437,10 +437,10 @@ void state_manager::process_commands() {
while (vehicle) {
// no damage, back on the rails with the state of the derailment cleared
vehicle->physics->repair_damage();
vehicle->physics->V = 0.000001; // HACK: force vehicle position re-calculation
vehicle->physics->DistCounter = 0.0;
vehicle->physics->OffsetTrackH = 0.0;
vehicle->physics->OffsetTrackV = 0.0;
vehicle->physics->SetV(0.000001); // HACK: force vehicle position re-calculation
vehicle->physics->SetDistCounter(0.0);
vehicle->physics->SetOffsetTrackH(0.0);
vehicle->physics->SetOffsetTrackV(0.0);
// pantographs
for( auto idx = 0; idx < vehicle->iAnimType[ ANIM_PANTS ]; ++idx ) {