1 /**************************************************************************
2 * GLUTmain.c -- top level sim routines
4 * Written by Curtis Olson for OpenGL, started May 1997.
6 * Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * (Log is kept at end of this file)
24 **************************************************************************/
35 #include <Main/GLUTkey.h>
36 #include <Main/fg_init.h>
37 #include <Main/fg_debug.h>
38 #include <Main/views.h>
40 #include <Include/fg_constants.h>
41 #include <Include/general.h>
43 #include <Aircraft/aircraft.h>
44 #include <Astro/moon.h>
45 #include <Astro/sky.h>
46 #include <Astro/stars.h>
47 #include <Astro/sun.h>
48 #include <Cockpit/cockpit.h>
49 #include <Joystick/joystick.h>
50 #include <Math/fg_geodesy.h>
51 #include <Math/mat3.h>
52 #include <Math/polar.h>
53 #include <Scenery/mesh.h>
54 #include <Scenery/scenery.h>
55 #include <Scenery/tilemgr.h>
56 #include <Time/event.h>
57 #include <Time/fg_time.h>
58 #include <Time/fg_timer.h>
59 #include <Time/sunpos.h>
60 #include <Weather/weather.h>
63 /* This is a record containing global housekeeping information */
64 struct fgGENERAL general;
67 static GLfloat win_ratio = 1.0;
68 static GLint winWidth, winHeight;
71 /* pointer to scenery structure */
72 /* static GLint scenery, runway; */
79 /* Yet another hack. This one used by the HUD code. Michele */
82 /* Yet another other hack. Used for my prototype instrument code. (Durk) */
83 int displayInstruments;
86 /**************************************************************************
87 * fgInitVisuals() -- Initialize various GL/view parameters
88 **************************************************************************/
90 static void fgInitVisuals( void ) {
95 l = &cur_light_params;
100 /* xglDisable( GL_DITHER ); */
102 /* If enabled, normal vectors specified with glNormal are scaled
103 to unit length after transformation. See glNormal. */
104 xglEnable( GL_NORMALIZE );
106 xglEnable( GL_LIGHTING );
107 xglEnable( GL_LIGHT0 );
108 xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
110 xglFogi (GL_FOG_MODE, GL_LINEAR);
111 /* xglFogf (GL_FOG_START, 1.0); */
112 xglFogf (GL_FOG_END, w->visibility);
113 /* xglFogf (GL_FOG_DENSITY, w->visibility); */
114 xglHint (GL_FOG_HINT, GL_NICEST /* GL_FASTEST */ );
116 /* draw wire frame */
117 /* xglPolygonMode(GL_FRONT_AND_BACK,GL_LINE); */
121 /**************************************************************************
122 * Update the view volume, position, and orientation
123 **************************************************************************/
125 static void fgUpdateViewParams( void ) {
131 f = ¤t_aircraft.flight;
132 l = &cur_light_params;
133 t = &cur_time_params;
136 fgViewUpdate(f, v, l);
138 if (displayInstruments)
140 xglViewport(0, (GLint)(winHeight / 2 ) , (GLint)winWidth, (GLint)winHeight / 2);
141 /* Tell GL we are about to modify the projection parameters */
142 xglMatrixMode(GL_PROJECTION);
144 gluPerspective(55.0, 2.0/win_ratio, 1.0, 100000.0);
148 xglViewport(0, 0 , (GLint)winWidth, (GLint) winHeight);
149 /* Tell GL we are about to modify the projection parameters */
150 xglMatrixMode(GL_PROJECTION);
152 gluPerspective(55.0, 1.0/win_ratio, 1.0, 100000.0);
155 xglMatrixMode(GL_MODELVIEW);
158 /* set up our view volume (default) */
159 gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
160 v->view_pos.x + v->view_forward[0],
161 v->view_pos.y + v->view_forward[1],
162 v->view_pos.z + v->view_forward[2],
163 v->view_up[0], v->view_up[1], v->view_up[2]);
165 /* lock view horizontally towards sun (testing) */
166 /* gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
167 v->view_pos.x + v->surface_to_sun[0],
168 v->view_pos.y + v->surface_to_sun[1],
169 v->view_pos.z + v->surface_to_sun[2],
170 v->view_up[0], v->view_up[1], v->view_up[2]); */
172 /* lock view horizontally towards south (testing) */
173 /* gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
174 v->view_pos.x + v->surface_south[0],
175 v->view_pos.y + v->surface_south[1],
176 v->view_pos.z + v->surface_south[2],
177 v->view_up[0], v->view_up[1], v->view_up[2]); */
179 /* set the sun position */
180 xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
184 /*************************************************************************
185 * Draw a basic instrument panel
186 ************************************************************************/
187 static void fgUpdateInstrViewParams( void ) {
188 xglViewport(0, 0 , (GLint)winWidth, (GLint)winHeight / 2);
190 xglMatrixMode(GL_PROJECTION);
194 gluOrtho2D(0, 640, 0, 480);
195 xglMatrixMode(GL_MODELVIEW);
199 xglColor3f(1.0, 1.0, 1.0);
202 xglDisable(GL_DEPTH_TEST);
203 xglDisable(GL_LIGHTING);
206 xglColor3f (0.5, 0.5, 0.5);
209 xglVertex2f(0.0, 0.00);
210 xglVertex2f(0.0, 480.0);
211 xglVertex2f(640.0,480.0);
212 xglVertex2f(640.0, 0.0);
215 xglRectf(0.0,0.0, 640, 480);
216 xglEnable(GL_DEPTH_TEST);
217 xglEnable(GL_LIGHTING);
218 xglMatrixMode(GL_PROJECTION);
220 xglMatrixMode(GL_MODELVIEW);
225 /**************************************************************************
226 * Update all Visuals (redraws anything graphics related)
227 **************************************************************************/
229 static void fgRenderFrame( void ) {
234 GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
236 l = &cur_light_params;
237 t = &cur_time_params;
240 /* update view volume parameters */
241 fgUpdateViewParams();
243 xglClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
245 /* Tell GL we are switching to model view parameters */
246 xglMatrixMode(GL_MODELVIEW);
247 /* xglLoadIdentity(); */
250 xglDisable( GL_DEPTH_TEST );
251 xglDisable( GL_LIGHTING );
252 xglDisable( GL_CULL_FACE );
253 xglDisable( GL_FOG );
254 xglShadeModel( GL_SMOOTH );
257 /* setup transformation for drawing astronomical objects */
259 /* Translate to view position */
260 xglTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
261 /* Rotate based on gst (side real time) */
262 angle = t->gst * 15.041085; /* should be 15.041085, Curt thought it was 15*/
263 /* printf("Rotating astro objects by %.2f degrees\n",angle); */
264 xglRotatef( angle, 0.0, 0.0, -1.0 );
266 /* draw stars and planets */
272 /* render the moon */
273 xglEnable( GL_LIGHTING );
274 /* set lighting parameters */
275 xglLightfv(GL_LIGHT0, GL_AMBIENT, white );
276 xglLightfv(GL_LIGHT0, GL_DIFFUSE, white );
277 xglEnable( GL_CULL_FACE );
283 xglShadeModel( GL_SMOOTH );
284 xglEnable( GL_DEPTH_TEST );
286 xglFogfv (GL_FOG_COLOR, l->fog_color);
287 /* set lighting parameters */
288 xglLightfv(GL_LIGHT0, GL_AMBIENT, l->scene_ambient );
289 xglLightfv(GL_LIGHT0, GL_DIFFUSE, l->scene_diffuse );
291 /* fgSceneryRender(); */
298 /* display instruments */
299 if (displayInstruments) {
300 fgUpdateInstrViewParams();
309 /**************************************************************************
310 * Update internal time dependent calculations (i.e. flight model)
311 **************************************************************************/
313 void fgUpdateTimeDepCalcs(int multi_loop) {
319 f = ¤t_aircraft.flight;
320 t = &cur_time_params;
323 /* update the flight model */
324 if ( multi_loop < 0 ) {
325 multi_loop = DEFAULT_MULTILOOP;
328 /* printf("updating flight model x %d\n", multi_loop); */
329 fgFlightModelUpdate(FG_LARCSIM, f, multi_loop);
331 /* update the view angle */
332 for ( i = 0; i < multi_loop; i++ ) {
333 if ( fabs(v->goal_view_offset - v->view_offset) < 0.05 ) {
334 v->view_offset = v->goal_view_offset;
337 /* move v->view_offset towards v->goal_view_offset */
338 if ( v->goal_view_offset > v->view_offset ) {
339 if ( v->goal_view_offset - v->view_offset < FG_PI ) {
340 v->view_offset += 0.01;
342 v->view_offset -= 0.01;
345 if ( v->view_offset - v->goal_view_offset < FG_PI ) {
346 v->view_offset -= 0.01;
348 v->view_offset += 0.01;
351 if ( v->view_offset > FG_2PI ) {
352 v->view_offset -= FG_2PI;
353 } else if ( v->view_offset < 0 ) {
354 v->view_offset += FG_2PI;
361 void fgInitTimeDepCalcs( void ) {
362 /* initialize timer */
365 fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
371 /**************************************************************************
372 * Scenery management routines
373 **************************************************************************/
375 /* static void fgSceneryInit_OLD() { */
377 /* scenery = fgSceneryCompile_OLD();
378 runway = fgRunwayHack_OLD(0.69, 53.07);
382 /* create the scenery */
383 /* GLint fgSceneryCompile_OLD() {
386 scenery = mesh2GL(mesh_ptr_OLD);
392 /* hack in a runway */
393 /* GLint fgRunwayHack_OLD(double width, double length) {
394 static GLfloat concrete[4] = { 0.5, 0.5, 0.5, 1.0 };
395 static GLfloat line[4] = { 0.9, 0.9, 0.9, 1.0 };
398 float line_len, line_width_2, cur_pos;
400 runway = xglGenLists(1);
401 xglNewList(runway, GL_COMPILE);
404 /* xglBegin(GL_POLYGON);
405 xglMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, concrete );
406 xglNormal3f(0.0, 0.0, 1.0);
408 xglVertex3d( 0.0, -width/2.0, 0.0);
409 xglVertex3d( 0.0, width/2.0, 0.0);
410 xglVertex3d(length, width/2.0, 0.0);
411 xglVertex3d(length, -width/2.0, 0.0);
414 /* draw center line */
415 /* xglMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, line );
416 line_len = length / ( 2 * num_lines + 1);
417 printf("line_len = %.3f\n", line_len);
420 for ( i = 0; i < num_lines; i++ ) {
421 xglBegin(GL_POLYGON);
422 xglVertex3d( cur_pos, -line_width_2, 0.005);
423 xglVertex3d( cur_pos, line_width_2, 0.005);
425 xglVertex3d( cur_pos, line_width_2, 0.005);
426 xglVertex3d( cur_pos, -line_width_2, 0.005);
437 /* draw the scenery */
438 /*static void fgSceneryDraw_OLD() {
439 static float z = 32.35;
443 xglCallList(scenery);
445 printf("*** Drawing runway at %.2f\n", z);
447 xglTranslatef( -398391.28, 120070.41, 32.35);
448 xglRotatef(170.0, 0.0, 0.0, 1.0);
456 /* What should we do when we have nothing else to do? How about get
457 * ready for the next move and update the display? */
458 static void fgMainLoop( void ) {
459 static int remainder = 0;
460 int elapsed, multi_loop;
464 struct fgAIRCRAFT *a;
468 fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
469 fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
471 a = ¤t_aircraft;
473 t = &cur_time_params;
479 /* fgJoystickRead( &joy_x, &joy_y, &joy_b1, &joy_b2 );
480 printf( "Joystick X %f Y %f B1 %d B2 %d\n",
481 joy_x, joy_y, joy_b1, joy_b2 );
483 fgAileronSet( joy_x ); */
485 /* Calculate model iterations needed */
486 elapsed = fgGetTimeInterval();
487 fgPrintf( FG_ALL, FG_BULK, "Time interval is = %d, previous remainder is = %d\n",
489 fgPrintf( FG_ALL, FG_BULK, "--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
490 elapsed += remainder;
492 multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
493 remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
494 fgPrintf( FG_ALL, FG_BULK, "Model iterations needed = %d, new remainder = %d\n",
495 multi_loop, remainder);
497 /* Run flight model */
498 if ( ! use_signals ) {
500 fgUpdateTimeDepCalcs(multi_loop);
503 /* I'm just sticking this here for now, it should probably move
505 cur_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
506 FG_Latitude * RAD_TO_ARCSEC);
507 /* printf("Ground elevation is %.2f meters here.\n", cur_elev); */
508 /* FG_Runway_altitude = cur_elev * METER_TO_FEET; */
510 if ( FG_Altitude * FEET_TO_METER < cur_elev + 3.758099) {
511 /* set this here, otherwise if we set runway height above our
512 current height we get a really nasty bounce. */
513 FG_Runway_altitude = FG_Altitude - 3.758099;
515 /* now set aircraft altitude above ground */
516 FG_Altitude = cur_elev * METER_TO_FEET + 3.758099;
517 fgPrintf( FG_ALL, FG_BULK, "<*> resetting altitude to %.0f meters\n",
518 FG_Altitude * FEET_TO_METER);
521 fgAircraftOutputCurrent(a);
523 /* see if we need to load any new scenery tiles */
526 /* Process/manage pending events */
532 fgPrintf( FG_ALL, FG_DEBUG, "\n");
536 /**************************************************************************
537 * Handle new window size or exposure
538 **************************************************************************/
540 static void fgReshape( int width, int height ) {
541 /* Do this so we can call fgReshape(0,0) ourselves without having to know
542 * what the values of width & height are. */
543 if ( (height > 0) && (width > 0) ) {
544 win_ratio = (GLfloat) height / (GLfloat) width;
550 /* Inform gl of our view window size (now handled elsewhere) */
551 /* xglViewport(0, 0, (GLint)width, (GLint)height); */
553 fgUpdateViewParams();
555 /* xglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); */
559 /**************************************************************************
561 **************************************************************************/
563 int main( int argc, char *argv[] ) {
566 f = ¤t_aircraft.flight;
568 printf("Flight Gear: Version %s\n\n", VERSION);
570 /**********************************************************************
571 * Initialize the Window/Graphics environment.
572 **********************************************************************/
575 /* initialize GLUT */
576 xglutInit(&argc, argv);
578 /* Define Display Parameters */
579 xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
581 /* Define initial window size */
582 xglutInitWindowSize(640, 480);
584 /* Initialize windows */
585 xglutCreateWindow("Flight Gear");
588 /* This is the general house keeping init routine */
591 /* This is the top level init routine which calls all the other
592 * subsystem initialization routines. If you are adding a
593 * subsystem to flight gear, its initialization call should
594 * located in this routine.*/
597 /* setup view parameters, only makes GL calls */
601 /* init timer routines, signals, etc. Arrange for an alarm
602 signal to be generated, etc. */
603 fgInitTimeDepCalcs();
606 /**********************************************************************
607 * Initialize the Event Handlers.
608 **********************************************************************/
611 /* call fgReshape() on window resizes */
612 xglutReshapeFunc( fgReshape );
614 /* call key() on keyboard event */
615 xglutKeyboardFunc( GLUTkey );
616 glutSpecialFunc( GLUTspecialkey );
618 /* call fgMainLoop() whenever there is nothing else to do */
619 xglutIdleFunc( fgMainLoop );
622 xglutDisplayFunc( fgRenderFrame );
624 /* pass control off to the GLUT event handler */
634 int printf (const char *format, ...) {}
639 /* Revision 1.52 1998/01/27 00:47:56 curt
640 /* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
641 /* system and commandline/config file processing code.
643 * Revision 1.51 1998/01/26 15:57:05 curt
644 * Tweaks for dynamic scenery development.
646 * Revision 1.50 1998/01/19 19:27:07 curt
647 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
648 * This should simplify things tremendously.
650 * Revision 1.49 1998/01/19 18:40:31 curt
651 * Tons of little changes to clean up the code and to remove fatal errors
652 * when building with the c++ compiler.
654 * Revision 1.48 1998/01/19 18:35:46 curt
655 * Minor tweaks and fixes for cygwin32.
657 * Revision 1.47 1998/01/13 00:23:08 curt
658 * Initial changes to support loading and management of scenery tiles. Note,
659 * there's still a fair amount of work left to be done.
661 * Revision 1.46 1998/01/08 02:22:06 curt
662 * Beginning to integrate Tile management subsystem.
664 * Revision 1.45 1998/01/07 03:18:55 curt
665 * Moved astronomical stuff from .../Src/Scenery to .../Src/Astro/
667 * Revision 1.44 1997/12/30 22:22:31 curt
668 * Further integration of event manager.
670 * Revision 1.43 1997/12/30 20:47:43 curt
671 * Integrated new event manager with subsystem initializations.
673 * Revision 1.42 1997/12/30 16:36:47 curt
674 * Merged in Durk's changes ...
676 * Revision 1.41 1997/12/30 13:06:56 curt
677 * A couple lighting tweaks ...
679 * Revision 1.40 1997/12/30 01:38:37 curt
680 * Switched back to per vertex normals and smooth shading for terrain.
682 * Revision 1.39 1997/12/22 23:45:45 curt
683 * First stab at sunset/sunrise sky glow effects.
685 * Revision 1.38 1997/12/22 04:14:28 curt
686 * Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
688 * Revision 1.37 1997/12/19 23:34:03 curt
689 * Lot's of tweaking with sky rendering and lighting.
691 * Revision 1.36 1997/12/19 16:44:57 curt
692 * Working on scene rendering order and options.
694 * Revision 1.35 1997/12/18 23:32:32 curt
695 * First stab at sky dome actually starting to look reasonable. :-)
697 * Revision 1.34 1997/12/17 23:13:34 curt
698 * Began working on rendering a sky.
700 * Revision 1.33 1997/12/15 23:54:45 curt
701 * Add xgl wrappers for debugging.
702 * Generate terrain normals on the fly.
704 * Revision 1.32 1997/12/15 20:59:08 curt
707 * Revision 1.31 1997/12/12 21:41:25 curt
708 * More light/material property tweaking ... still a ways off.
710 * Revision 1.30 1997/12/12 19:52:47 curt
711 * Working on lightling and material properties.
713 * Revision 1.29 1997/12/11 04:43:54 curt
714 * Fixed sun vector and lighting problems. I thing the moon is now lit
717 * Revision 1.28 1997/12/10 22:37:45 curt
718 * Prepended "fg" on the name of all global structures that didn't have it yet.
719 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
721 * Revision 1.27 1997/12/09 05:11:54 curt
722 * Working on tweaking lighting.
724 * Revision 1.26 1997/12/09 04:25:29 curt
725 * Working on adding a global lighting params structure.
727 * Revision 1.25 1997/12/08 22:54:09 curt
728 * Enabled GL_CULL_FACE.
730 * Revision 1.24 1997/11/25 19:25:32 curt
731 * Changes to integrate Durk's moon/sun code updates + clean up.
733 * Revision 1.23 1997/11/15 18:16:34 curt
736 * Revision 1.22 1997/10/30 12:38:41 curt
737 * Working on new scenery subsystem.
739 * Revision 1.21 1997/09/23 00:29:38 curt
740 * Tweaks to get things to compile with gcc-win32.
742 * Revision 1.20 1997/09/22 14:44:19 curt
743 * Continuing to try to align stars correctly.
745 * Revision 1.19 1997/09/18 16:20:08 curt
746 * At dusk/dawn add/remove stars in stages.
748 * Revision 1.18 1997/09/16 22:14:51 curt
749 * Tweaked time of day lighting equations. Don't draw stars during the day.
751 * Revision 1.17 1997/09/16 15:50:29 curt
752 * Working on star alignment and time issues.
754 * Revision 1.16 1997/09/13 02:00:06 curt
755 * Mostly working on stars and generating sidereal time for accurate star
758 * Revision 1.15 1997/09/05 14:17:27 curt
759 * More tweaking with stars.
761 * Revision 1.14 1997/09/05 01:35:53 curt
762 * Working on getting stars right.
764 * Revision 1.13 1997/09/04 02:17:34 curt
767 * Revision 1.12 1997/08/27 21:32:24 curt
768 * Restructured view calculation code. Added stars.
770 * Revision 1.11 1997/08/27 03:30:16 curt
771 * Changed naming scheme of basic shared structures.
773 * Revision 1.10 1997/08/25 20:27:22 curt
774 * Merged in initial HUD and Joystick code.
776 * Revision 1.9 1997/08/22 21:34:39 curt
777 * Doing a bit of reorganizing and house cleaning.
779 * Revision 1.8 1997/08/19 23:55:03 curt
780 * Worked on better simulating real lighting.
782 * Revision 1.7 1997/08/16 12:22:38 curt
783 * Working on improving the lighting/shading.
785 * Revision 1.6 1997/08/13 20:24:56 curt
786 * Changes due to changing sunpos interface.
788 * Revision 1.5 1997/08/06 21:08:32 curt
789 * Sun position now *really* works (I think) ... I still have sun time warping
790 * code in place, probably should remove it soon.
792 * Revision 1.4 1997/08/06 15:41:26 curt
793 * Working on correct sun position.
795 * Revision 1.3 1997/08/06 00:24:22 curt
796 * Working on correct real time sun lighting.
798 * Revision 1.2 1997/08/04 20:25:15 curt
799 * Organizational tweaking.
801 * Revision 1.1 1997/08/02 18:45:00 curt
802 * Renamed GLmain.c GLUTmain.c
804 * Revision 1.43 1997/08/02 16:23:47 curt
807 * Revision 1.42 1997/08/01 19:43:33 curt
808 * Making progress with coordinate system overhaul.
810 * Revision 1.41 1997/07/31 22:52:37 curt
811 * Working on redoing internal coordinate systems & scenery transformations.
813 * Revision 1.40 1997/07/30 16:12:42 curt
814 * Moved fg_random routines from Util/ to Math/
816 * Revision 1.39 1997/07/21 14:45:01 curt
819 * Revision 1.38 1997/07/19 23:04:47 curt
820 * Added an initial weather section.
822 * Revision 1.37 1997/07/19 22:34:02 curt
823 * Moved PI definitions to ../constants.h
824 * Moved random() stuff to ../Utils/ and renamed fg_random()
826 * Revision 1.36 1997/07/18 23:41:25 curt
827 * Tweaks for building with Cygnus Win32 compiler.
829 * Revision 1.35 1997/07/18 14:28:34 curt
830 * Hacked in some support for wind/turbulence.
832 * Revision 1.34 1997/07/16 20:04:48 curt
833 * Minor tweaks to aid Win32 port.
835 * Revision 1.33 1997/07/12 03:50:20 curt
836 * Added an #include <Windows32/Base.h> to help compiling for Win32
838 * Revision 1.32 1997/07/11 03:23:18 curt
839 * Solved some scenery display/orientation problems. Still have a positioning
840 * (or transformation?) problem.
842 * Revision 1.31 1997/07/11 01:29:58 curt
843 * More tweaking of terrian floor.
845 * Revision 1.30 1997/07/10 04:26:37 curt
846 * We now can interpolated ground elevation for any position in the grid. We
847 * can use this to enforce a "hard" ground. We still need to enforce some
848 * bounds checking so that we don't try to lookup data points outside the
851 * Revision 1.29 1997/07/09 21:31:12 curt
852 * Working on making the ground "hard."
854 * Revision 1.28 1997/07/08 18:20:12 curt
855 * Working on establishing a hard ground.
857 * Revision 1.27 1997/07/07 20:59:49 curt
858 * Working on scenery transformations to enable us to fly fluidly over the
859 * poles with no discontinuity/distortion in scenery.
861 * Revision 1.26 1997/07/05 20:43:34 curt
862 * renamed mat3 directory to Math so we could add other math related routines.
864 * Revision 1.25 1997/06/29 21:19:17 curt
865 * Working on scenery management system.
867 * Revision 1.24 1997/06/26 22:14:53 curt
868 * Beginning work on a scenery management system.
870 * Revision 1.23 1997/06/26 19:08:33 curt
871 * Restructuring make, adding automatic "make dep" support.
873 * Revision 1.22 1997/06/25 15:39:47 curt
874 * Minor changes to compile with rsxnt/win32.
876 * Revision 1.21 1997/06/22 21:44:41 curt
877 * Working on intergrating the VRML (subset) parser.
879 * Revision 1.20 1997/06/21 17:12:53 curt
880 * Capitalized subdirectory names.
882 * Revision 1.19 1997/06/18 04:10:31 curt
883 * A couple more runway tweaks ...
885 * Revision 1.18 1997/06/18 02:21:24 curt
888 * Revision 1.17 1997/06/17 16:51:58 curt
889 * Timer interval stuff now uses gettimeofday() instead of ftime()
891 * Revision 1.16 1997/06/17 04:19:16 curt
892 * More timer related tweaks with respect to view direction changes.
894 * Revision 1.15 1997/06/17 03:41:10 curt
895 * Nonsignal based interval timing is now working.
896 * This would be a good time to look at cleaning up the code structure a bit.
898 * Revision 1.14 1997/06/16 19:32:51 curt
899 * Starting to add general timer support.
901 * Revision 1.13 1997/06/02 03:40:06 curt
902 * A tiny bit more view tweaking.
904 * Revision 1.12 1997/06/02 03:01:38 curt
905 * Working on views (side, front, back, transitions, etc.)
907 * Revision 1.11 1997/05/31 19:16:25 curt
908 * Elevator trim added.
910 * Revision 1.10 1997/05/31 04:13:52 curt
913 * Continuing work on the LaRCsim flight model integration.
914 * Added some MSFS-like keyboard input handling.
916 * Revision 1.9 1997/05/30 19:27:01 curt
917 * The LaRCsim flight model is starting to look like it is working.
919 * Revision 1.8 1997/05/30 03:54:10 curt
920 * Made a bit more progress towards integrating the LaRCsim flight model.
922 * Revision 1.7 1997/05/29 22:39:49 curt
923 * Working on incorporating the LaRCsim flight model.
925 * Revision 1.6 1997/05/29 12:31:39 curt
926 * Minor tweaks, moving towards general flight model integration.
928 * Revision 1.5 1997/05/29 02:33:23 curt
929 * Updated to reflect changing interfaces in other "modules."
931 * Revision 1.4 1997/05/27 17:44:31 curt
932 * Renamed & rearranged variables and routines. Added some initial simple
933 * timer/alarm routines so the flight model can be updated on a regular
936 * Revision 1.3 1997/05/23 15:40:25 curt
937 * Added GNU copyright headers.
940 * Revision 1.2 1997/05/23 00:35:12 curt
941 * Trying to get fog to work ...
943 * Revision 1.1 1997/05/21 15:57:51 curt
944 * Renamed due to added GLUT support.
946 * Revision 1.3 1997/05/19 18:22:42 curt
947 * Parameter tweaking ... starting to stub in fog support.
949 * Revision 1.2 1997/05/17 00:17:34 curt
950 * Trying to stub in support for standard OpenGL.
952 * Revision 1.1 1997/05/16 16:05:52 curt