diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index 6762c0a30..8258136e9 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -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; diff --git a/src/Autopilot/newauto.hxx b/src/Autopilot/newauto.hxx index de1d39bbb..9a3fd557d 100644 --- a/src/Autopilot/newauto.hxx +++ b/src/Autopilot/newauto.hxx @@ -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: