1 // UFO.hxx -- interface to the "UFO" flight model
3 // Written by Curtis Olson, started October 1999.
4 // Slightly modified from MagicCarpet.hxx by Jonathan Polley, April 2002
6 // Copyright (C) 1999-2002 Curtis L. Olson - http://www.flightgear.org/~curt
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 class FGUFO: public FGInterface {
40 lowpass(double coeff) : _coeff(coeff), _initialized(false) {}
41 static inline void set_delta(double dt) { _dt = dt; }
42 double filter(double value) {
47 double c = _dt / (_coeff + _dt);
48 return _last = value * c + _last * (1.0 - c);
56 lowpass *Aileron_Trim;
57 lowpass *Elevator_Trim;
59 SGPropertyNode_ptr Speed_Max;
65 // reset flight params to a specific position
68 // update position based on inputs, positions, velocities, etc.
69 void update( double dt );