X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FBalloon.cxx;h=1bf6d99131a54e46f818b157a0cc1682634988d8;hb=1e3f0f0050cd4860b8bf2b6ecb59ba040f8b934f;hp=6790df396ce5fc2042f118fecacc350a024dab60;hpb=37c2b6002ceef5019ec730935c4235b1c019f018;p=flightgear.git diff --git a/src/FDM/Balloon.cxx b/src/FDM/Balloon.cxx index 6790df396..1bf6d9913 100644 --- a/src/FDM/Balloon.cxx +++ b/src/FDM/Balloon.cxx @@ -37,6 +37,10 @@ HISTORY /* INCLUDES */ /****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #ifdef SG_MATH_EXCEPTION_CLASH @@ -51,7 +55,6 @@ HISTORY #include #include -#include #include
#include
@@ -103,9 +106,9 @@ void FGBalloonSim::init() { //set velocities sgSetVec3( temp, - fgGetDouble("/velocities/uBody-fps"), - fgGetDouble("/velocities/vBody-fps"), - fgGetDouble("/velocities/wBody-fps") ); + fgGetDouble("/sim/presets/uBody-fps"), + fgGetDouble("/sim/presets/vBody-fps"), + fgGetDouble("/sim/presets/wBody-fps") ); current_balloon.setVelocity( temp ); SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing BalloonSim" ); @@ -113,9 +116,14 @@ void FGBalloonSim::init() { // Run an iteration of the EOM (equations of motion) -bool FGBalloonSim::update( int multiloop ) { +void FGBalloonSim::update( double dt ) { double save_alt = 0.0; + if (is_suspended()) + return; + + int multiloop = _calc_multiloop(dt); + // lets try to avoid really screwing up the BalloonSim model if ( get_Altitude() < -9000 ) { save_alt = get_Altitude(); @@ -162,8 +170,6 @@ bool FGBalloonSim::update( int multiloop ) { if ( save_alt < -9000.0 ) { set_Altitude( save_alt ); } - - return true; }