From c78327ee219c061c218b4f921bc06b3f432d88bf Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 23 Apr 2008 22:01:44 +0000 Subject: [PATCH] - lowpass: work with delta-sec = nil - cosmetics --- Nasal/aircraft.nas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Nasal/aircraft.nas b/Nasal/aircraft.nas index 2c50d0be4..b87422a9a 100644 --- a/Nasal/aircraft.nas +++ b/Nasal/aircraft.nas @@ -328,7 +328,7 @@ var lowpass = { me.value = v; }, _filter_ : func(v) { - var dt = getprop("/sim/time/delta-sec"); + var dt = getprop("/sim/time/delta-sec") or 0; var c = dt / (me.coeff + dt); me.value = v * c + me.value * (1 - c); }, @@ -345,12 +345,12 @@ var angular_lowpass = { var m = { parents : [angular_lowpass] }; m.sin = lowpass.new(coeff); m.cos = lowpass.new(coeff); - m.buf = nil; + m.value = nil; return m; }, filter : func(v) { v *= D2R; - me.buf = math.atan2(me.sin.filter(math.sin(v)), me.cos.filter(math.cos(v))) * R2D; + me.value = math.atan2(me.sin.filter(math.sin(v)), me.cos.filter(math.cos(v))) * R2D; }, set : func(v) { v *= D2R; @@ -358,7 +358,7 @@ var angular_lowpass = { me.cos.set(math.cos(v)); }, get : func { - me.buf; + me.value; }, };