diff --git a/src/Aircraft/controls.cxx b/src/Aircraft/controls.cxx index dcd4a553b..772ab8e74 100644 --- a/src/Aircraft/controls.cxx +++ b/src/Aircraft/controls.cxx @@ -215,7 +215,12 @@ FGControls::init () alternate_extension[wheel] = false; } - auto_coordination = fgGetNode("/sim/auto-coordination", true); + auto_coordination = fgGetNode("/controls/flight/auto-coordination", true); + auto_coordination_factor = fgGetNode("/controls/flight/auto-coordination-factor", false ); + if( NULL == auto_coordination_factor ) { + auto_coordination_factor = fgGetNode("/controls/flight/auto-coordination-factor", true ); + auto_coordination_factor->setDoubleValue( 0.5 ); + } } static inline void _SetRoot( simgear::TiedPropertyList & tiedProperties, const char * root, int index = 0 ) @@ -656,11 +661,7 @@ FGControls::set_aileron (double pos) { aileron = pos; SG_CLAMP_RANGE( aileron, -1.0, 1.0 ); - - // check for autocoordination - if ( auto_coordination->getBoolValue() ) { - set_rudder( aileron / 2.0 ); - } + do_autocoordination(); } void @@ -668,11 +669,7 @@ FGControls::move_aileron (double amt) { aileron += amt; SG_CLAMP_RANGE( aileron, -1.0, 1.0 ); - - // check for autocoordination - if ( auto_coordination->getBoolValue() ) { - set_rudder( aileron / 2.0 ); - } + do_autocoordination(); } void diff --git a/src/Aircraft/controls.hxx b/src/Aircraft/controls.hxx index a738bc27f..cc8ce5a71 100644 --- a/src/Aircraft/controls.hxx +++ b/src/Aircraft/controls.hxx @@ -253,6 +253,7 @@ private: SGPropertyNode_ptr auto_coordination; + SGPropertyNode_ptr auto_coordination_factor; simgear::TiedPropertyList _tiedProperties; public: @@ -637,6 +638,14 @@ public: // controls/autoflight/autopilot[n]/ void set_autopilot_engage( int ap, bool val ); +private: + inline void do_autocoordination() { + // check for autocoordination + if ( auto_coordination->getBoolValue() ) { + double factor = auto_coordination_factor->getDoubleValue(); + if( factor > 0.0 ) set_rudder( aileron * factor ); + } + } }; diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 2d18b736a..8d40329fb 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -176,7 +176,7 @@ fgSetDefaults () // specified so we can do the right thing for voodoo-1/2 cards. // fgSetString("/sim/startup/mouse-pointer", "disabled"); fgSetString("/sim/control-mode", "joystick"); - fgSetBool("/sim/auto-coordination", false); + fgSetBool("/controls/flight/auto-coordination", false); #if defined(WIN32) fgSetString("/sim/startup/browser-app", "webrun.bat"); #elif defined(__APPLE__) @@ -1359,8 +1359,8 @@ struct OptionDesc { {"disable-anti-alias-hud", false, OPTION_BOOL, "/sim/hud/color/antialiased", false, "", 0 }, {"enable-anti-alias-hud", false, OPTION_BOOL, "/sim/hud/color/antialiased", true, "", 0 }, {"control", true, OPTION_STRING, "/sim/control-mode", false, "", 0 }, - {"disable-auto-coordination", false, OPTION_BOOL, "/sim/auto-coordination", false, "", 0 }, - {"enable-auto-coordination", false, OPTION_BOOL, "/sim/auto-coordination", true, "", 0 }, + {"disable-auto-coordination", false, OPTION_BOOL, "/controls/flight/auto-coordination", false, "", 0 }, + {"enable-auto-coordination", false, OPTION_BOOL, "/controls/flight/auto-coordination", true, "", 0 }, {"browser-app", true, OPTION_STRING, "/sim/startup/browser-app", false, "", 0 }, {"disable-hud", false, OPTION_BOOL, "/sim/hud/visibility[1]", false, "", 0 }, {"enable-hud", false, OPTION_BOOL, "/sim/hud/visibility[1]", true, "", 0 },