]> git.mxchange.org Git - flightgear.git/blob - Main/GLUTmain.c
Working on new scenery subsystem.
[flightgear.git] / Main / GLUTmain.c
1 /**************************************************************************
2  * GLUTmain.c -- top level sim routines
3  *
4  * Written by Curtis Olson for OpenGL, started May 1997.
5  *
6  * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
7  *
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.
12  *
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.
17  *
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.
21  *
22  * $Id$
23  * (Log is kept at end of this file)
24  **************************************************************************/
25
26
27 #ifdef WIN32
28 #  include <windows.h>                     
29 #endif
30
31 #include <GL/glut.h>
32 #include <stdio.h>
33
34 #include "GLUTkey.h"
35 #include "fg_init.h"
36 #include "views.h"
37
38 #include "../constants.h"
39 #include "../general.h"
40
41 #include "../Aircraft/aircraft.h"
42 #include "../Cockpit/cockpit.h"
43 #include "../Joystick/joystick.h"
44 #include "../Math/fg_geodesy.h"
45 #include "../Math/mat3.h"
46 #include "../Math/polar.h"
47 #include "../Scenery/mesh.h"
48 #include "../Scenery/scenery.h"
49 #include "../Time/fg_time.h"
50 #include "../Time/fg_timer.h"
51 #include "../Time/sunpos.h"
52 #include "../Weather/weather.h"
53
54
55 /* This is a record containing all the info for the aircraft currently
56    being operated */
57 struct AIRCRAFT current_aircraft;
58
59 /* This is a record containing global housekeeping information */
60 struct GENERAL general;
61
62 /* This is a record containing current weather info */
63 struct WEATHER current_weather;
64
65 /* This is a record containing current view parameters */
66 struct VIEW current_view;
67
68 /* view parameters */
69 static GLfloat win_ratio = 1.0;
70
71 /* sun direction */
72 /* static GLfloat sun_vec[4] = {1.0, 0.0, 0.0, 0.0 }; */
73
74 /* if the 4th field is 0.0, this specifies a direction ... */
75 /* clear color (sky) */
76 static GLfloat fgClearColor[4] = {0.60, 0.60, 0.90, 1.0};
77 /* fog color */
78 static GLfloat fgFogColor[4] =   {0.65, 0.65, 0.85, 1.0};
79
80 /* temporary hack */
81 /* extern struct mesh *mesh_ptr; */
82 /* Function prototypes */
83 /* GLint fgSceneryCompile_OLD(); */
84 /* static void fgSceneryDraw_OLD(); */
85
86 /* pointer to scenery structure */
87 /* static GLint scenery, runway; */
88
89 double Simtime;
90
91 /* Another hack */
92 int use_signals = 0;
93
94 /* Yet another hack. This one used by the HUD code. Michele */
95 int show_hud;
96
97
98 /**************************************************************************
99  * fgInitVisuals() -- Initialize various GL/view parameters
100  **************************************************************************/
101
102 static void fgInitVisuals() {
103     struct fgTIME *t;
104     struct WEATHER *w;
105
106     t = &cur_time_params;
107     w = &current_weather;
108
109     glEnable( GL_DEPTH_TEST );
110     /* glFrontFace(GL_CW); */
111     glEnable( GL_CULL_FACE );
112
113     /* If enabled, normal vectors specified with glNormal are scaled
114        to unit length after transformation.  See glNormal. */
115     glEnable( GL_NORMALIZE );
116
117     glLightfv( GL_LIGHT0, GL_POSITION, t->sun_vec );
118     glEnable( GL_LIGHTING );
119     glEnable( GL_LIGHT0 );
120
121     glShadeModel( GL_FLAT ); /* glShadeModel( GL_SMOOTH ); */
122
123     glEnable( GL_FOG );
124     glFogi (GL_FOG_MODE, GL_LINEAR);
125     /* glFogf (GL_FOG_START, 1.0); */
126     glFogf (GL_FOG_END, w->visibility);
127     glFogfv (GL_FOG_COLOR, fgFogColor);
128     /* glFogf (GL_FOG_DENSITY, w->visibility); */
129     /* glHint (GL_FOG_HINT, GL_FASTEST); */
130
131     glClearColor(fgClearColor[0], fgClearColor[1], fgClearColor[2], 
132                  fgClearColor[3]);
133 }
134
135
136 /**************************************************************************
137  * Update the view volume, position, and orientation
138  **************************************************************************/
139
140 static void fgUpdateViewParams() {
141     struct FLIGHT *f;
142     struct fgTIME *t;
143     struct VIEW *v;
144     double x_2, x_4, x_8, x_10;
145     double ambient, diffuse, sky;
146     /* GLfloat color[4] = { 1.0, 1.0, 0.50, 1.0 };*/
147     GLfloat color[4] = { 1.0, 0.0, 0.00, 1.0 };
148     GLfloat amb[3], diff[3], fog[4], clear[4];
149
150     f = &current_aircraft.flight;
151     t = &cur_time_params;
152     v = &current_view;
153
154     fgViewUpdate(f, v);
155
156     /* Tell GL we are about to modify the projection parameters */
157     glMatrixMode(GL_PROJECTION);
158     glLoadIdentity();
159     gluPerspective(60.0, 1.0/win_ratio, 1.0, 200000.0);
160
161     glMatrixMode(GL_MODELVIEW);
162     glLoadIdentity();
163     
164     /* set up our view volume */
165     gluLookAt(v->view_pos.x, v->view_pos.y, v->view_pos.z,
166               v->view_pos.x + v->view_forward[0], 
167               v->view_pos.y + v->view_forward[1], 
168               v->view_pos.z + v->view_forward[2],
169               v->view_up[0], v->view_up[1], v->view_up[2]);
170
171     /* set the sun position */
172     glLightfv( GL_LIGHT0, GL_POSITION, t->sun_vec );
173
174     /* calculate lighting parameters based on sun's relative angle to
175      * local up */
176     /* ya kind'a have to plot this to see the magic */
177
178     /* x = t->sun_angle^8 */
179     x_2 = t->sun_angle * t->sun_angle;
180     x_4 = x_2 * x_2;
181     x_8 = x_4 * x_4;
182     x_10 = x_8 * x_2;
183
184     ambient = 0.4 * pow(1.1, -x_10 / 30.0);
185
186     /* diffuse = 0.4 * cos(0.3 * x_2);
187     if ( t->sun_angle > FG_PI_2 + 0.05 ) {
188         diffuse = 0.0;
189     }
190     */
191
192     diffuse = ambient;
193
194     sky = 0.85 * pow(1.2, -x_8 / 20.0) + 0.15;
195
196     /* sky = 0.15; */ /* to force a dark sky (for testing) */
197
198     if ( ambient < 0.1 ) { ambient = 0.1; }
199     if ( diffuse < 0.0 ) { diffuse = 0.0; }
200
201     if ( sky < 0.0 ) { sky = 0.0; }
202
203     amb[0] = color[0] * ambient;
204     amb[1] = color[1] * ambient;
205     amb[2] = color[2] * ambient;
206
207     diff[0] = color[0] * diffuse;
208     diff[1] = color[1] * diffuse;
209     diff[2] = color[2] * diffuse;
210
211     /* set lighting parameters */
212     glLightfv(GL_LIGHT0, GL_AMBIENT, amb );
213     glLightfv(GL_LIGHT0, GL_DIFFUSE, diff );
214
215     /* set fog color */
216     fog[0] = fgFogColor[0] * (ambient + diffuse);
217     fog[1] = fgFogColor[1] * (ambient + diffuse);
218     fog[2] = fgFogColor[2] * (ambient + diffuse);
219     fog[3] = fgFogColor[3];
220     glFogfv (GL_FOG_COLOR, fog);
221
222     /* set sky color */
223     clear[0] = fgClearColor[0] * sky;
224     clear[1] = fgClearColor[1] * sky;
225     clear[2] = fgClearColor[2] * sky;
226     clear[3] = fgClearColor[3];
227     glClearColor(clear[0], clear[1], clear[2], clear[3]);
228 }
229
230
231 /**************************************************************************
232  * Update all Visuals (redraws anything graphics related)
233  **************************************************************************/
234
235 static void fgUpdateVisuals( void ) {
236     /* update view volume parameters */
237     fgUpdateViewParams();
238
239     glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
240
241     /* Tell GL we are switching to model view parameters */
242     glMatrixMode(GL_MODELVIEW);
243     /* glLoadIdentity(); */
244
245     /* draw scenery */
246     fgSceneryRender();
247
248     /* display HUD */
249     if( show_hud )
250         fgCockpitUpdate();
251
252     #ifdef GLUT
253       glutSwapBuffers();
254     #endif
255 }
256
257
258 /**************************************************************************
259  * Update internal time dependent calculations (i.e. flight model)
260  **************************************************************************/
261
262 void fgUpdateTimeDepCalcs(int multi_loop) {
263     struct FLIGHT *f;
264     struct fgTIME *t;
265     struct VIEW *v;
266     int i;
267
268     f = &current_aircraft.flight;
269     t = &cur_time_params;
270     v = &current_view;
271
272     /* update the flight model */
273     if ( multi_loop < 0 ) {
274         multi_loop = DEFAULT_MULTILOOP;
275     }
276
277     /* printf("updating flight model x %d\n", multi_loop); */
278     fgFlightModelUpdate(FG_LARCSIM, f, multi_loop);
279
280     /* refresh shared sun position and sun_vec */
281     fgUpdateSunPos(scenery.center);
282
283     /* update the view angle */
284     for ( i = 0; i < multi_loop; i++ ) {
285         if ( fabs(v->goal_view_offset - v->view_offset) < 0.05 ) {
286             v->view_offset = v->goal_view_offset;
287             break;
288         } else {
289             /* move v->view_offset towards v->goal_view_offset */
290             if ( v->goal_view_offset > v->view_offset ) {
291                 if ( v->goal_view_offset - v->view_offset < FG_PI ) {
292                     v->view_offset += 0.01;
293                 } else {
294                     v->view_offset -= 0.01;
295                 }
296             } else {
297                 if ( v->view_offset - v->goal_view_offset < FG_PI ) {
298                     v->view_offset -= 0.01;
299                 } else {
300                     v->view_offset += 0.01;
301                 }
302             }
303             if ( v->view_offset > FG_2PI ) {
304                 v->view_offset -= FG_2PI;
305             } else if ( v->view_offset < 0 ) {
306                 v->view_offset += FG_2PI;
307             }
308         }
309     }
310 }
311
312
313 void fgInitTimeDepCalcs() {
314     /* initialize timer */
315
316 #ifdef USE_ITIMER
317     fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
318 #endif USE_ITIMER
319
320 }
321
322
323 /**************************************************************************
324  * Scenery management routines
325  **************************************************************************/
326
327 /* static void fgSceneryInit_OLD() { */
328     /* make scenery */
329 /*     scenery = fgSceneryCompile_OLD();
330     runway = fgRunwayHack_OLD(0.69, 53.07);
331 } */
332
333
334 /* create the scenery */
335 /* GLint fgSceneryCompile_OLD() {
336     GLint scenery;
337
338     scenery = mesh2GL(mesh_ptr_OLD);
339
340     return(scenery);
341 }
342 */
343
344 /* hack in a runway */
345 /* GLint fgRunwayHack_OLD(double width, double length) {
346     static GLfloat concrete[4] = { 0.5, 0.5, 0.5, 1.0 };
347     static GLfloat line[4]     = { 0.9, 0.9, 0.9, 1.0 };
348     int i;
349     int num_lines = 16;
350     float line_len, line_width_2, cur_pos;
351
352     runway = glGenLists(1);
353     glNewList(runway, GL_COMPILE);
354     */
355     /* draw concrete */
356 /*    glBegin(GL_POLYGON);
357     glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, concrete );
358     glNormal3f(0.0, 0.0, 1.0);
359
360     glVertex3d( 0.0,   -width/2.0, 0.0);
361     glVertex3d( 0.0,    width/2.0, 0.0);
362     glVertex3d(length,  width/2.0, 0.0);
363     glVertex3d(length, -width/2.0, 0.0);
364     glEnd();
365     */
366     /* draw center line */
367 /*    glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, line );
368     line_len = length / ( 2 * num_lines + 1);
369     printf("line_len = %.3f\n", line_len);
370     line_width_2 = 0.02;
371     cur_pos = line_len;
372     for ( i = 0; i < num_lines; i++ ) {
373         glBegin(GL_POLYGON);
374         glVertex3d( cur_pos, -line_width_2, 0.005);
375         glVertex3d( cur_pos,  line_width_2, 0.005);
376         cur_pos += line_len;
377         glVertex3d( cur_pos,  line_width_2, 0.005);
378         glVertex3d( cur_pos, -line_width_2, 0.005);
379         cur_pos += line_len;
380         glEnd();
381     }
382
383     glEndList();
384
385     return(runway);
386 }
387 */
388
389 /* draw the scenery */
390 /*static void fgSceneryDraw_OLD() {
391     static float z = 32.35;
392
393     glPushMatrix();
394
395     glCallList(scenery);
396
397     printf("*** Drawing runway at %.2f\n", z);
398
399     glTranslatef( -398391.28, 120070.41, 32.35);
400     glRotatef(170.0, 0.0, 0.0, 1.0);
401     glCallList(runway);
402
403     glPopMatrix();
404 }
405 */
406
407 /* What should we do when we have nothing else to do?  How about get
408  * ready for the next move and update the display? */
409 static void fgMainLoop( void ) {
410     static int remainder = 0;
411     int elapsed, multi_loop;
412     double cur_elev;
413     double joy_x, joy_y;
414     int joy_b1, joy_b2;
415     struct AIRCRAFT *a;
416     struct FLIGHT *f;
417     struct fgTIME *t;
418
419     a = &current_aircraft;
420     f = &a->flight;
421     t = &cur_time_params;
422
423     /* update "time" */
424     fgTimeUpdate(f, t);
425
426     /* Read joystick */
427     /* fgJoystickRead( &joy_x, &joy_y, &joy_b1, &joy_b2 );
428     printf( "Joystick X %f  Y %f  B1 %d  B2 %d\n",  
429             joy_x, joy_y, joy_b1, joy_b2 );
430     fgElevSet( -joy_y );
431     fgAileronSet( joy_x ); */
432
433     /* update the weather for our current position */
434     fgWeatherUpdate(FG_Longitude * RAD_TO_ARCSEC, 
435                     FG_Latitude * RAD_TO_ARCSEC, 
436                     FG_Altitude * FEET_TO_METER);
437
438     /* Calculate model iterations needed */
439     elapsed = fgGetTimeInterval();
440     printf("Time interval is = %d, previous remainder is = %d\n", elapsed, 
441            remainder);
442     printf("--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
443     elapsed += remainder;
444
445     multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
446     remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
447     printf("Model iterations needed = %d, new remainder = %d\n", multi_loop, 
448            remainder);
449
450     if ( ! use_signals ) {
451         /* flight model */
452         fgUpdateTimeDepCalcs(multi_loop);
453     }
454
455     /* I'm just sticking this here for now, it should probably move 
456      * eventually */
457     cur_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC, 
458                                FG_Latitude  * RAD_TO_ARCSEC);
459     printf("Ground elevation is %.2f meters here.\n", cur_elev);
460     /* FG_Runway_altitude = cur_elev * METER_TO_FEET; */
461
462     if ( FG_Altitude * FEET_TO_METER < cur_elev + 3.758099) {
463         /* set this here, otherwise if we set runway height above our
464            current height we get a really nasty bounce. */
465         FG_Runway_altitude = FG_Altitude - 3.758099;
466
467         /* now set aircraft altitude above ground */
468         FG_Altitude = cur_elev * METER_TO_FEET + 3.758099;
469         printf("<*> resetting altitude to %.0f meters\n", 
470                FG_Altitude * FEET_TO_METER);
471     }
472
473     fgAircraftOutputCurrent(a);
474
475     /* redraw display */
476     fgUpdateVisuals();
477 }
478
479
480 /**************************************************************************
481  * Handle new window size or exposure
482  **************************************************************************/
483
484 static void fgReshape( int width, int height ) {
485     /* Do this so we can call fgReshape(0,0) ourselves without having to know
486      * what the values of width & height are. */
487     if ( (height > 0) && (width > 0) ) {
488         win_ratio = (GLfloat) height / (GLfloat) width;
489     }
490
491     /* Inform gl of our view window size */
492     glViewport(0, 0, (GLint)width, (GLint)height);
493
494     fgUpdateViewParams();
495     
496     glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
497 }
498
499
500 /**************************************************************************
501  * Main ...
502  **************************************************************************/
503
504 int main( int argc, char *argv[] ) {
505     struct FLIGHT *f;
506
507     f = &current_aircraft.flight;
508
509     printf("Flight Gear: prototype version %s\n\n", VERSION);
510
511     /**********************************************************************
512      * Initialize the Window/Graphics environment.
513      **********************************************************************/
514
515     #ifdef GLUT
516       /* initialize GLUT */
517       glutInit(&argc, argv);
518
519       /* Define Display Parameters */
520       glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
521
522       /* Define initial window size */
523       glutInitWindowSize(640, 480);
524
525       /* Initialize windows */
526       glutCreateWindow("Flight Gear");
527     #endif
528
529     /* This is the general house keeping init routine */
530     fgInitGeneral();
531
532     /* This is the top level init routine which calls all the other
533      * subsystem initialization routines.  If you are adding a
534      * subsystem to flight gear, its initialization call should
535      * located in this routine.*/
536     fgInitSubsystems();
537
538     /* setup view parameters, only makes GL calls */
539     fgInitVisuals();
540
541     if ( use_signals ) {
542         /* init timer routines, signals, etc.  Arrange for an alarm
543            signal to be generated, etc. */
544         fgInitTimeDepCalcs();
545     }
546
547    /**********************************************************************
548      * Initialize the Event Handlers.
549      **********************************************************************/
550
551     #ifdef GLUT
552       /* call fgReshape() on window resizes */
553       glutReshapeFunc( fgReshape );
554
555       /* call key() on keyboard event */
556       glutKeyboardFunc( GLUTkey );
557       glutSpecialFunc( GLUTspecialkey );
558
559       /* call fgMainLoop() whenever there is nothing else to do */
560       glutIdleFunc( fgMainLoop );
561
562       /* draw the scene */
563       glutDisplayFunc( fgUpdateVisuals );
564
565       /* pass control off to the GLUT event handler */
566       glutMainLoop();
567     #endif
568
569     return(0);
570 }
571
572
573 #ifdef NO_PRINTF
574   #include <stdarg.h>
575   int printf (const char *format, ...) {
576   }
577 #endif
578
579
580 /* $Log$
581 /* Revision 1.22  1997/10/30 12:38:41  curt
582 /* Working on new scenery subsystem.
583 /*
584  * Revision 1.21  1997/09/23 00:29:38  curt
585  * Tweaks to get things to compile with gcc-win32.
586  *
587  * Revision 1.20  1997/09/22 14:44:19  curt
588  * Continuing to try to align stars correctly.
589  *
590  * Revision 1.19  1997/09/18 16:20:08  curt
591  * At dusk/dawn add/remove stars in stages.
592  *
593  * Revision 1.18  1997/09/16 22:14:51  curt
594  * Tweaked time of day lighting equations.  Don't draw stars during the day.
595  *
596  * Revision 1.17  1997/09/16 15:50:29  curt
597  * Working on star alignment and time issues.
598  *
599  * Revision 1.16  1997/09/13 02:00:06  curt
600  * Mostly working on stars and generating sidereal time for accurate star
601  * placement.
602  *
603  * Revision 1.15  1997/09/05 14:17:27  curt
604  * More tweaking with stars.
605  *
606  * Revision 1.14  1997/09/05 01:35:53  curt
607  * Working on getting stars right.
608  *
609  * Revision 1.13  1997/09/04 02:17:34  curt
610  * Shufflin' stuff.
611  *
612  * Revision 1.12  1997/08/27 21:32:24  curt
613  * Restructured view calculation code.  Added stars.
614  *
615  * Revision 1.11  1997/08/27 03:30:16  curt
616  * Changed naming scheme of basic shared structures.
617  *
618  * Revision 1.10  1997/08/25 20:27:22  curt
619  * Merged in initial HUD and Joystick code.
620  *
621  * Revision 1.9  1997/08/22 21:34:39  curt
622  * Doing a bit of reorganizing and house cleaning.
623  *
624  * Revision 1.8  1997/08/19 23:55:03  curt
625  * Worked on better simulating real lighting.
626  *
627  * Revision 1.7  1997/08/16 12:22:38  curt
628  * Working on improving the lighting/shading.
629  *
630  * Revision 1.6  1997/08/13 20:24:56  curt
631  * Changes due to changing sunpos interface.
632  *
633  * Revision 1.5  1997/08/06 21:08:32  curt
634  * Sun position now *really* works (I think) ... I still have sun time warping
635  * code in place, probably should remove it soon.
636  *
637  * Revision 1.4  1997/08/06 15:41:26  curt
638  * Working on correct sun position.
639  *
640  * Revision 1.3  1997/08/06 00:24:22  curt
641  * Working on correct real time sun lighting.
642  *
643  * Revision 1.2  1997/08/04 20:25:15  curt
644  * Organizational tweaking.
645  *
646  * Revision 1.1  1997/08/02 18:45:00  curt
647  * Renamed GLmain.c GLUTmain.c
648  *
649  * Revision 1.43  1997/08/02 16:23:47  curt
650  * Misc. tweaks.
651  *
652  * Revision 1.42  1997/08/01 19:43:33  curt
653  * Making progress with coordinate system overhaul.
654  *
655  * Revision 1.41  1997/07/31 22:52:37  curt
656  * Working on redoing internal coordinate systems & scenery transformations.
657  *
658  * Revision 1.40  1997/07/30 16:12:42  curt
659  * Moved fg_random routines from Util/ to Math/
660  *
661  * Revision 1.39  1997/07/21 14:45:01  curt
662  * Minor tweaks.
663  *
664  * Revision 1.38  1997/07/19 23:04:47  curt
665  * Added an initial weather section.
666  *
667  * Revision 1.37  1997/07/19 22:34:02  curt
668  * Moved PI definitions to ../constants.h
669  * Moved random() stuff to ../Utils/ and renamed fg_random()
670  *
671  * Revision 1.36  1997/07/18 23:41:25  curt
672  * Tweaks for building with Cygnus Win32 compiler.
673  *
674  * Revision 1.35  1997/07/18 14:28:34  curt
675  * Hacked in some support for wind/turbulence.
676  *
677  * Revision 1.34  1997/07/16 20:04:48  curt
678  * Minor tweaks to aid Win32 port.
679  *
680  * Revision 1.33  1997/07/12 03:50:20  curt
681  * Added an #include <Windows32/Base.h> to help compiling for Win32
682  *
683  * Revision 1.32  1997/07/11 03:23:18  curt
684  * Solved some scenery display/orientation problems.  Still have a positioning
685  * (or transformation?) problem.
686  *
687  * Revision 1.31  1997/07/11 01:29:58  curt
688  * More tweaking of terrian floor.
689  *
690  * Revision 1.30  1997/07/10 04:26:37  curt
691  * We now can interpolated ground elevation for any position in the grid.  We
692  * can use this to enforce a "hard" ground.  We still need to enforce some
693  * bounds checking so that we don't try to lookup data points outside the
694  * grid data set.
695  *
696  * Revision 1.29  1997/07/09 21:31:12  curt
697  * Working on making the ground "hard."
698  *
699  * Revision 1.28  1997/07/08 18:20:12  curt
700  * Working on establishing a hard ground.
701  *
702  * Revision 1.27  1997/07/07 20:59:49  curt
703  * Working on scenery transformations to enable us to fly fluidly over the
704  * poles with no discontinuity/distortion in scenery.
705  *
706  * Revision 1.26  1997/07/05 20:43:34  curt
707  * renamed mat3 directory to Math so we could add other math related routines.
708  *
709  * Revision 1.25  1997/06/29 21:19:17  curt
710  * Working on scenery management system.
711  *
712  * Revision 1.24  1997/06/26 22:14:53  curt
713  * Beginning work on a scenery management system.
714  *
715  * Revision 1.23  1997/06/26 19:08:33  curt
716  * Restructuring make, adding automatic "make dep" support.
717  *
718  * Revision 1.22  1997/06/25 15:39:47  curt
719  * Minor changes to compile with rsxnt/win32.
720  *
721  * Revision 1.21  1997/06/22 21:44:41  curt
722  * Working on intergrating the VRML (subset) parser.
723  *
724  * Revision 1.20  1997/06/21 17:12:53  curt
725  * Capitalized subdirectory names.
726  *
727  * Revision 1.19  1997/06/18 04:10:31  curt
728  * A couple more runway tweaks ...
729  *
730  * Revision 1.18  1997/06/18 02:21:24  curt
731  * Hacked in a runway
732  *
733  * Revision 1.17  1997/06/17 16:51:58  curt
734  * Timer interval stuff now uses gettimeofday() instead of ftime()
735  *
736  * Revision 1.16  1997/06/17 04:19:16  curt
737  * More timer related tweaks with respect to view direction changes.
738  *
739  * Revision 1.15  1997/06/17 03:41:10  curt
740  * Nonsignal based interval timing is now working.
741  * This would be a good time to look at cleaning up the code structure a bit.
742  *
743  * Revision 1.14  1997/06/16 19:32:51  curt
744  * Starting to add general timer support.
745  *
746  * Revision 1.13  1997/06/02 03:40:06  curt
747  * A tiny bit more view tweaking.
748  *
749  * Revision 1.12  1997/06/02 03:01:38  curt
750  * Working on views (side, front, back, transitions, etc.)
751  *
752  * Revision 1.11  1997/05/31 19:16:25  curt
753  * Elevator trim added.
754  *
755  * Revision 1.10  1997/05/31 04:13:52  curt
756  * WE CAN NOW FLY!!!
757  *
758  * Continuing work on the LaRCsim flight model integration.
759  * Added some MSFS-like keyboard input handling.
760  *
761  * Revision 1.9  1997/05/30 19:27:01  curt
762  * The LaRCsim flight model is starting to look like it is working.
763  *
764  * Revision 1.8  1997/05/30 03:54:10  curt
765  * Made a bit more progress towards integrating the LaRCsim flight model.
766  *
767  * Revision 1.7  1997/05/29 22:39:49  curt
768  * Working on incorporating the LaRCsim flight model.
769  *
770  * Revision 1.6  1997/05/29 12:31:39  curt
771  * Minor tweaks, moving towards general flight model integration.
772  *
773  * Revision 1.5  1997/05/29 02:33:23  curt
774  * Updated to reflect changing interfaces in other "modules."
775  *
776  * Revision 1.4  1997/05/27 17:44:31  curt
777  * Renamed & rearranged variables and routines.   Added some initial simple
778  * timer/alarm routines so the flight model can be updated on a regular 
779  * interval.
780  *
781  * Revision 1.3  1997/05/23 15:40:25  curt
782  * Added GNU copyright headers.
783  * Fog now works!
784  *
785  * Revision 1.2  1997/05/23 00:35:12  curt
786  * Trying to get fog to work ...
787  *
788  * Revision 1.1  1997/05/21 15:57:51  curt
789  * Renamed due to added GLUT support.
790  *
791  * Revision 1.3  1997/05/19 18:22:42  curt
792  * Parameter tweaking ... starting to stub in fog support.
793  *
794  * Revision 1.2  1997/05/17 00:17:34  curt
795  * Trying to stub in support for standard OpenGL.
796  *
797  * Revision 1.1  1997/05/16 16:05:52  curt
798  * Initial revision.
799  *
800  */