Hacked in some support for wind/turbulence.
This commit is contained in:
parent
68681f730f
commit
ff2636c4f8
3 changed files with 49 additions and 18 deletions
|
@ -416,6 +416,17 @@ static void fgMainLoop( void ) {
|
||||||
printf("<*> resetting altitude to %.0f meters\n",
|
printf("<*> resetting altitude to %.0f meters\n",
|
||||||
FG_Altitude * FEET_TO_METER);
|
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_Dy_cg = 0.000000E+00;
|
||||||
FG_Dz_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 */
|
/* Set initial position and slew parameters */
|
||||||
/* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
|
/* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
|
||||||
/* fgSlewInit(-335340,162540, 15, 4.38); */
|
/* fgSlewInit(-335340,162540, 15, 4.38); */
|
||||||
|
@ -615,9 +629,12 @@ int main( int argc, char *argv[] ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.34 1997/07/16 20:04:48 curt
|
/* Revision 1.35 1997/07/18 14:28:34 curt
|
||||||
/* Minor tweaks to aid Win32 port.
|
/* 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
|
* Revision 1.33 1997/07/12 03:50:20 curt
|
||||||
* Added an #include <Windows32/Base.h> to help compiling for Win32
|
* Added an #include <Windows32/Base.h> to help compiling for Win32
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
#include <stdlib.h> /* for random(), srandom() */
|
#include <stdlib.h> /* for random(), srandom() */
|
||||||
|
#include <time.h> /* for time() to seed srandom() */
|
||||||
|
|
||||||
#include "../constants.h"
|
#include "../constants.h"
|
||||||
#include "../Scenery/mesh.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.4, 0.25, 1.0 }; */ /* dark desert */
|
||||||
static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
|
static GLfloat color[4] = { 0.5, 0.5, 0.25, 1.0 };
|
||||||
double randx, randy;
|
double randx, randy;
|
||||||
|
int t;
|
||||||
|
|
||||||
float x1, y1, x2, y2, z11, z12, z21, z22;
|
float x1, y1, x2, y2, z11, z12, z21, z22;
|
||||||
struct fgCartesianPoint p11, p12, p21, p22;
|
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++ ) {
|
for ( i = 0; i < 200; i++ ) {
|
||||||
#ifdef USE_RAND
|
#ifdef USE_RAND
|
||||||
randx = rand() * 3600.0 / RAND_MAX;
|
randx = rand() * 3600.0 / RAND_MAX;
|
||||||
|
@ -206,9 +214,12 @@ GLint mesh2GL(struct mesh *m) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.34 1997/07/16 20:04:50 curt
|
/* Revision 1.35 1997/07/18 14:28:35 curt
|
||||||
/* Minor tweaks to aid Win32 port.
|
/* 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
|
* Revision 1.33 1997/07/14 16:26:04 curt
|
||||||
* Testing/playing -- placed objects randomly across the entire terrain.
|
* Testing/playing -- placed objects randomly across the entire terrain.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
# SGI IRIX with the GLUT toolkit
|
||||||
# SunOS 4.x machine with the way we have
|
# (Surprisingly, this also works on our SunOS 4.x machine with the
|
||||||
# Mesa & Glut installed.)
|
# way we have Mesa & Glut installed.)
|
||||||
#
|
#
|
||||||
# INTERFACE_FLAGS = -DGLUT
|
# INTERFACE_FLAGS = -DGLUT
|
||||||
# INTERFACE_LIBS = -lglut
|
# INTERFACE_LIBS = -lglut
|
||||||
|
@ -85,26 +85,29 @@ FG_CFLAGS = -g -Wall -DUSE_RAND
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Linux/Mesa with the GLUT toolkit
|
# Linux/Mesa with the GLUT toolkit
|
||||||
#
|
#
|
||||||
# INTERFACE_FLAGS = -DGLUT
|
INTERFACE_FLAGS = -DGLUT
|
||||||
# INTERFACE_LIBS = -lglut
|
INTERFACE_LIBS = -lglut
|
||||||
# INTERFACE_FILES = GLUTkey.c
|
INTERFACE_FILES = GLUTkey.c
|
||||||
# MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
|
MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
|
||||||
# X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
|
X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
|
||||||
# GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
|
GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Cygnus Win32 (gcc based) with the GLUT toolkit
|
# Cygnus Win32 (gcc based) with the GLUT toolkit
|
||||||
#
|
#
|
||||||
INTERFACE_FLAGS = -DGLUT
|
# INTERFACE_FLAGS = -DGLUT
|
||||||
INTERFACE_LIBS = -Wl,--subsystem,windows -L. -lglut
|
# INTERFACE_LIBS = -Wl,--subsystem,windows -L. -lglut
|
||||||
INTERFACE_FILES = GLUTkey.c
|
# INTERFACE_FILES = GLUTkey.c
|
||||||
GRAPHICS_LIBS = -lglu32 -lopengl32
|
# GRAPHICS_LIBS = -lglu32 -lopengl32
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $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
|
# Revision 1.6 1997/07/16 20:04:42 curt
|
||||||
# Minor tweaks to aid Win32 port.
|
# Minor tweaks to aid Win32 port.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue