X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FUFO.cxx;h=60727faf3034b57620b11418bd45e309f6962cf6;hb=1e3f0f0050cd4860b8bf2b6ecb59ba040f8b934f;hp=ade1aa858d7a64ea26641d9e6f3bc13fa3484cba;hpb=7ac15db1688c03f3e7b924d9d9256925e233acc7;p=flightgear.git diff --git a/src/FDM/UFO.cxx b/src/FDM/UFO.cxx index ade1aa858..60727faf3 100644 --- a/src/FDM/UFO.cxx +++ b/src/FDM/UFO.cxx @@ -3,7 +3,7 @@ // Written by Curtis Olson, started October 1999. // Slightly modified from MagicCarpet.cxx by Jonathan Polley, April 2002 // -// Copyright (C) 1999-2002 Curtis L. Olson - curt@flightgear.org +// Copyright (C) 1999-2002 Curtis L. Olson - http://www.flightgear.org/~curt // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -21,11 +21,15 @@ // +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include -#include +#include #include
#include
@@ -68,7 +72,9 @@ void FGUFO::update( double dt ) { // read the throttle double th = globals->get_controls()->get_throttle( 0 ); - if (globals->get_controls()->get_brake(0)) { + if ( globals->get_controls()->get_brake_left() > 0.0 + || globals->get_controls()->get_brake_right() > 0.0 ) + { th = -th; } Throttle = th * throttle_damp + Throttle * (1 - throttle_damp); @@ -158,7 +164,7 @@ void FGUFO::update( double dt ) { // angle of turn double turn_rate = sin(roll) * SGD_PI_4; // radians/sec double turn = turn_rate * time_step; - double yaw = fabs(Rudder) < .2 ? 0.0 : Rudder / (10 + fabs(speed) * .1); + double yaw = fabs(Rudder) < .2 ? 0.0 : Rudder / (25 + fabs(speed) * .1); // update (lon/lat) position double lat2, lon2, az2; @@ -189,6 +195,7 @@ void FGUFO::update( double dt ) { sl_radius + get_Altitude() + climb ); // cout << "sea level radius (ft) = " << sl_radius << endl; // cout << "(setto) sea level radius (ft) = " << get_Sea_level_radius() << endl; + _update_ground_elev_at_pos(); _set_Sea_level_radius( sl_radius * SG_METER_TO_FEET); _set_Altitude( get_Altitude() + climb ); }