X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fbfi.cxx;h=6e7761d638f8a3157af03dd4aa44cf61598b67d6;hb=8a7e5eeaf2d7bc923437c7d0dee74f99ab3d8a8d;hp=96a34c7b96e670528db958ea7451b5955b65ec74;hpb=66650e4148a2fcd98a3f004613266fd499a3ee13;p=flightgear.git diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index 96a34c7b9..6e7761d63 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -315,14 +315,15 @@ FGBFI::init () // Weather fgTie("/environment/visibility", getVisibility, setVisibility); - fgTie("/environment/wind-north", getWindNorth); - fgTie("/environment/wind-east", getWindEast); - fgTie("/environment/wind-down", getWindDown); + fgTie("/environment/wind-north", getWindNorth, setWindNorth); + fgTie("/environment/wind-east", getWindEast, setWindEast); + fgTie("/environment/wind-down", getWindDown, setWindDown); // View fgTie("/sim/view/axes/long", (double(*)())0, setViewAxisLong); fgTie("/sim/view/axes/lat", (double(*)())0, setViewAxisLat); + _altitude_countdown = 0; _needReinit = false; FG_LOG(FG_GENERAL, FG_INFO, "Ending BFI init"); @@ -1721,7 +1722,7 @@ FGBFI::setGPSTargetLongitude (double longitude) /** - * Get the current visible (units??). + * Get the current visibility (meters). */ double FGBFI::getVisibility () @@ -1735,7 +1736,7 @@ FGBFI::getVisibility () /** - * Set the current visibility (units??). + * Set the current visibility (meters). */ void FGBFI::setVisibility (double visibility) @@ -1749,7 +1750,7 @@ FGBFI::setVisibility (double visibility) /** - * Get the current wind north velocity. + * Get the current wind north velocity (feet/second). */ double FGBFI::getWindNorth () @@ -1759,7 +1760,19 @@ FGBFI::getWindNorth () /** - * Get the current wind east velocity. + * Set the current wind north velocity (feet/second). + */ +void +FGBFI::setWindNorth (double speed) +{ + current_aircraft.fdm_state->set_Velocities_Local_Airmass(speed, + getWindEast(), + getWindDown()); +} + + +/** + * Get the current wind east velocity (feet/second). */ double FGBFI::getWindEast () @@ -1769,7 +1782,20 @@ FGBFI::getWindEast () /** - * Get the current wind down velocity. + * Set the current wind east velocity (feet/second). + */ +void +FGBFI::setWindEast (double speed) +{ + cout << "Set wind-east to " << speed << endl; + current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(), + speed, + getWindDown()); +} + + +/** + * Get the current wind down velocity (feet/second). */ double FGBFI::getWindDown () @@ -1778,6 +1804,18 @@ FGBFI::getWindDown () } +/** + * Set the current wind down velocity (feet/second). + */ +void +FGBFI::setWindDown (double speed) +{ + current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(), + getWindEast(), + speed); +} + + //////////////////////////////////////////////////////////////////////// // View.