1
0
Fork 0

Fix low-pass filter and adapt to speed-up factor.

Low-pass filter should not use real-time, but simulation time to filter
effects. Obey speed-up factor.
This commit is contained in:
ThorstenB 2011-09-04 18:51:05 +02:00
parent 91c202e1cf
commit 8421d75cb9

View file

@ -270,7 +270,7 @@ var lowpass = {
me.value = v;
},
_filter_: func(v) {
var dt = getprop("/sim/time/delta-sec");
var dt = getprop("/sim/time/delta-sec")*getprop("/sim/speed-up");
var c = dt / (me.coeff + dt);
me.value = v * c + me.value * (1 - c);
},