]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UFO.cxx
Ima Sudonim:
[flightgear.git] / src / FDM / UFO.cxx
index e2c1366dbd9570443558448addd254c20530473c..f6b26f58d3b146f43dc86a487c155b93f68a8579 100644 (file)
@@ -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
 //
 
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
@@ -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);
@@ -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 );
 }