]> git.mxchange.org Git - flightgear.git/commitdiff
Added an initial weather section.
authorcurt <curt>
Sat, 19 Jul 1997 23:04:46 +0000 (23:04 +0000)
committercurt <curt>
Sat, 19 Jul 1997 23:04:46 +0000 (23:04 +0000)
Main/GLmain.c
Main/Makefile
Main/depend
Simulator/Makefile
Simulator/constants.h

index aa664d9e0236f6f9cdc61ad5b27068389e6d509c..e146e0c5f9fc90a52148c0488d538153508a870a 100644 (file)
@@ -48,6 +48,7 @@
 #include "../Math/polar.h"
 #include "../Timer/fg_timer.h"
 #include "../Utils/fg_random.h"
+#include "../Weather/weather.h"
 
 
 /* This is a record containing all the info for the aircraft currently
@@ -387,8 +388,8 @@ static void fgMainLoop( void ) {
 
     /* I'm just sticking this here for now, it should probably move 
      * eventually */
-    rough_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0
-                              FG_Latitude  * RAD_TO_DEG * 3600.0);
+    rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC
+                              FG_Latitude  * RAD_TO_ARCSEC);
     printf("Ground elevation is about %.2f meters here.\n", rough_elev);
     /* FG_Runway_altitude = rough_elev * METER_TO_FEET; */
 
@@ -403,9 +404,10 @@ static void fgMainLoop( void ) {
               FG_Altitude * FEET_TO_METER);
     }
 
-    FG_U_gust = fg_random() * 1.0 - 0.5;
-    FG_V_gust = fg_random() * 1.0 - 0.5;
-    FG_W_gust = fg_random() * 1.0 - 0.5;
+    /* update the weather for our current position */
+    fgWeatherUpdate(FG_Longitude * RAD_TO_ARCSEC, 
+                   FG_Latitude * RAD_TO_ARCSEC, 
+                   FG_Altitude * FEET_TO_METER);
 }
 
 
@@ -439,9 +441,6 @@ int main( int argc, char *argv[] ) {
 
     f = &current_aircraft.flight;
 
-    /* might as well do this first thing ... seed the random number generater */
-    fg_srandom();
-
     printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");
 
 
@@ -474,6 +473,9 @@ int main( int argc, char *argv[] ) {
       }
     #endif
 
+    /* seed the random number generater */
+    fg_srandom();
+
     /* setup view parameters, only makes GL calls */
     fgInitVisuals();
 
@@ -530,9 +532,6 @@ int main( int argc, char *argv[] ) {
     FG_Dy_cg = 0.000000E+00;
     FG_Dz_cg = 0.000000E+00;
 
-    /* Configure some wind & turbulance */
-    FG_V_north_airmass = 15; /* ft/s =~ 10mph */
-
     /* Set initial position and slew parameters */
     /* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
     /* fgSlewInit(-335340,162540, 15, 4.38); */
@@ -566,6 +565,9 @@ int main( int argc, char *argv[] ) {
        fgInitTimeDepCalcs();
     }
 
+    /* Initialize the weather modeling subsystem */
+    fgWeatherInit();
+
     /**********************************************************************
      * Initialize the Event Handlers.
      **********************************************************************/
@@ -619,10 +621,13 @@ int printf (const char *format, ...) {
 
 
 /* $Log$
-/* Revision 1.37  1997/07/19 22:34:02  curt
-/* Moved PI definitions to ../constants.h
-/* Moved random() stuff to ../Utils/ and renamed fg_random()
+/* Revision 1.38  1997/07/19 23:04:47  curt
+/* Added an initial weather section.
 /*
+ * Revision 1.37  1997/07/19 22:34:02  curt
+ * Moved PI definitions to ../constants.h
+ * Moved random() stuff to ../Utils/ and renamed fg_random()
+ *
  * Revision 1.36  1997/07/18 23:41:25  curt
  * Tweaks for building with Cygnus Win32 compiler.
  *
index 1073ef29c4747640982101246eec4044e60ecb4f..0760bc87708389b2a5c94e5a82392d0f36a284a0 100644 (file)
@@ -32,7 +32,7 @@ AFILES = ../Aircraft/libAircraft.a ../Controls/libControls.a \
        ../Flight/libFlight.a ../Flight/LaRCsim/libLaRCsim.a \
        ../Flight/Slew/libSlew.a ../Math/libMath.a \
        ../Scenery/libScenery.a \
-       ../Timer/libTimer.a ../Utils/libUtils.a
+       ../Timer/libTimer.a ../Utils/libUtils.a ../Weather/libWeather.a
 
 
 include ../make.inc
@@ -76,6 +76,9 @@ mesh2GL.o:
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.24  1997/07/19 23:04:47  curt
+# Added an initial weather section.
+#
 # Revision 1.23  1997/07/19 22:34:03  curt
 # Moved PI definitions to ../constants.h
 # Moved random() stuff to ../Utils/ and renamed fg_random()
index 7883717406462ac01a2e0478226bbe24b34e64bb..4f8139b3475d098c7aaa15b64e5ca201e58688de 100644 (file)
@@ -18,7 +18,8 @@ GLmain.o: GLmain.c ../constants.h ../Aircraft/aircraft.h \
  ../Aircraft/../Controls/controls.h \
  ../Aircraft/../Controls/../limits.h ../Scenery/mesh.h \
  ../Scenery/scenery.h ../Math/mat3.h ../Math/polar.h \
- ../Math/../types.h ../Timer/fg_timer.h ../Utils/fg_random.h
+ ../Math/../types.h ../Timer/fg_timer.h ../Utils/fg_random.h \
+ ../Weather/weather.h
 mesh2GL.o: mesh2GL.c ../constants.h ../Scenery/mesh.h \
  ../Scenery/scenery.h ../Math/mat3.h ../Math/polar.h \
  ../Math/../types.h ../Utils/fg_random.h
index 93c9f6345b8c432191842860b20acd35ab5162cc..da1ed831ddf1a8ef4336d7e68f913d8d6ad4912f 100644 (file)
@@ -28,7 +28,7 @@ include make.inc
 
 
 SUBSUBDIRS = Flight/LaRCsim Flight/Slew
-SUBDIRS = Aircraft Controls Flight Math Scenery Timer Utils
+SUBDIRS = Aircraft Controls Flight Math Scenery Timer Utils Weather
 MAIN = OpenGL
 
 
@@ -63,6 +63,9 @@ zip: clean
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.19  1997/07/19 23:04:46  curt
+# Added an initial weather section.
+#
 # Revision 1.18  1997/07/19 22:36:28  curt
 # Added Utils/ subdirectory
 #
index 114827a9710561f17ec717daf0ee45cce9a12ab8..f1f8f1c2c39f2ae04ff255d5e233f6ba5d3e751e 100644 (file)
@@ -61,6 +61,9 @@
 /* Arc seconds to radians */                  /* (arcsec*pi)/(3600*180) = rad */
 #define ARCSEC_TO_RAD 4.84813681109535993589e-06 
 
+/* Radians to arc seconds */                  /* (rad*3600*180)/pi = arcsec */
+#define RAD_TO_ARCSEC 2035752.03952618601852
+
 /* Feet to Meters */
 #define FEET_TO_METER    0.3048
 
 
 
 /* $Log$
-/* Revision 1.4  1997/07/19 22:37:03  curt
-/* Added various PI definitions.
+/* Revision 1.5  1997/07/19 23:04:46  curt
+/* Added an initial weather section.
 /*
+ * Revision 1.4  1997/07/19 22:37:03  curt
+ * Added various PI definitions.
+ *
  * Revision 1.3  1997/07/14 16:26:03  curt
  * Testing/playing -- placed objects randomly across the entire terrain.
  *