16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 14:49:19 +02:00

selected pantograph control switches, minor bug fixes

This commit is contained in:
tmj-fstate
2017-07-01 12:36:19 +02:00
parent 49aad85597
commit 534a49b636
10 changed files with 209 additions and 86 deletions

View File

@@ -150,16 +150,21 @@ double TGauge::GetValue() const {
return ( fValue - fOffset ) / fScale;
}
void TGauge::Update()
{
void TGauge::Update() {
float dt = Timer::GetDeltaTime();
if( ( fFriction > 0 ) && ( dt < 0.5 * fFriction ) ) {
// McZapkie-281102: zabezpieczenie przed oscylacjami dla dlugich czasow
fValue += dt * ( fDesiredValue - fValue ) / fFriction;
}
else
else {
fValue = fDesiredValue;
if (SubModel)
}
if( std::abs( fDesiredValue - fValue ) <= 0.001 ) {
// close enough, we can stop updating the model
fValue = fDesiredValue; // set it exactly as requested just in case it matters
}
if( SubModel )
{ // warunek na wszelki wypadek, gdyby się submodel nie podłączył
TSubModel *sm;
switch (eType)