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

feat(cab): 401Da oil pump lamp and slotted speedometer lever (eu07/maszyna#546) (#261)

* feat: 401da oil pump lamp and slotted lever animation (eu07/maszyna#546)

i-oilpump lights while the pre-lubrication oil pump works, so it goes
off once the engine runs. animslottedlever: in the .mmd turns a lever
by a pin on the coupling rod sliding in the lever's slot, which the
speedometer drive of 401Da needs.

The compressor start delay of #546 came with CompressorStartDelay
(Brake section) of master.

* fix: force GLM AVX2 only when the compiler targets AVX2

ENABLE_AVX2=OFF left GLM_FORCE_AVX2 defined, so MSVC still emitted
AVX2 intrinsics and the exe crashed on CPUs without AVX2.

* test: cover the compressor start delay and the oil pump lamp

The delay of an engine stopped before it passed starts over, a
compressor switched on by hand waits too, and the key is read from the
Brake section. In the converter-fed set-up of 401Da the compressor
waits for ConverterStartDelay and then its own delay. The oil pump
(i-oilpump lamp) works before the engine start and stops once the
engine runs.
This commit is contained in:
jerrrrycho
2026-11-08 14:48:42 +01:00
committed by GitHub
parent 5f46aca43a
commit 22c588d8f9
7 changed files with 218 additions and 1 deletions

View File

@@ -316,6 +316,16 @@ private:
TSubModel *sm_summer_variant {}; // submodel letniego wariantu
TSubModel *sm_autumn_variant {}; // submodel jesiennego wariantu
double fWahaczeAmp;
// levers with a slot, turned by a pin on the coupling rod sliding in the slot (e.g. speedometer drive of 401Da)
struct slottedlever_data {
TSubModel *submodel { nullptr }; // lever, turned around its local X axis like the wheels
int axle { 0 }; // index of the axle animation, whose crank drives the coupling rod
glm::dvec2 pin { 0.0 }; // pin position relative to the lever axis for wheel angle 0, in local (Y, Z) plane [m]
glm::dvec2 crank { 0.0 }; // crank vector for wheel angle 0, in local (Y, Z) plane [m]
};
std::vector<slottedlever_data> m_slottedlevers;
static double slottedlever_angle( slottedlever_data const &Lever, double const Wheelangle );
void update_slottedlevers();
// Winger 160204 - pantografy
double pantspeedfactor;
// animacje typu przesuw