X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FBalloon.cxx;h=dd5bc016d8f8580432532adc857e9bcbb6daa138;hb=938d006188e70e891bc04e91610c7b8caaca87b6;hp=92b6dc039b043272c211d378627b130759393774;hpb=65f6e343ab83b6c48ee8a74dbf3261715543b3dd;p=flightgear.git diff --git a/src/FDM/Balloon.cxx b/src/FDM/Balloon.cxx index 92b6dc039..dd5bc016d 100644 --- a/src/FDM/Balloon.cxx +++ b/src/FDM/Balloon.cxx @@ -75,9 +75,11 @@ FGBalloonSim::~FGBalloonSim() { // Initialize the BalloonSim flight model, dt is the time increment for // each subsequent iteration through the EOM void FGBalloonSim::init() { - // explicitly call the superclass's - // init method first. - FGInterface::init(); + + //do init common to all the FDM's + common_init(); + + //now do init specific to the Balloon sgVec3 temp; @@ -101,9 +103,9 @@ void FGBalloonSim::init() { //set velocities sgSetVec3( temp, - fgGetDouble("/velocities/uBody"), - fgGetDouble("/velocities/vBody"), - fgGetDouble("/velocities/wBody") ); + fgGetDouble("/velocities/uBody-fps"), + fgGetDouble("/velocities/vBody-fps"), + fgGetDouble("/velocities/wBody-fps") ); current_balloon.setVelocity( temp ); SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing BalloonSim" ); @@ -111,7 +113,7 @@ void FGBalloonSim::init() { // Run an iteration of the EOM (equations of motion) -bool FGBalloonSim::update( int multiloop ) { +void FGBalloonSim::update( int multiloop ) { double save_alt = 0.0; // lets try to avoid really screwing up the BalloonSim model @@ -121,7 +123,7 @@ bool FGBalloonSim::update( int multiloop ) { } // set control positions - current_balloon.set_burner_strength ( controls.get_throttle(0) ); + current_balloon.set_burner_strength ( globals->get_controls()->get_throttle(0) ); //not more implemented yet // Inform BalloonSim of the local terrain altitude @@ -160,8 +162,6 @@ bool FGBalloonSim::update( int multiloop ) { if ( save_alt < -9000.0 ) { set_Altitude( save_alt ); } - - return true; } @@ -190,7 +190,7 @@ bool FGBalloonSim::copy_from_BalloonSim() { //temp[1]: longitude //temp[2]: altitude (meters) - _updatePosition( temp[0], temp[1], temp[2] * SG_METER_TO_FEET ); + _updateGeocentricPosition( temp[0], temp[1], temp[2] * SG_METER_TO_FEET ); current_balloon.getHPR( temp ); set_Euler_Angles( temp[0], temp[1], temp[2] );