]> git.mxchange.org Git - flightgear.git/commitdiff
Add Lee Elliott's per aircraft configurable terrain following factor
authorehofman <ehofman>
Sun, 29 Jun 2003 08:27:45 +0000 (08:27 +0000)
committerehofman <ehofman>
Sun, 29 Jun 2003 08:27:45 +0000 (08:27 +0000)
src/Autopilot/newauto.cxx
src/Autopilot/newauto.hxx

index 6762c0a30d8e5ef987cedd0d4be4f193d4211e07..8258136e9fcbe00bd4ac9f774bbd3381b06bb416 100644 (file)
@@ -241,6 +241,7 @@ void FGAutopilot::init ()
     max_roll_node = fgGetNode("/autopilot/config/max-roll-deg", true);
     roll_out_node = fgGetNode("/autopilot/config/roll-out-deg", true);
     roll_out_smooth_node = fgGetNode("/autopilot/config/roll-out-smooth-deg", true);
+    terrain_follow_factor = fgGetNode("/autopilot/config/terrain-follow-factor", true);
 
     current_throttle = fgGetNode("/controls/engines/engine/throttle");
 
@@ -269,6 +270,8 @@ void FGAutopilot::init ()
         fgSetFloat( "/autopilot/config/roll-out-deg", 20 );
     if ( roll_out_smooth_node->getFloatValue() < 0.0000001 )
         fgSetFloat( "/autopilot/config/roll-out-smooth-deg", 10 );
+    if (terrain_follow_factor->getFloatValue() < 1)
+        fgSetFloat( "/autopilot/config/terrain-follow-factor", 16 );
 
     /* set defaults */
     heading_hold = false ;      // turn the heading hold off
@@ -734,7 +737,8 @@ FGAutopilot::update (double dt)
            // brain dead ground hugging with no look ahead
            climb_rate =
                ( TargetAGL - altitude_agl_node->getDoubleValue()
-                  * SG_FEET_TO_METER ) * 16.0;
+                  * SG_FEET_TO_METER )
+                  * terrain_follow_factor->getFloatValue();
        } else {
            // just try to zero out rate of climb ...
            climb_rate = 0.0;
index de1d39bbbe3e22e3ce9491b3e8a13cb10ec99818..9a3fd557d1606f0397eaa49d5c2c0e0999219eed 100644 (file)
@@ -143,6 +143,8 @@ private:
     SGPropertyNode *TargetClimbRate;    // target climb rate
     SGPropertyNode *TargetDescentRate;  // target decent rate
     SGPropertyNode *current_throttle; // current throttle (engine 0)
+    SGPropertyNode *terrain_follow_factor; // modifies the climb rate to
+                        // permit more control when using terrain following mode
 
 public: