18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 00:24:57 +01:00

feat(physics): physical coupler model for the player's train and those it closes in on, plastic hit on solid buffers

This commit is contained in:
2026-11-11 03:15:58 +01:00
parent aba8687678
commit 226155d430
10 changed files with 271 additions and 11 deletions

View File

@@ -821,7 +821,11 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
if (token == "couplerphysics")
{
ParseOne(Parser, coupler_physics, 1);
// yes: the player's train and the trains it closes in on, all: every train
std::string scope;
ParseOne(Parser, scope, 1);
coupler_physics_all = scope == "all";
coupler_physics = coupler_physics_all || scope == "yes" || scope == "true" || scope == "1";
return true;
}
@@ -1713,7 +1717,11 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "scenario.weather.temperature", AirTemperature );
export_as_text( Output, "ai.trainman", AITrainman );
export_as_text( Output, "controlcoupling.enginecheck", control_coupling_engine_check );
export_as_text( Output, "couplerphysics", coupler_physics );
std::string couplerphysics { coupler_physics ? "yes" : "no" };
if( coupler_physics_all ) {
couplerphysics = "all";
}
export_as_text( Output, "couplerphysics", couplerphysics );
export_as_text( Output, "scalespeculars", ScaleSpecularValues );
export_as_text( Output, "gfxrenderer", GfxRenderer );
export_as_text( Output, "shadows", RenderShadows );

View File

@@ -276,8 +276,11 @@ struct global_settings {
bool render_cab = true;
bool crash_damage = true;
// the physical model of the couplings (McZapkie/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
// 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;
bool control_coupling_engine_check = true; // no multiple-unit control between electric and diesel traction vehicles (eu07/maszyna#520)
bool gui_defaultwindows = true;
bool gui_showtranscripts = true;