]> git.mxchange.org Git - flightgear.git/commitdiff
Hacked in some support for wind/turbulence.
authorcurt <curt>
Fri, 18 Jul 1997 14:28:34 +0000 (14:28 +0000)
committercurt <curt>
Fri, 18 Jul 1997 14:28:34 +0000 (14:28 +0000)
Main/GLmain.c
Main/mesh2GL.c
Simulator/make.inc

index fc985e2304db0e560a570a9c62337f369b75dc10..43d22415b769bd6da90fbf84cabedf05034fc25b 100644 (file)
@@ -416,6 +416,17 @@ static void fgMainLoop( void ) {
        printf("<*> resetting altitude to %.0f meters\n", 
               FG_Altitude * FEET_TO_METER);
     }
+
+#ifdef USE_RAND
+    FG_U_gust = rand() * 3.0 / RAND_MAX - 1.0;
+    FG_V_gust = rand() * 3.0 / RAND_MAX - 1.0;
+    FG_W_gust = rand() * 3.0 / RAND_MAX - 1.0;
+#else
+    FG_U_gust = random() * 3.0 / RAND_MAX - 1.0;
+    FG_V_gust = random() * 3.0 / RAND_MAX - 1.0;
+    FG_W_gust = random() * 3.0 / RAND_MAX - 1.0;
+#endif
+
 }
 
 
@@ -537,6 +548,9 @@ 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); */
@@ -615,9 +629,12 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.34  1997/07/16 20:04:48  curt
-/* Minor tweaks to aid Win32 port.
+/* Revision 1.35  1997/07/18 14:28:34  curt
+/* Hacked in some support for wind/turbulence.
 /*
+ * Revision 1.34  1997/07/16 20:04:48  curt
+ * Minor tweaks to aid Win32 port.
+ *
  * Revision 1.33  1997/07/12 03:50:20  curt
  * Added an #include <Windows32/Base.h> to help compiling for Win32
  *
index fd4d91f73adc15afd2e764c0926d47ee95f809f9..8f7c298cc5c47385efbbd5849a0480ce1fcb31f0 100644 (file)
@@ -31,6 +31,7 @@
 #include <GL/glut.h>
 
 #include <stdlib.h>         /* for random(), srandom() */
+#include <time.h>           /* for time() to seed srandom() */
 
 #include "../constants.h"
 #include "../Scenery/mesh.h"
@@ -86,6 +87,7 @@ GLint mesh2GL(struct mesh *m) {
     /* static GLfloat color[4] = { 0.5, 0.4, 0.25, 1.0 }; */ /* dark desert */
     static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
     double randx, randy;
+    int t;
 
     float x1, y1, x2, y2, z11, z12, z21, z22;
     struct fgCartesianPoint p11, p12, p21, p22;
@@ -186,6 +188,12 @@ GLint mesh2GL(struct mesh *m) {
     }
     */
 
+#ifdef USE_RAND
+    srand(time(&t));
+#else
+    srandom(time(&t));
+#endif
+
     for ( i = 0; i < 200; i++ ) {
 #ifdef USE_RAND
        randx = rand() * 3600.0 / RAND_MAX;
@@ -206,9 +214,12 @@ GLint mesh2GL(struct mesh *m) {
 
 
 /* $Log$
-/* Revision 1.34  1997/07/16 20:04:50  curt
-/* Minor tweaks to aid Win32 port.
+/* Revision 1.35  1997/07/18 14:28:35  curt
+/* Hacked in some support for wind/turbulence.
 /*
+ * Revision 1.34  1997/07/16 20:04:50  curt
+ * Minor tweaks to aid Win32 port.
+ *
  * Revision 1.33  1997/07/14 16:26:04  curt
  * Testing/playing -- placed objects randomly across the entire terrain.
  *
index a5695573cda4f0edeee5d2810034e7ab249a1389..cbc2bae1ccf2b592718003f397841bae46c5fbd9 100644 (file)
@@ -61,7 +61,7 @@ RANLIB = ranlib
 #
 #---------------------------------------------------------------------------
 
-FG_CFLAGS = -g -Wall -DUSE_RAND
+FG_CFLAGS = -g -Wall
 
 
 #---------------------------------------------------------------------------
@@ -72,9 +72,9 @@ FG_CFLAGS = -g -Wall -DUSE_RAND
 #---------------------------------------------------------------------------
 
 #---------------------------------------------------------------------------
-# SGI IRIX with the GLUT toolkit (surprisingly, this also works on our 
-#                                 SunOS 4.x machine with the way we have
-#                                 Mesa & Glut installed.)
+# SGI IRIX with the GLUT toolkit 
+#     (Surprisingly, this also works on our SunOS 4.x machine with the 
+#     way we have Mesa & Glut installed.)
 #
 # INTERFACE_FLAGS = -DGLUT
 # INTERFACE_LIBS = -lglut
@@ -85,26 +85,29 @@ FG_CFLAGS = -g -Wall -DUSE_RAND
 #---------------------------------------------------------------------------
 # Linux/Mesa with the GLUT toolkit
 #
-INTERFACE_FLAGS = -DGLUT
-INTERFACE_LIBS = -lglut
-INTERFACE_FILES = GLUTkey.c
-MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
-X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
-GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+INTERFACE_FLAGS = -DGLUT
+INTERFACE_LIBS = -lglut
+INTERFACE_FILES = GLUTkey.c
+MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
 #---------------------------------------------------------------------------
 
 #---------------------------------------------------------------------------
 # Cygnus Win32 (gcc based) with the GLUT toolkit
 #
-INTERFACE_FLAGS = -DGLUT 
-INTERFACE_LIBS = -Wl,--subsystem,windows -L. -lglut
-INTERFACE_FILES = GLUTkey.c
-GRAPHICS_LIBS = -lglu32 -lopengl32
+INTERFACE_FLAGS = -DGLUT 
+INTERFACE_LIBS = -Wl,--subsystem,windows -L. -lglut
+INTERFACE_FILES = GLUTkey.c
+GRAPHICS_LIBS = -lglu32 -lopengl32
 #---------------------------------------------------------------------------
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.7  1997/07/18 14:28:34  curt
+# Hacked in some support for wind/turbulence.
+#
 # Revision 1.6  1997/07/16 20:04:42  curt
 # Minor tweaks to aid Win32 port.
 #