mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 00:22:42 +01:00
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.
This commit is contained in:
+8
-9
@@ -56,7 +56,7 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
file(GLOB HEADERS "*.h"
|
||||
"Console/*.h"
|
||||
"McZapkie/*.h"
|
||||
"physics/*.h"
|
||||
"gl/*.h"
|
||||
"network/*.h"
|
||||
"vr/*.h"
|
||||
@@ -740,16 +740,16 @@ add_library(eu07_settings INTERFACE)
|
||||
# definition parser, the helpers they use and the rules of the test mode. built once, and tested as the game uses them
|
||||
set(CORE_SOURCES
|
||||
"audio/startsample.cpp"
|
||||
"McZapkie/friction.cpp"
|
||||
"McZapkie/hamulce.cpp"
|
||||
"McZapkie/Mover.cpp"
|
||||
"McZapkie/couplerphysics.cpp"
|
||||
"McZapkie/derailment.cpp"
|
||||
"McZapkie/collision.cpp"
|
||||
"physics/friction.cpp"
|
||||
"physics/brakes.cpp"
|
||||
"physics/mover.cpp"
|
||||
"physics/couplerphysics.cpp"
|
||||
"physics/derailment.cpp"
|
||||
"physics/collision.cpp"
|
||||
"vehicle/derailmotion.cpp"
|
||||
"world/TrackCheck.cpp"
|
||||
"world/SleeperPack.cpp"
|
||||
"McZapkie/Oerlikon_ESt.cpp"
|
||||
"physics/oerlikonest.cpp"
|
||||
"utilities/logfiles.cpp"
|
||||
"utilities/parser.cpp"
|
||||
"utilities/utilities.cpp"
|
||||
@@ -825,7 +825,6 @@ target_compile_definitions(eu07_settings INTERFACE ${DEFINITIONS})
|
||||
target_include_directories(eu07_settings INTERFACE
|
||||
"."
|
||||
"Console"
|
||||
"McZapkie"
|
||||
"gl"
|
||||
"${DEPS_DIR}/glad/include"
|
||||
"${DEPS_DIR}/dds-ktx/include"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# File structure
|
||||
| Directory| Description|
|
||||
|--|--|
|
||||
| McZapkie/ | Train Physics Engine |
|
||||
| physics/ | Vehicle physics: the mover, brakes, couplers, collisions, derailment |
|
||||
| gl/ | OpenGL Abstraction Layer|
|
||||
| network/ | Multiplayer Support
|
||||
| launcher/ | Scenario/Vehicle Selection (built in starter)|
|
||||
|
||||
@@ -13,9 +13,9 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
#include <typeinfo>
|
||||
#include "MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
//---FUNKCJE OGOLNE---
|
||||
@@ -33,7 +33,7 @@ Knorr/West EP - żeby był
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "friction.h" // Pascal unit
|
||||
#include "physics/friction.h" // Pascal unit
|
||||
|
||||
/// <summary>Number of positions of the local (auxiliary/manual) brake handle.</summary>
|
||||
static int const LocalBrakePosNo = 10; /*ilosc nastaw hamulca recznego lub pomocniczego*/
|
||||
@@ -8,13 +8,13 @@ http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "collision.h"
|
||||
#include "physics/collision.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
#include "derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
|
||||
namespace collision {
|
||||
|
||||
@@ -12,8 +12,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
|
||||
#include "couplerphysics.h"
|
||||
#include "derailment.h"
|
||||
#include "physics/couplerphysics.h"
|
||||
#include "physics/derailment.h"
|
||||
|
||||
// what a collision of two vehicles does to them past their buffers (physics.collisions new in eu07.ini, see
|
||||
// TMoverParameters::CollisionDetect()), as plain functions of the vehicles and the hit:
|
||||
@@ -8,7 +8,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "couplerphysics.h"
|
||||
#include "physics/couplerphysics.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@@ -8,7 +8,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@@ -112,7 +112,7 @@ struct vehicle_state {
|
||||
std::array<end_force, 2> ends{};
|
||||
};
|
||||
|
||||
// the dtrack_* flags of the track (MOVER.h) the criteria look at
|
||||
// the dtrack_* flags of the track (mover.h) the criteria look at
|
||||
namespace track_damage {
|
||||
inline constexpr int railwear{2};
|
||||
inline constexpr int freerail{4};
|
||||
@@ -13,7 +13,7 @@ Copyright (C) 2007-2013 Maciej Cierniak
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "friction.h"
|
||||
#include "physics/friction.h"
|
||||
|
||||
double TFricMat::GetFC(double N, double Vel)
|
||||
{
|
||||
@@ -8,10 +8,10 @@ http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "Oerlikon_ESt.h"
|
||||
#include "physics/oerlikonest.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "utilities/Timer.h"
|
||||
@@ -14,10 +14,10 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include "hamulce.h"
|
||||
#include "couplerphysics.h"
|
||||
#include "derailment.h"
|
||||
#include "collision.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "physics/couplerphysics.h"
|
||||
#include "physics/derailment.h"
|
||||
#include "physics/collision.h"
|
||||
#include "scripting/ladderlogic.h"
|
||||
#include "vehicle/derailmotion.h"
|
||||
#include "vehicle/odometerreading.h"
|
||||
@@ -13,7 +13,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Oerlikon_ESt.h"
|
||||
#include "physics/oerlikonest.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
// wstepny nacisk sprezyn na glowny przyrzad rozrzadczy, wyrazony jako roznica cisnien ZS - PG [bar]
|
||||
@@ -19,8 +19,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include "hamulce.h" // Pascal unit
|
||||
#include "friction.h" // Pascal unit
|
||||
#include "physics/brakes.h" // Pascal unit
|
||||
#include "physics/friction.h" // Pascal unit
|
||||
|
||||
/*
|
||||
(C) youBy
|
||||
@@ -1,6 +1,6 @@
|
||||
# Coverage of the simulation core by the unit tests
|
||||
|
||||
These tests characterise the physics of the vehicles (`McZapkie/Mover.cpp`, `hamulce.cpp`, `Oerlikon_ESt.cpp`, `friction.cpp`). They exist to show that refactors of those files, such as splitting `TractionForce` or `RunCommand`, leave the behaviour as it was. This page lists:
|
||||
These tests characterise the physics of the vehicles (`physics/mover.cpp`, `brakes.cpp`, `oerlikonest.cpp`, `friction.cpp`). They exist to show that refactors of those files, such as splitting `TractionForce` or `RunCommand`, leave the behaviour as it was. This page lists:
|
||||
|
||||
- what the tests reach;
|
||||
- what nothing in the game ever runs;
|
||||
@@ -14,9 +14,9 @@ Coverage was measured on Windows with MSVC's SanitizerCoverage (`/fsanitize-cove
|
||||
|
||||
| File | Blocks run, at the start | Now |
|
||||
|---|---|---|
|
||||
| `Mover.cpp` | 8.9% | 80.7% (3323 of 4118) |
|
||||
| `hamulce.cpp` | 30% | 76.3% (649 of 851) |
|
||||
| `Oerlikon_ESt.cpp` | 58% | 87.4% (118 of 135) |
|
||||
| `mover.cpp` | 8.9% | 80.7% (3323 of 4118) |
|
||||
| `brakes.cpp` | 30% | 76.3% (649 of 851) |
|
||||
| `oerlikonest.cpp` | 58% | 87.4% (118 of 135) |
|
||||
| `friction.cpp` | 9% | 90.9% (10 of 11) |
|
||||
|
||||
The aim is branch coverage with the rest explained below, not 100%.
|
||||
@@ -34,8 +34,8 @@ Nothing creates these objects or calls these functions anywhere in the game, whi
|
||||
- **`TFV4a`** (`GetPF`, `Init`): the FV4a handle of the vehicle definitions creates `TFV4aM`.
|
||||
- **Base implementations always overridden:** `TFricMat::GetFC` (every material, the default P10 too, has its own) and `TPrzekladnik::Update` (every relay has its own).
|
||||
- **Functions without callers:**
|
||||
- In `hamulce.cpp`: `PF_old`, `TBrake::GetBCF`, `TDriverHandle::OvrldButton`, `TReservoir::pa` and `TBrakeCyl::pa`.
|
||||
- In `Mover.cpp`: `BrakeVP`, `PipeRatio`, `RealPipeRatio`, `IncBrakeLevel`, `DecBrakeLevel`, `IncBrakePress`, `DecBrakePress`, `MainCtrlActualPowerPos` and `GetExternalCommand`.
|
||||
- In `brakes.cpp`: `PF_old`, `TBrake::GetBCF`, `TDriverHandle::OvrldButton`, `TReservoir::pa` and `TBrakeCyl::pa`.
|
||||
- In `mover.cpp`: `BrakeVP`, `PipeRatio`, `RealPipeRatio`, `IncBrakeLevel`, `DecBrakeLevel`, `IncBrakePress`, `DecBrakePress`, `MainCtrlActualPowerPos` and `GetExternalCommand`.
|
||||
- **Inverter failures** of the induction motor drives (`inverter::Failure_Drive`, `Failure_Const`, `Activate`): nothing ever sets them. The cab only shows them. The branches reading them in `TractionForce` can't be reached.
|
||||
|
||||
## Code only data no game vehicle has would run
|
||||
@@ -95,7 +95,7 @@ The per-file table further down is from the run before the tests of the parser,
|
||||
|
||||
| File | Lines run | Functions run |
|
||||
|---|---|---|
|
||||
| `McZapkie/couplerphysics.cpp` | 93.6% (147 of 157) | 20 of 21 |
|
||||
| `physics/couplerphysics.cpp` | 93.6% (147 of 157) | 20 of 21 |
|
||||
| `scripting/ladderlogic.cpp` | 4.1% (9 of 217) | 2 of 11 |
|
||||
| `scripting/ladderlogic.h` | 0% (0 of 25) | 0 of 4 |
|
||||
| `scripting/luaprogram.cpp` | 74.7% (334 of 447) | 50 of 66 |
|
||||
@@ -163,9 +163,9 @@ The tests are written for the first two columns, and for what the game doesn't c
|
||||
|
||||
The tests record the behaviour as it is. The following points may deserve a look by someone who knows how the real vehicles behave.
|
||||
|
||||
- **`Random(10) - Random(10)` (`Mover.cpp`, the noise of the control pipe pressure `CntrlPipePress`):** the order the two calls were evaluated in isn't specified. MSVC Release, MSVC Debug and GCC gave different traces, a control pipe pressure mirrored around 5 bar, which failed 32 tests on the Linux CI. Fixed: the draws are sequenced in the order of MSVC Release, which the golden traces were recorded with.
|
||||
- **`Random(10) - Random(10)` (`mover.cpp`, the noise of the control pipe pressure `CntrlPipePress`):** the order the two calls were evaluated in isn't specified. MSVC Release, MSVC Debug and GCC gave different traces, a control pipe pressure mirrored around 5 bar, which failed 32 tests on the Linux CI. Fixed: the draws are sequenced in the order of MSVC Release, which the golden traces were recorded with.
|
||||
- **`TCommand::Location` isn't initialised** in a new vehicle. The game always sets it through `PutCommand()`, but a test calling `RunCommand()` directly got different results run to run.
|
||||
- **`CompressorList` is `int[4][9]`** (`MOVER.h`), though its factors are fractions: 0.9 is read as 0. No game vehicle has the list yet.
|
||||
- **`CompressorList` is `int[4][9]`** (`mover.h`), though its factors are fractions: 0.9 is read as 0. No game vehicle has the list yet.
|
||||
- **A train whose pipe leaks under 2.75 bar before its start-up can't be released:**
|
||||
- Where this happens: an FV4a handle and an LSt valve, for example 4 minutes standing with wagons, waiting for a hot engine.
|
||||
- The cause: the pipe gets cut off the main reservoir (`lock_old` in `UpdatePipePressure`). The AI presses its unlock button only for the lock set by `LPOn` and `LPOff` (`control_main_pipe`).
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "golden.h"
|
||||
#include "doctest.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "vehicle/fieldshunting.h"
|
||||
|
||||
namespace test {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
namespace test {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
namespace test {
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "figures.h"
|
||||
#include "invariants.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
namespace test {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "scenario.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
namespace test {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "golden.h"
|
||||
#include "real_vehicles.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
#include <array>
|
||||
#include <map>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "drive.h"
|
||||
#include "consist.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
using test::definition;
|
||||
using test::vehicle;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/mover.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "consist.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/mover.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "vehicle.h"
|
||||
#include "vehicle/brakesetting.h"
|
||||
#include "vehicle/Driver.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "scenario.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
// characterisation of what the cab (Train.cpp) and the AI (Driver.cpp, driverhints.cpp) call on a vehicle
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include "consist.h"
|
||||
#include "drive.h"
|
||||
#include "vehicle.h"
|
||||
#include "McZapkie/collision.h"
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/collision.h"
|
||||
#include "physics/mover.h"
|
||||
#include "utilities/Globals.h"
|
||||
|
||||
#include <cmath>
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// collisions past the buffers with physics.collisions new (McZapkie/collision.h): the crush of the ends, the override,
|
||||
// collisions past the buffers with physics.collisions new (physics/collision.h): the crush of the ends, the override,
|
||||
// the push off the track, and what they do in trains of real vehicles
|
||||
|
||||
using test::consist;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <format>
|
||||
#include <functional>
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
// characterisation of the commands vehicles pass each other along the couplers (RunCommand): what each of them
|
||||
// does to every real vehicle, recorded in golden traces (data/golden/commands/), how they travel through a train of
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "drive.h"
|
||||
#include "golden.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
using test::consist;
|
||||
using test::definition;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "scenario.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#include "doctest.h"
|
||||
#include "vehicle.h"
|
||||
#include "consist.h"
|
||||
#include "McZapkie/couplerphysics.h"
|
||||
#include "physics/couplerphysics.h"
|
||||
#include "utilities/Globals.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
// the physical model of the couplings (McZapkie/couplerphysics.h, couplerphysics in eu07.ini): progressive buffers and
|
||||
// the physical model of the couplings (physics/couplerphysics.h, couplerphysics in eu07.ini): progressive buffers and
|
||||
// draw gear with friction hysteresis, pressed in series, the play of the coupling, its yield and its breaking
|
||||
|
||||
using test::definition;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "consist.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "vehicle/crew.h"
|
||||
|
||||
// a driver put in a vehicle or taken off it by a "Crew:<vehicle>" putvalues event (eu07/maszyna#510): reading the
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include "doctest.h"
|
||||
#include "vehicle.h"
|
||||
#include "vehicle/derailmotion.h"
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/derailment.h"
|
||||
#include "physics/mover.h"
|
||||
#include "utilities/Globals.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
|
||||
// the criteria of derailment (McZapkie/derailment.h): overturning by the lateral acceleration the cant doesn't
|
||||
// the criteria of derailment (physics/derailment.h): overturning by the lateral acceleration the cant doesn't
|
||||
// balance, the flange climbing the rail by Nadal's Y/Q, either held over 2 m
|
||||
|
||||
namespace dr = derailment;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
#include "vehicle.h"
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/derailment.h"
|
||||
#include "physics/mover.h"
|
||||
#include "utilities/Globals.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
// a vehicle too fast in a curve with physics.derailment of eu07.ini: the criteria of McZapkie/derailment.h checked by
|
||||
// a vehicle too fast in a curve with physics.derailment of eu07.ini: the criteria of physics/derailment.h checked by
|
||||
// TMoverParameters::check_derailment(), and what the vehicle comes to off the rails
|
||||
|
||||
using test::definition;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "scenario.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
// characterisation of the diesel engines besides their drive, recorded in golden traces (data/golden/diesel/):
|
||||
// the heat of the engine, its oil and its water circuits, which keep a too cold or too hot engine from starting
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "real_vehicles.h"
|
||||
|
||||
#include "vehicle/drivingaid.h"
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "drive.h"
|
||||
#include "real_vehicles.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
// the dynamic brake of the diesel-electric vehicles (Engine: EDBrake=, MaSzyna-EU07/maszyna#82): the traction motors
|
||||
// brake into resistors while the engine runs, with the force of the definition (EDBrakeFmax, the power limit
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "consist.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <initializer_list>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "doctest.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
#include <format>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/mover.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "consist.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "drive.h"
|
||||
#include "golden.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
// the genset of a dual-mode vehicle (eu07/maszyna#536): a second source of the traction circuit of an induction
|
||||
// motor vehicle next to its pantographs, which the traction selector picks. the vehicle is the game's E6ACT
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "drive.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
// the line contactors interlocked with the fans of the traction motors (eu07/maszyna#460): on the ET42 the fans of a
|
||||
// section run off its own converter, and with them switched off the line contactors of that section don't close.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "doctest.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
// the pressure switch of the EP05 (git.eu07.pl eu07/maszyna#48). the pressure switch of the simulator is two
|
||||
// conditions in one: it cuts the traction motors off above 2 bar in the brake cylinders and below 3.6 bar in the
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "doctest.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "utilities/utilities.h"
|
||||
#include "vehicle/timetableservice.h"
|
||||
#include "world/timetablereader.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
#include "world/TrackBuckle.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "real_vehicles.h"
|
||||
#include "scenario.h"
|
||||
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
using test::definition;
|
||||
using test::vehicle;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
namespace test {
|
||||
|
||||
|
||||
@@ -1060,7 +1060,7 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
|
||||
|
||||
if (token == "physics.derailment")
|
||||
{
|
||||
// new: the physical criteria (McZapkie/derailment.h), old: the legacy draw, off: no derailment from the speed,
|
||||
// new: the physical criteria (physics/derailment.h), old: the legacy draw, off: no derailment from the speed,
|
||||
// monitor: the legacy draw, and the criteria to the log
|
||||
std::string model;
|
||||
ParseOne(Parser, model, 1);
|
||||
@@ -1076,7 +1076,7 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
|
||||
|
||||
if (token == "physics.collisions")
|
||||
{
|
||||
// new: the crush of the ends past the buffers (McZapkie/collision.h), old: the legacy rule, monitor: the legacy
|
||||
// new: the crush of the ends past the buffers (physics/collision.h), old: the legacy rule, monitor: the legacy
|
||||
// rule, and the crush to the log
|
||||
std::string model;
|
||||
ParseOne(Parser, model, 1);
|
||||
|
||||
+3
-3
@@ -359,14 +359,14 @@ struct global_settings {
|
||||
// buckles the scenery enters and its trackbuckle events; automatic, also by the temperature of the rails at the weak places
|
||||
enum class track_buckling_mode { off, scenery, automatic };
|
||||
track_buckling_mode track_buckling = track_buckling_mode::scenery;
|
||||
// the physical model of the couplings (McZapkie/couplerphysics.h): progressive buffers and draw gear with hysteresis,
|
||||
// the physical model of the couplings (physics/couplerphysics.h): progressive buffers and draw gear with hysteresis,
|
||||
// the play of the coupling, its yield and breaking; the legacy model of TMoverParameters::CouplerForce() without it.
|
||||
// it covers the player's train and the trains it closes in on (vehicle_table::update_coupler_physics()), or every
|
||||
// train with coupler_physics_all
|
||||
bool coupler_physics = false;
|
||||
bool coupler_physics_all = false;
|
||||
// a vehicle too fast in a curve (physics.derailment in eu07.ini): new, it overturns or its flange climbs the rail
|
||||
// by the criteria of McZapkie/derailment.h held over 2 m, and slides on with the friction of the ballast; old, the
|
||||
// by the criteria of physics/derailment.h held over 2 m, and slides on with the friction of the ballast; old, the
|
||||
// legacy draw of the lateral acceleration against the gauge to the height of the vehicle in every step, which stops
|
||||
// it; off, it stays on the rails at any speed; monitor, the legacy draw decides and the log tells where the criteria
|
||||
// would derail a vehicle (derailment monitor:, once for a vehicle on a track), for the run of a scenery as it was.
|
||||
@@ -375,7 +375,7 @@ struct global_settings {
|
||||
enum class derailment_model { off, old, physical, monitor };
|
||||
derailment_model derailment = derailment_model::monitor;
|
||||
// the collisions of rail vehicles past their buffers (physics.collisions in eu07.ini): new, the ends crush, a vehicle
|
||||
// may ride up onto the other one or be pushed off the track (McZapkie/collision.h); old, the legacy rule of the safe
|
||||
// may ride up onto the other one or be pushed off the track (physics/collision.h); old, the legacy rule of the safe
|
||||
// closing speed weighed by the masses; monitor, the legacy rule decides and the log tells what the crush would be
|
||||
// (collision monitor:, once for a hit). the road vehicles of the traffic keep the legacy rule with any
|
||||
enum class collision_model { old, physical, monitor };
|
||||
|
||||
@@ -15,7 +15,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "utilities/translation.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
void locale::init()
|
||||
{
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "utilities/Timer.h"
|
||||
#include "vehicle/Driver.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <string_view>
|
||||
#include "utilities/Classes.h"
|
||||
#include "utilities/utilities.h"
|
||||
#include "MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "audio/sound.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "world/mtable.h"
|
||||
|
||||
+1
-1
@@ -3130,7 +3130,7 @@ derail_motion::formation TDynamicObject::track_bed() const {
|
||||
int TDynamicObject::outward_side() const {
|
||||
|
||||
// the track as designed turns from the rear axle to the front one: the outside of its curve, or its inside where a
|
||||
// buckle bends the line the other way more than the curve does (the criteria of derailment, McZapkie/derailment.h)
|
||||
// buckle bends the line the other way more than the curve does (the criteria of derailment, physics/derailment.h)
|
||||
if( auto const design { std::sin( Axle1.vAngles.z - Axle0.vAngles.z ) }; std::abs( design ) >= 1e-4 ) {
|
||||
auto const outside { design > 0.0 ? -1 : 1 };
|
||||
return MoverParameters->DerailAcceleration < 0.0 ? -outside : outside;
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include "utilities/Classes.h"
|
||||
#include "interfaces/IMaterial.h"
|
||||
#include "MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "world/TrkFoll.h"
|
||||
#include "vehicle/Button.h"
|
||||
#include "vehicle/AirCoupler.h"
|
||||
@@ -774,7 +774,7 @@ private:
|
||||
void crop_off_track_terrain();
|
||||
// the bed of the track at the axles, the level direction of the track there, and the side the derailment throws the
|
||||
// vehicle to (1 the left of the front, -1 the right, 0 none): out of the curve of the track as designed, into it
|
||||
// where a buckle bends the line the other way more (McZapkie/derailment.h); on a straight track out of the turn of
|
||||
// where a buckle bends the line the other way more (physics/derailment.h); on a straight track out of the turn of
|
||||
// the path as it lies, a buckle on it
|
||||
derail_motion::formation track_bed() const;
|
||||
glm::dvec3 track_front() const;
|
||||
|
||||
@@ -10,8 +10,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/brakesetting.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/mover.h"
|
||||
#include "physics/brakes.h"
|
||||
#include "vehicle/Driver.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/crew.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "vehicle/handover.h"
|
||||
|
||||
namespace crew {
|
||||
|
||||
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/derailmotion.h"
|
||||
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
@@ -19,7 +19,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
// a rail vehicle off the rails (physics.derailment new, see McZapkie/derailment.h for when it derails): from then on
|
||||
// a rail vehicle off the rails (physics.derailment new, see physics/derailment.h for when it derails): from then on
|
||||
// it doesn't follow the track any more, it moves on the ground by itself until the friction stops it.
|
||||
//
|
||||
// along: the longitudinal motion stays with the physics of the vehicle (TMoverParameters), which brakes it with the
|
||||
@@ -39,7 +39,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
// the height and the attitude: the ground under the supports of the vehicle (the ends of its wheelbase, the wheels
|
||||
// of both sides) gives its height, its pitch and its roll; it doesn't sink into the ground, it falls off a step
|
||||
// tipping over: about the wheels of one side, the body as a rigid one with the lean of its suspension, so it tips at
|
||||
// the very lateral acceleration the wheel unloading of McZapkie/derailment.h reaches 1 at. what tips it: the
|
||||
// the very lateral acceleration the wheel unloading of physics/derailment.h reaches 1 at. what tips it: the
|
||||
// overturning in the curve while its outer wheels still run on the rail (the curve keeps pushing it out as v^2/R,
|
||||
// the excess over the limit the faster it tips), the slope of the ground across it, and the friction under it
|
||||
// while it slides sideways. once over its tipping angle it falls on its side, at 90 degrees, and stays there
|
||||
@@ -67,7 +67,7 @@ inline constexpr double guided_friction{0.1};
|
||||
// of the wheels, or of the body on its side, sliding across the heading
|
||||
inline constexpr double lateral_friction{0.5};
|
||||
// the friction along the heading: upright on its wheels on the sleepers and the ballast, rising to the friction of a
|
||||
// vehicle on its side (McZapkie/derailment.h) as it tips over
|
||||
// vehicle on its side (physics/derailment.h) as it tips over
|
||||
double sliding_friction(double Tipping, bool Guided);
|
||||
|
||||
// ---- the way the vehicle leaves the track
|
||||
@@ -299,7 +299,7 @@ struct vehicle_shape {
|
||||
double centre_of_gravity{1.5}; // its height above the rail [m]
|
||||
double contact_spacing{1.5}; // of the wheels of a wheelset [m]
|
||||
double base{10.0}; // between the bogie pivots or the outer axles, which it rests on lengthwise [m]
|
||||
// the lean of the body on the suspension, as McZapkie/derailment.h takes it: flexibility and roll centre
|
||||
// the lean of the body on the suspension, as physics/derailment.h takes it: flexibility and roll centre
|
||||
double flexibility{0.4};
|
||||
double roll_centre{0.5};
|
||||
// [kg] for the forces of the couplings on it; none: they don't move it
|
||||
|
||||
@@ -10,8 +10,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/drivingaid.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "McZapkie/hamulce.h"
|
||||
#include "physics/mover.h"
|
||||
#include "physics/brakes.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/enginestart.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
namespace engine_start {
|
||||
|
||||
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/handover.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
namespace handover {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
// the lights the light preset selector (programmer) of the occupied cab gives one vehicle of the consist
|
||||
namespace lights_programmer {
|
||||
|
||||
@@ -9,7 +9,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
// the position the controller position marker of the cab (mainctrlact:) shows
|
||||
namespace main_ctrl_act {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/smoke.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
namespace smoke {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "stdafx.h"
|
||||
#include "vehicle/timetableservice.h"
|
||||
|
||||
#include "McZapkie/MOVER.h"
|
||||
#include "physics/mover.h"
|
||||
|
||||
namespace timetable {
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "McZapkie/derailment.h"
|
||||
#include "physics/derailment.h"
|
||||
#include "world/TrackUneven.h"
|
||||
|
||||
#include <array>
|
||||
@@ -20,7 +20,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <vector>
|
||||
|
||||
// the check of the geometry of the rail tracks of a scenery (physics.trackcheck yes in eu07.ini): what the criteria of
|
||||
// derailment (McZapkie/derailment.h) and the plain rules of the track find suspicious, to the log once the scenery
|
||||
// derailment (physics/derailment.h) and the plain rules of the track find suspicious, to the log once the scenery
|
||||
// loaded, so a run can tell a faulty scenery from a faulty simulation. one line for a track with all it found
|
||||
// ("trackcheck: <name>: ..."), and a summary with the count of each kind. the damage flags are only counted: sceneries
|
||||
// set them for the jolts of a worn track (damage 31 on every track of line 107). a curve without a speed limit of its
|
||||
|
||||
Reference in New Issue
Block a user