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:
13
Gauge.cpp
13
Gauge.cpp
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user