17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 00:27:29 +01:00

perf(physics): vehicles standing still and held by their brakes let their physics sleep (physics.sleepheld)

This commit is contained in:
2026-10-23 18:20:49 +02:00
parent e054fe900d
commit a04efbf968
7 changed files with 33 additions and 6 deletions

View File

@@ -479,6 +479,12 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string&
return true;
}
if (token == "physics.sleepheld")
{
ParseOne(Parser, physics_sleepheld);
return true;
}
if (token == "enabletraction")
{
ParseOne(Parser, bEnableTraction);
@@ -1887,6 +1893,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "sound.asyncload", AudioAsyncLoad );
export_as_text( Output, "physicslog", WriteLogFlag );
export_as_text( Output, "fullphysics", FullPhysics );
export_as_text( Output, "physics.sleepheld", physics_sleepheld );
export_as_text( Output, "debuglog", iWriteLogEnabled );
export_as_text( Output, "multiplelogs", MultipleLogs );
export_as_text( Output, "showsystemconsole", ShowSystemConsole );

View File

@@ -114,6 +114,7 @@ struct global_settings {
std::string Weather{ "cloudy:" }; // current weather
std::string Period{}; // time of the day, based on sun position
bool FullPhysics{ true }; // full calculations performed for each simulation step
bool physics_sleepheld{ true }; // vehicles standing still and held by their brakes let their physics sleep, see TMoverParameters::accelerating()
bool bnewAirCouplers{ true };
float fMoveLight{ 0.f }; // numer dnia w roku albo -1
bool FakeLight{ false }; // toggle between fixed and dynamic daylight

View File

@@ -132,7 +132,7 @@ struct subsystem_stopwatches {
unsigned int vehicles { 0 };
unsigned int cab { 0 }; // CabActive
unsigned int speed { 0 }; // Vel above 0.0001 km/h
unsigned int acceleration { 0 }; // AccS above 0.0001 m/s2
unsigned int acceleration { 0 }; // AccS above 0.0001 m/s2, and not held by the brakes (TMoverParameters::accelerating())
unsigned int switching { 0 }; // LastSwitchingTime below 5 s
unsigned int multipleunit { 0 }; // EZT, DMU
unsigned int neighbour { 0 }; // a neighbour moving or accelerating