]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/bfi.cxx
Minor tweaks.
[flightgear.git] / src / Main / bfi.cxx
index 96a34c7b96e670528db958ea7451b5955b65ec74..6e7761d638f8a3157af03dd4aa44cf61598b67d6 100644 (file)
@@ -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);
+}
+
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // View.