1
0
Fork 0

Added a simple auto-coordination capability.

This commit is contained in:
curt 1999-10-06 20:57:47 +00:00
parent 038b68153e
commit 6de1139450
2 changed files with 16 additions and 1 deletions

View file

@ -2,4 +2,4 @@ noinst_LIBRARIES = libControls.a
libControls_a_SOURCES = controls.cxx controls.hxx
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator

View file

@ -24,6 +24,7 @@
#ifndef _CONTROLS_HXX
#define _CONTROLS_HXX
#include <Main/options.hxx>
#ifndef __cplusplus
# error This library requires C++
@ -78,11 +79,25 @@ public:
aileron = pos;
if ( aileron < -1.0 ) aileron = -1.0;
if ( aileron > 1.0 ) aileron = 1.0;
// check for autocoordination
if ( current_options.get_auto_coordination() ==
fgOPTIONS::FG_AUTO_COORD_ENABLED )
{
set_rudder( aileron / 2.0 );
}
}
inline void move_aileron( double amt ) {
aileron += amt;
if ( aileron < -1.0 ) aileron = -1.0;
if ( aileron > 1.0 ) aileron = 1.0;
// check for autocoordination
if ( current_options.get_auto_coordination() ==
fgOPTIONS::FG_AUTO_COORD_ENABLED )
{
set_rudder( aileron / 2.0 );
}
}
inline void set_elevator( double pos ) {
elevator = pos;