1
0
Fork 0

don't silently fix bad user input -- complain loudly

This commit is contained in:
mfranz 2006-11-04 11:33:08 +00:00
parent 2145558999
commit 4ae3ab11df

View file

@ -227,15 +227,15 @@ light = {
#
# EXAMPLE:
# var lp = aircraft.lowpass.new(0.5);
# print(lp.filter(10));
# print(lp.filter(10)); # prints 10
# print(lp.filter(0));
#
lowpass = {
new : func(coeff) {
var m = { parents : [lowpass] };
m.dtN = props.globals.getNode("/sim/time/delta-realtime-sec", 1);
m.coeff = coeff >= 0 ? coeff : die("aircraft.lowpass(): coefficient must be >= 0");
m.value = nil;
m.coeff = abs(coeff);
return m;
},
# filter(raw_value) -> push new value, returns filtered value