From d4bd3fc5caa2d1481a2facc08c5473f658d33cdb Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Sat, 28 Nov 2026 00:28:34 +0100 Subject: [PATCH] refactor(physics): physics/mover/ becomes physics/components/ The files of the parts of a vehicle (pneumatics, electrics, traction, doors, drives...) are in physics/components/, not under the old name of the mover; the file of the vehicle as a body, its forces and its movement, is body.cpp (was mover.cpp). The includes, CMakeLists.txt and AGENTS.md name the new paths. Renames only. 1144/1144 tests, golden traces exact against staging 62f7a29b. --- AGENTS.md | 4 +-- CMakeLists.txt | 34 +++++++++---------- .../{mover/mover.cpp => components/body.cpp} | 2 +- physics/{mover => components}/cab.cpp | 2 +- physics/{mover => components}/collisions.cpp | 2 +- physics/{mover => components}/commands.cpp | 2 +- physics/{mover => components}/controllers.cpp | 2 +- physics/{mover => components}/couplers.cpp | 2 +- physics/{mover => components}/diesel.cpp | 4 +-- physics/{mover => components}/doors.cpp | 2 +- physics/{mover => components}/drive.cpp | 2 +- physics/{mover => components}/drive.h | 0 physics/{mover => components}/electrics.cpp | 2 +- physics/{mover => components}/fizparser.cpp | 2 +- physics/{mover => components}/fizsections.cpp | 2 +- physics/{mover => components}/internal.h | 2 +- physics/{mover => components}/pneumatics.cpp | 2 +- .../{mover => components}/securitysystem.cpp | 2 +- physics/{mover => components}/setup.cpp | 2 +- physics/{mover => components}/traction.cpp | 4 +-- physics/mover.h | 2 +- 21 files changed, 39 insertions(+), 39 deletions(-) rename physics/{mover/mover.cpp => components/body.cpp} (99%) rename physics/{mover => components}/cab.cpp (99%) rename physics/{mover => components}/collisions.cpp (99%) rename physics/{mover => components}/commands.cpp (99%) rename physics/{mover => components}/controllers.cpp (99%) rename physics/{mover => components}/couplers.cpp (99%) rename physics/{mover => components}/diesel.cpp (99%) rename physics/{mover => components}/doors.cpp (99%) rename physics/{mover => components}/drive.cpp (99%) rename physics/{mover => components}/drive.h (100%) rename physics/{mover => components}/electrics.cpp (99%) rename physics/{mover => components}/fizparser.cpp (99%) rename physics/{mover => components}/fizsections.cpp (99%) rename physics/{mover => components}/internal.h (88%) rename physics/{mover => components}/pneumatics.cpp (99%) rename physics/{mover => components}/securitysystem.cpp (99%) rename physics/{mover => components}/setup.cpp (99%) rename physics/{mover => components}/traction.cpp (99%) diff --git a/AGENTS.md b/AGENTS.md index 82ba88bc4..82285b488 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -107,7 +107,7 @@ Code that isn't otherwise touched keeps its names; renaming a member goes togeth scripts and the log read stays byte for byte the same whatever the C++ names are: the keywords of the `.fiz` and the scenery, the keys of the dictionaries of the Python screens, the texts of the log and of `STR(...)`. -The vehicle code is in `physics/` (the physics of the vehicles: `mover.h` and `physics/mover/*.cpp` by subsystem, `brakes.*`, +The vehicle code is in `physics/` (the physics of the vehicles: `mover.h` and `physics/components/*.cpp` by subsystem, `brakes.*`, couplers, collisions, derailment) and `vehicle/` (the vehicle in the scenery, the cab, the AI). Keep it that way: - `physics/vehicletypes.h` holds the vocabulary the rest of the simulator passes around (vehicle ends, sides, couplings, lights, @@ -117,7 +117,7 @@ couplers, collisions, derailment) and `vehicle/` (the vehicle in the scenery, th an `int`. Numbers of the formats (`.scn`, events, the network) are read into these where they come in and written where they go out. - The commands between the vehicles are `VehicleCommand` (`physics/vehiclecommand.h`); their text names only matter where a command comes as text. -- What depends on the kind of drive (`EngineType`) goes into its class in `physics/mover/drive.*`, not into a new `switch`. +- What depends on the kind of drive (`EngineType`) goes into its class in `physics/components/drive.*`, not into a new `switch`. ## Renderers: the move to OpenGL 4.6 and Vulkan diff --git a/CMakeLists.txt b/CMakeLists.txt index 04e07b4a5..eecd0f45b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ set(CMAKE_CXX_STANDARD 20) file(GLOB HEADERS "*.h" "Console/*.h" "physics/*.h" -"physics/mover/*.h" +"physics/components/*.h" "gl/*.h" "network/*.h" "vr/*.h" @@ -745,22 +745,22 @@ set(CORE_SOURCES "physics/friction.cpp" "physics/brakes.cpp" "physics/vehiclecommand.cpp" -"physics/mover/mover.cpp" -"physics/mover/drive.cpp" -"physics/mover/cab.cpp" -"physics/mover/collisions.cpp" -"physics/mover/commands.cpp" -"physics/mover/controllers.cpp" -"physics/mover/couplers.cpp" -"physics/mover/diesel.cpp" -"physics/mover/doors.cpp" -"physics/mover/electrics.cpp" -"physics/mover/fizparser.cpp" -"physics/mover/fizsections.cpp" -"physics/mover/pneumatics.cpp" -"physics/mover/securitysystem.cpp" -"physics/mover/setup.cpp" -"physics/mover/traction.cpp" +"physics/components/body.cpp" +"physics/components/drive.cpp" +"physics/components/cab.cpp" +"physics/components/collisions.cpp" +"physics/components/commands.cpp" +"physics/components/controllers.cpp" +"physics/components/couplers.cpp" +"physics/components/diesel.cpp" +"physics/components/doors.cpp" +"physics/components/electrics.cpp" +"physics/components/fizparser.cpp" +"physics/components/fizsections.cpp" +"physics/components/pneumatics.cpp" +"physics/components/securitysystem.cpp" +"physics/components/setup.cpp" +"physics/components/traction.cpp" "physics/couplerphysics.cpp" "physics/derailment.cpp" "physics/collision.cpp" diff --git a/physics/mover/mover.cpp b/physics/components/body.cpp similarity index 99% rename from physics/mover/mover.cpp rename to physics/components/body.cpp index fa6f20c1e..d34396304 100644 --- a/physics/mover/mover.cpp +++ b/physics/components/body.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" std::vector const TMoverParameters::eimc_labels = {"dfic: ", "dfmax:", "p: ", "scfu: ", "cim: ", "icif: ", "Uzmax:", "Uzh: ", "DU: ", "I0: ", "fcfu: ", diff --git a/physics/mover/cab.cpp b/physics/components/cab.cpp similarity index 99% rename from physics/mover/cab.cpp rename to physics/components/cab.cpp index 760327cdb..02bd95d0e 100644 --- a/physics/mover/cab.cpp +++ b/physics/components/cab.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" bool TMoverParameters::DirectionForward() diff --git a/physics/mover/collisions.cpp b/physics/components/collisions.cpp similarity index 99% rename from physics/mover/collisions.cpp rename to physics/components/collisions.cpp index a696bba8b..948db6fa5 100644 --- a/physics/mover/collisions.cpp +++ b/physics/components/collisions.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" double ComputeCollision(double &v1, double &v2, double m1, double m2, double beta, bool vc) diff --git a/physics/mover/commands.cpp b/physics/components/commands.cpp similarity index 99% rename from physics/mover/commands.cpp rename to physics/components/commands.cpp index 2fc63a698..74f1a37bc 100644 --- a/physics/mover/commands.cpp +++ b/physics/components/commands.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" // ************************************************************************************************* diff --git a/physics/mover/controllers.cpp b/physics/components/controllers.cpp similarity index 99% rename from physics/mover/controllers.cpp rename to physics/components/controllers.cpp index eba9ad73b..0dcfcbe75 100644 --- a/physics/mover/controllers.cpp +++ b/physics/components/controllers.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" // ************************************************************************************************* diff --git a/physics/mover/couplers.cpp b/physics/components/couplers.cpp similarity index 99% rename from physics/mover/couplers.cpp rename to physics/components/couplers.cpp index 6acf3f233..5fb3b55ef 100644 --- a/physics/mover/couplers.cpp +++ b/physics/components/couplers.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" // Ra: tu należy przenosić funcje z mover.pas, które nie są z niego wywoływane. // Jeśli jakieś zmienne nie są używane w mover.pas, też można je przenosić. diff --git a/physics/mover/diesel.cpp b/physics/components/diesel.cpp similarity index 99% rename from physics/mover/diesel.cpp rename to physics/components/diesel.cpp index e2e95959f..0be62d9a2 100644 --- a/physics/mover/diesel.cpp +++ b/physics/components/diesel.cpp @@ -27,8 +27,8 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" -#include "physics/mover/drive.h" +#include "physics/components/internal.h" +#include "physics/components/drive.h" double TMoverParameters::EngineRPMRatio() const diff --git a/physics/mover/doors.cpp b/physics/components/doors.cpp similarity index 99% rename from physics/mover/doors.cpp rename to physics/components/doors.cpp index 923496d4d..c9334a56e 100644 --- a/physics/mover/doors.cpp +++ b/physics/components/doors.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" bool TMoverParameters::AssignLoad(std::string const &Loadname, float const Amount) diff --git a/physics/mover/drive.cpp b/physics/components/drive.cpp similarity index 99% rename from physics/mover/drive.cpp rename to physics/components/drive.cpp index d108a8494..55284f396 100644 --- a/physics/mover/drive.cpp +++ b/physics/components/drive.cpp @@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/. // the drives of the vehicles, one class for each kind of engine #include "stdafx.h" -#include "physics/mover/drive.h" +#include "physics/components/drive.h" #include #include diff --git a/physics/mover/drive.h b/physics/components/drive.h similarity index 100% rename from physics/mover/drive.h rename to physics/components/drive.h diff --git a/physics/mover/electrics.cpp b/physics/components/electrics.cpp similarity index 99% rename from physics/mover/electrics.cpp rename to physics/components/electrics.cpp index ada624e72..536d24579 100644 --- a/physics/mover/electrics.cpp +++ b/physics/components/electrics.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" // KURS90 - sprężarka pantografów; Ra 2014-07: teraz jest to zbiornik rozrządu, chociaż to jeszcze nie tak diff --git a/physics/mover/fizparser.cpp b/physics/components/fizparser.cpp similarity index 99% rename from physics/mover/fizparser.cpp rename to physics/components/fizparser.cpp index a0a293682..32a50d653 100644 --- a/physics/mover/fizparser.cpp +++ b/physics/components/fizparser.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" int ConversionError = 0; diff --git a/physics/mover/fizsections.cpp b/physics/components/fizsections.cpp similarity index 99% rename from physics/mover/fizsections.cpp rename to physics/components/fizsections.cpp index 8bf7673c6..b567b3712 100644 --- a/physics/mover/fizsections.cpp +++ b/physics/components/fizsections.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" int s2NPW(std::string s) diff --git a/physics/mover/internal.h b/physics/components/internal.h similarity index 88% rename from physics/mover/internal.h rename to physics/components/internal.h index c85dd999f..a43782492 100644 --- a/physics/mover/internal.h +++ b/physics/components/internal.h @@ -7,7 +7,7 @@ obtain one at http://mozilla.org/MPL/2.0/. */ -// the helpers the files of physics/mover/ share: only they include this header +// the helpers the files of physics/components/ share: only they include this header #pragma once diff --git a/physics/mover/pneumatics.cpp b/physics/components/pneumatics.cpp similarity index 99% rename from physics/mover/pneumatics.cpp rename to physics/components/pneumatics.cpp index c4519d5fb..1e4e44f2b 100644 --- a/physics/mover/pneumatics.cpp +++ b/physics/components/pneumatics.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" // Nastawianie hamulców diff --git a/physics/mover/securitysystem.cpp b/physics/components/securitysystem.cpp similarity index 99% rename from physics/mover/securitysystem.cpp rename to physics/components/securitysystem.cpp index bb3726029..3b94ca658 100644 --- a/physics/mover/securitysystem.cpp +++ b/physics/components/securitysystem.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" void TSecuritySystem::set_enabled(bool e) diff --git a/physics/mover/setup.cpp b/physics/components/setup.cpp similarity index 99% rename from physics/mover/setup.cpp rename to physics/components/setup.cpp index 29db46d97..d4a8aae70 100644 --- a/physics/mover/setup.cpp +++ b/physics/components/setup.cpp @@ -27,7 +27,7 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" +#include "physics/components/internal.h" // ************************************************************************************************* diff --git a/physics/mover/traction.cpp b/physics/components/traction.cpp similarity index 99% rename from physics/mover/traction.cpp rename to physics/components/traction.cpp index 05b52bbc3..00b760db6 100644 --- a/physics/mover/traction.cpp +++ b/physics/components/traction.cpp @@ -27,8 +27,8 @@ http://mozilla.org/MPL/2.0/. #include #include #include -#include "physics/mover/internal.h" -#include "physics/mover/drive.h" +#include "physics/components/internal.h" +#include "physics/components/drive.h" double TableInterpolation(std::map &Map, double Parameter) diff --git a/physics/mover.h b/physics/mover.h index 364c6bb2b..b07ee559e 100644 --- a/physics/mover.h +++ b/physics/mover.h @@ -2248,7 +2248,7 @@ class TMoverParameters void FuseOff(void); // wylaczenie nadmiarowego bool UniversalResetButton(int const Button, range_t const Notify = range_t::consist); bool RelayReset(int const Relays, range_t const Notify = range_t::consist); // resets specified relays - // the drive of the kind of engine of the vehicle (physics/mover/drive.h) + // the drive of the kind of engine of the vehicle (physics/components/drive.h) TractionDrive const &Drive() const; double ShowCurrent(int AmpN) const; // pokazuje bezwgl. wartosc pradu na wybranym amperomierzu double ShowCurrentP(int AmpN) const; // pokazuje bezwgl. wartosc pradu w wybranym pojezdzie //Q 20160722