diff --git a/src/FDM/UFO.cxx b/src/FDM/UFO.cxx index c08d3ca34..c0f66b20f 100644 --- a/src/FDM/UFO.cxx +++ b/src/FDM/UFO.cxx @@ -46,7 +46,8 @@ FGUFO::FGUFO( double dt ) Aileron(0.0), Elevator(0.0), Elevator_Trim(0.0), - Rudder(0.0) + Rudder(0.0), + Speed_Max(fgGetNode("/engines/engine/speed-max-mps", true)) { // set_delta_t( dt ); } @@ -60,6 +61,8 @@ FGUFO::~FGUFO() { // for each subsequent iteration through the EOM void FGUFO::init() { common_init(); + if (Speed_Max->getDoubleValue() < 0.01) + Speed_Max->setDoubleValue(2000.0); } @@ -93,7 +96,7 @@ void FGUFO::update( double dt ) { + Rudder * (1 - rudder_damp); // the velocity of the aircraft - double velocity = Throttle * 2000; // meters/sec + double velocity = Throttle * Speed_Max->getDoubleValue(); // meters/sec double old_pitch = get_Theta(); double pitch_rate = SGD_PI_4; // assume I will be pitching up diff --git a/src/FDM/UFO.hxx b/src/FDM/UFO.hxx index 092b1e493..0a16d455d 100644 --- a/src/FDM/UFO.hxx +++ b/src/FDM/UFO.hxx @@ -34,6 +34,8 @@ class FGUFO: public FGInterface { double Elevator; double Elevator_Trim; double Rudder; + SGPropertyNode *Speed_Max; + public: FGUFO( double dt ); ~FGUFO();