mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 11:19:19 +02:00
refactored mouse input processor, tweaks to mouse input support, fix for diesel engine compressor, added progress bar label
This commit is contained in:
24
Gauge.cpp
24
Gauge.cpp
@@ -152,17 +152,19 @@ double TGauge::GetValue() const {
|
||||
|
||||
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 {
|
||||
fValue = fDesiredValue;
|
||||
}
|
||||
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( fValue != fDesiredValue ) {
|
||||
float dt = Timer::GetDeltaTime();
|
||||
if( ( fFriction > 0 ) && ( dt < 0.5 * fFriction ) ) {
|
||||
// McZapkie-281102: zabezpieczenie przed oscylacjami dla dlugich czasow
|
||||
fValue += dt * ( fDesiredValue - fValue ) / fFriction;
|
||||
if( std::abs( fDesiredValue - fValue ) <= 0.0001 ) {
|
||||
// close enough, we can stop updating the model
|
||||
fValue = fDesiredValue; // set it exactly as requested just in case it matters
|
||||
}
|
||||
}
|
||||
else {
|
||||
fValue = fDesiredValue;
|
||||
}
|
||||
}
|
||||
if( SubModel )
|
||||
{ // warunek na wszelki wypadek, gdyby się submodel nie podłączył
|
||||
|
||||
Reference in New Issue
Block a user