Make the indicator a little less jumpy.
This commit is contained in:
parent
95e3e9d28b
commit
7470eadbe7
1 changed files with 6 additions and 3 deletions
|
@ -8,6 +8,11 @@
|
||||||
#include <Main/util.hxx>
|
#include <Main/util.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
// Use a bigger number to be more responsive, or a smaller number
|
||||||
|
// to be more sluggish (the base time is 1.0).
|
||||||
|
#define RESPONSIVENESS 0.25
|
||||||
|
|
||||||
|
|
||||||
TurnIndicator::TurnIndicator ()
|
TurnIndicator::TurnIndicator ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -64,9 +69,7 @@ TurnIndicator::update (double dt)
|
||||||
|
|
||||||
// Lag left, based on gyro spin
|
// Lag left, based on gyro spin
|
||||||
rate = -2.5 + (factor * (rate + 2.5));
|
rate = -2.5 + (factor * (rate + 2.5));
|
||||||
|
rate = fgGetLowPass(_last_rate, rate, dt*RESPONSIVENESS);
|
||||||
// Add a lag, based on gyro spin
|
|
||||||
rate = fgGetLowPass(_last_rate, rate, dt/factor);
|
|
||||||
_last_rate = rate;
|
_last_rate = rate;
|
||||||
|
|
||||||
// Publish the indicated rate
|
// Publish the indicated rate
|
||||||
|
|
Loading…
Reference in a new issue