]> git.mxchange.org Git - flightgear.git/blob - Main/GLmain.c
Moved PI definitions to ../constants.h
[flightgear.git] / Main / GLmain.c
1 /**************************************************************************
2  * GLmain.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 #include <stdio.h>
28
29 #ifdef WIN32
30 #  include <windows.h>                     
31 #endif
32
33 #ifdef GLUT
34     #include <GL/glut.h>
35     #include "GLUTkey.h"
36 #elif MESA_TK
37     /* assumes -I/usr/include/mesa in compile command */
38     #include "gltk.h"
39     #include "GLTKkey.h"
40 #endif
41
42 #include "../constants.h"
43
44 #include "../Aircraft/aircraft.h"
45 #include "../Scenery/mesh.h"
46 #include "../Scenery/scenery.h"
47 #include "../Math/mat3.h"
48 #include "../Math/polar.h"
49 #include "../Timer/fg_timer.h"
50 #include "../Utils/fg_random.h"
51
52
53 /* This is a record containing all the info for the aircraft currently
54    being operated */
55 struct aircraft_params current_aircraft;
56
57 /* view parameters */
58 static GLfloat win_ratio = 1.0;
59
60 /* sun direction */
61 static GLfloat sun_vec[4] = {-3.0, 1.0, 2.0, 0.0 };
62
63 /* temporary hack */
64 /* extern struct mesh *mesh_ptr; */
65 /* Function prototypes */
66 /* GLint fgSceneryCompile_OLD(); */
67 /* static void fgSceneryDraw_OLD(); */
68
69 /* pointer to scenery structure */
70 /* static GLint scenery, runway; */
71
72 /* Another hack */
73 double fogDensity = 60.0; /* in meters = about 70 miles */
74 double view_offset = 0.0;
75 double goal_view_offset = 0.0;
76
77 /* Another hack */
78 #define DEFAULT_TIMER_HZ 20
79 #define DEFAULT_MULTILOOP 6
80 #define DEFAULT_MODEL_HZ (DEFAULT_TIMER_HZ * DEFAULT_MULTILOOP)
81
82 double Simtime;
83
84 /* Another hack */
85 int use_signals = 0;
86
87
88 /**************************************************************************
89  * fgInitVisuals() -- Initialize various GL/view parameters
90  **************************************************************************/
91
92 static void fgInitVisuals() {
93     /* if the 4th field is 0.0, this specifies a direction ... */
94     static GLfloat fogColor[4] = {0.65, 0.65, 0.85, 1.0};
95     
96     glEnable( GL_DEPTH_TEST );
97     /* glFrontFace(GL_CW); */
98     glEnable( GL_CULL_FACE );
99
100     /* If enabled, normal vectors specified with glNormal are scaled
101        to unit length after transformation.  See glNormal. */
102     glEnable( GL_NORMALIZE );
103
104     glLightfv( GL_LIGHT0, GL_POSITION, sun_vec );
105     glEnable( GL_LIGHTING );
106     glEnable( GL_LIGHT0 );
107
108     glShadeModel( GL_FLAT ); /* glShadeModel( GL_SMOOTH ); */
109
110     glEnable( GL_FOG );
111     glFogi (GL_FOG_MODE, GL_LINEAR);
112     /* glFogf (GL_FOG_START, 1.0); */
113     glFogf (GL_FOG_END, fogDensity);
114     glFogfv (GL_FOG_COLOR, fogColor);
115     /* glFogf (GL_FOG_DENSITY, fogDensity); */
116     /* glHint (GL_FOG_HINT, GL_FASTEST); */
117
118     glClearColor(0.6, 0.6, 0.9, 1.0);
119 }
120
121
122 /**************************************************************************
123  * Update the view volume, position, and orientation
124  **************************************************************************/
125
126 static void fgUpdateViewParams() {
127     struct fgCartesianPoint view_pos;
128     struct flight_params *f;
129     MAT3mat R, TMP;
130     MAT3vec vec, up, forward, fwrd_view;
131
132     f = &current_aircraft.flight;
133
134     /* Tell GL we are about to modify the projection parameters */
135     glMatrixMode(GL_PROJECTION);
136     glLoadIdentity();
137     gluPerspective(45.0, 1.0/win_ratio, 0.1, 200000.0);
138
139     glMatrixMode(GL_MODELVIEW);
140     glLoadIdentity();
141     
142     /* calculate position in current FG view coordinate system */
143     view_pos = fgGeodetic2Cartesian(FG_Longitude, FG_Latitude);
144     view_pos = fgRotateCartesianPoint(view_pos);
145
146     printf("*** Altitude = %.2f meters\n", FG_Altitude * FEET_TO_METER);
147
148     /* build current rotation matrix */
149     MAT3_SET_VEC(vec, 1.0, 0.0, 0.0);
150     MAT3rotate(R, vec, FG_Phi);
151     /* printf("Roll matrix\n"); */
152     /* MAT3print(R, stdout); */
153
154     MAT3_SET_VEC(vec, 0.0, 1.0, 0.0);
155     /* MAT3mult_vec(vec, vec, R); */
156     MAT3rotate(TMP, vec, -FG_Theta);
157     /* printf("Pitch matrix\n"); */
158     /* MAT3print(TMP, stdout); */
159     MAT3mult(R, R, TMP);
160
161     MAT3_SET_VEC(vec, 0.0, 0.0, -1.0);
162     /* MAT3mult_vec(vec, vec, R); */
163     /* MAT3rotate(TMP, vec, FG_PI + FG_PI_2 + FG_Psi + view_offset); */
164     MAT3rotate(TMP, vec, FG_Psi - FG_PI_2);
165  /* printf("Yaw matrix\n");
166     MAT3print(TMP, stdout); */
167     MAT3mult(R, R, TMP);
168
169     /* MAT3print(R, stdout); */
170
171     /* generate the current up, forward, and fwrd-view vectors */
172     MAT3_SET_VEC(vec, 0.0, 0.0, 1.0);
173     MAT3mult_vec(up, vec, R);
174
175     MAT3_SET_VEC(vec, 1.0, 0.0, 0.0);
176     MAT3mult_vec(forward, vec, R);
177     printf("Forward vector is (%.2f,%.2f,%.2f)\n", forward[0], forward[1], 
178            forward[2]);
179
180     MAT3rotate(TMP, up, view_offset);
181     MAT3mult_vec(fwrd_view, forward, TMP);
182
183     printf("View pos = %.4f, %.4f, %.4f\n", view_pos.y, view_pos.z,  
184            FG_Altitude * FEET_TO_METER);
185     gluLookAt(view_pos.y, view_pos.z,  FG_Altitude*FEET_TO_METER * 0.0011,
186               view_pos.y + fwrd_view[0], view_pos.z + fwrd_view[1], 
187               FG_Altitude*FEET_TO_METER * 0.001 + fwrd_view[2],
188               up[0], up[1], up[2]);
189
190     glLightfv( GL_LIGHT0, GL_POSITION, sun_vec );
191 }
192
193
194 /**************************************************************************
195  * Update all Visuals (redraws anything graphics related)
196  **************************************************************************/
197
198 static void fgUpdateVisuals( void ) {
199     /* update view volume parameters */
200     fgUpdateViewParams();
201
202     glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
203
204     /* Tell GL we are switching to model view parameters */
205     glMatrixMode(GL_MODELVIEW);
206     /* glLoadIdentity(); */
207
208     /* draw scenery */
209     fgSceneryRender();
210
211     #ifdef GLUT
212       glutSwapBuffers();
213     #elif MESA_TK
214       tkSwapBuffers();
215     #endif
216 }
217
218
219 /**************************************************************************
220  * Update internal time dependent calculations (i.e. flight model)
221  **************************************************************************/
222
223 void fgUpdateTimeDepCalcs(int multi_loop) {
224     struct flight_params *f;
225     int i;
226
227     f = &current_aircraft.flight;
228
229     /* update the flight model */
230     if ( multi_loop < 0 ) {
231         multi_loop = DEFAULT_MULTILOOP;
232     }
233
234     /* printf("updating flight model x %d\n", multi_loop); */
235     fgFlightModelUpdate(FG_LARCSIM, f, multi_loop);
236
237     for ( i = 0; i < multi_loop; i++ ) {
238         if ( fabs(goal_view_offset - view_offset) < 0.05 ) {
239             view_offset = goal_view_offset;
240             break;
241         } else {
242             /* move view_offset towards goal_view_offset */
243             if ( goal_view_offset > view_offset ) {
244                 if ( goal_view_offset - view_offset < FG_PI ) {
245                     view_offset += 0.01;
246                 } else {
247                     view_offset -= 0.01;
248                 }
249             } else {
250                 if ( view_offset - goal_view_offset < FG_PI ) {
251                     view_offset -= 0.01;
252                 } else {
253                     view_offset += 0.01;
254                 }
255             }
256             if ( view_offset > FG_2PI ) {
257                 view_offset -= FG_2PI;
258             } else if ( view_offset < 0 ) {
259                 view_offset += FG_2PI;
260             }
261         }
262     }
263 }
264
265
266 void fgInitTimeDepCalcs() {
267     /* initialize timer */
268
269 #ifdef USE_ITIMER
270     fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
271 #endif USE_ITIMER
272
273 }
274
275
276 /**************************************************************************
277  * Scenery management routines
278  **************************************************************************/
279
280 /* static void fgSceneryInit_OLD() { */
281     /* make scenery */
282 /*     scenery = fgSceneryCompile_OLD();
283     runway = fgRunwayHack_OLD(0.69, 53.07);
284 } */
285
286
287 /* create the scenery */
288 /* GLint fgSceneryCompile_OLD() {
289     GLint scenery;
290
291     scenery = mesh2GL(mesh_ptr_OLD);
292
293     return(scenery);
294 }
295 */
296
297 /* hack in a runway */
298 /* GLint fgRunwayHack_OLD(double width, double length) {
299     static GLfloat concrete[4] = { 0.5, 0.5, 0.5, 1.0 };
300     static GLfloat line[4]     = { 0.9, 0.9, 0.9, 1.0 };
301     int i;
302     int num_lines = 16;
303     float line_len, line_width_2, cur_pos;
304
305     runway = glGenLists(1);
306     glNewList(runway, GL_COMPILE);
307     */
308     /* draw concrete */
309 /*    glBegin(GL_POLYGON);
310     glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, concrete );
311     glNormal3f(0.0, 0.0, 1.0);
312
313     glVertex3d( 0.0,   -width/2.0, 0.0);
314     glVertex3d( 0.0,    width/2.0, 0.0);
315     glVertex3d(length,  width/2.0, 0.0);
316     glVertex3d(length, -width/2.0, 0.0);
317     glEnd();
318     */
319     /* draw center line */
320 /*    glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, line );
321     line_len = length / ( 2 * num_lines + 1);
322     printf("line_len = %.3f\n", line_len);
323     line_width_2 = 0.02;
324     cur_pos = line_len;
325     for ( i = 0; i < num_lines; i++ ) {
326         glBegin(GL_POLYGON);
327         glVertex3d( cur_pos, -line_width_2, 0.005);
328         glVertex3d( cur_pos,  line_width_2, 0.005);
329         cur_pos += line_len;
330         glVertex3d( cur_pos,  line_width_2, 0.005);
331         glVertex3d( cur_pos, -line_width_2, 0.005);
332         cur_pos += line_len;
333         glEnd();
334     }
335
336     glEndList();
337
338     return(runway);
339 }
340 */
341
342 /* draw the scenery */
343 /*static void fgSceneryDraw_OLD() {
344     static float z = 32.35;
345
346     glPushMatrix();
347
348     glCallList(scenery);
349
350     printf("*** Drawing runway at %.2f\n", z);
351
352     glTranslatef( -398391.28, 120070.41, 32.35);
353     glRotatef(170.0, 0.0, 0.0, 1.0);
354     glCallList(runway);
355
356     glPopMatrix();
357 }
358 */
359
360 /* What should we do when we have nothing else to do?  How about get
361  * ready for the next move and update the display? */
362 static void fgMainLoop( void ) {
363     static int remainder = 0;
364     int elapsed, multi_loop;
365     double rough_elev;
366     struct flight_params *f;
367
368     f = &current_aircraft.flight;
369
370     elapsed = fgGetTimeInterval();
371     printf("Time interval is = %d, previous remainder is = %d\n", elapsed, 
372            remainder);
373     printf("--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
374     elapsed += remainder;
375
376     multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
377     remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
378     printf("Model iterations needed = %d, new remainder = %d\n", multi_loop, 
379            remainder);
380
381     aircraft_debug(1);
382     fgUpdateVisuals();
383
384     if ( ! use_signals ) {
385         fgUpdateTimeDepCalcs(multi_loop);
386     }
387
388     /* I'm just sticking this here for now, it should probably move 
389      * eventually */
390     rough_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0, 
391                                FG_Latitude  * RAD_TO_DEG * 3600.0);
392     printf("Ground elevation is about %.2f meters here.\n", rough_elev);
393     /* FG_Runway_altitude = rough_elev * METER_TO_FEET; */
394
395     if ( FG_Altitude * FEET_TO_METER < rough_elev ) {
396         /* set this here, otherwise if we set runway height above our
397            current height we get a really nasty bounce. */
398         FG_Runway_altitude = FG_Altitude - 3.758099;
399
400         /* now set aircraft altitude above ground */
401         FG_Altitude = rough_elev * METER_TO_FEET + 3.758099;
402         printf("<*> resetting altitude to %.0f meters\n", 
403                FG_Altitude * FEET_TO_METER);
404     }
405
406     FG_U_gust = fg_random() * 1.0 - 0.5;
407     FG_V_gust = fg_random() * 1.0 - 0.5;
408     FG_W_gust = fg_random() * 1.0 - 0.5;
409 }
410
411
412 /**************************************************************************
413  * Handle new window size or exposure
414  **************************************************************************/
415
416 static void fgReshape( int width, int height ) {
417     /* Do this so we can call fgReshape(0,0) ourselves without having to know
418      * what the values of width & height are. */
419     if ( (height > 0) && (width > 0) ) {
420         win_ratio = (GLfloat) height / (GLfloat) width;
421     }
422
423     /* Inform gl of our view window size */
424     glViewport(0, 0, (GLint)width, (GLint)height);
425
426     fgUpdateViewParams();
427     
428     glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
429 }
430
431
432 /**************************************************************************
433  * Main ...
434  **************************************************************************/
435
436 int main( int argc, char *argv[] ) {
437     struct flight_params *f;
438     double rough_elev;
439
440     f = &current_aircraft.flight;
441
442     /* might as well do this first thing ... seed the random number generater */
443     fg_srandom();
444
445     printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");
446
447
448     /**********************************************************************
449      * Initialize the Window/Graphics environment.
450      **********************************************************************/
451
452     #ifdef GLUT
453       /* initialize GLUT */
454       glutInit(&argc, argv);
455
456       /* Define Display Parameters */
457       glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
458
459       /* Define initial window size */
460       glutInitWindowSize(640, 480);
461
462       /* Initialize the main window */
463       glutCreateWindow("Flight Gear");
464     #elif MESA_TK
465       /* Define initial window size */
466       tkInitPosition(0, 0, 640, 480);
467
468       /* Define Display Parameters */
469       tkInitDisplayMode( TK_RGB | TK_DEPTH | TK_DOUBLE | TK_DIRECT );
470
471       /* Initialize the main window */
472       if (tkInitWindow("Flight Gear") == GL_FALSE) {
473           tkQuit();
474       }
475     #endif
476
477     /* setup view parameters, only makes GL calls */
478     fgInitVisuals();
479
480
481     /****************************************************************
482      * The following section sets up the flight model EOM parameters and 
483      * should really be read in from one or more files.
484      ****************************************************************/
485
486     /* Globe Aiport, AZ */
487     FG_Runway_altitude = 3234.5;
488     FG_Runway_latitude = 120070.41;
489     FG_Runway_longitude = -398391.28;
490     FG_Runway_heading = 102.0 * DEG_TO_RAD;
491
492     /* Initial Position */
493     FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
494     FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
495     FG_Altitude = FG_Runway_altitude + 3.758099;
496
497     /* FG_Latitude  = 0.0; */
498     /* FG_Longitude = 0.0; */
499     /* FG_Altitude = 15000.0; */
500
501     printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude, 
502            FG_Longitude, FG_Altitude);
503
504       /* Initial Velocity */
505     FG_V_north = 0.0 /*  7.287719E+00 */;
506     FG_V_east  = 0.0 /*  1.521770E+03 */;
507     FG_V_down  = 0.0 /* -1.265722E-05 */;
508
509     /* Initial Orientation */
510     FG_Phi   = -2.658474E-06;
511     FG_Theta =  7.401790E-03;
512     FG_Psi   =  270.0 * DEG_TO_RAD;
513
514     /* Initial Angular B rates */
515     FG_P_body = 7.206685E-05;
516     FG_Q_body = 0.000000E+00;
517     FG_R_body = 9.492658E-05;
518
519     FG_Earth_position_angle = 0.000000E+00;
520
521     /* Mass properties and geometry values */
522     FG_Mass = 8.547270E+01;
523     FG_I_xx = 1.048000E+03;
524     FG_I_yy = 3.000000E+03;
525     FG_I_zz = 3.530000E+03;
526     FG_I_xz = 0.000000E+00;
527
528     /* CG position w.r.t. ref. point */
529     FG_Dx_cg = 0.000000E+00;
530     FG_Dy_cg = 0.000000E+00;
531     FG_Dz_cg = 0.000000E+00;
532
533     /* Configure some wind & turbulance */
534     FG_V_north_airmass = 15; /* ft/s =~ 10mph */
535
536     /* Set initial position and slew parameters */
537     /* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
538     /* fgSlewInit(-335340,162540, 15, 4.38); */
539     /* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
540
541    /* Initialize the Scenery Management system */
542     fgSceneryInit();
543
544     /* Tell the Scenery Management system where we are so it can load
545      * the correct scenery data */
546     fgSceneryUpdate(FG_Latitude, FG_Longitude, FG_Altitude);
547
548     /* I'm just sticking this here for now, it should probably move 
549      * eventually */
550     rough_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0, 
551                                FG_Latitude  * RAD_TO_DEG * 3600.0);
552     printf("Ground elevation is %.2f meters here.\n", rough_elev);
553     FG_Runway_altitude = rough_elev * METER_TO_FEET;
554
555     if ( FG_Altitude < FG_Runway_altitude ) {
556         FG_Altitude = FG_Runway_altitude + 3.758099;
557     }
558     /* end of thing that I just stuck in that I should probably move */
559
560     /* Initialize the flight model data structures base on above values */
561     fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
562
563     if ( use_signals ) {
564         /* init timer routines, signals, etc.  Arrange for an alarm
565            signal to be generated, etc. */
566         fgInitTimeDepCalcs();
567     }
568
569     /**********************************************************************
570      * Initialize the Event Handlers.
571      **********************************************************************/
572
573     #ifdef GLUT
574       /* call fgReshape() on window resizes */
575       glutReshapeFunc( fgReshape );
576
577       /* call key() on keyboard event */
578       glutKeyboardFunc( GLUTkey );
579       glutSpecialFunc( GLUTspecialkey );
580
581       /* call fgMainLoop() whenever there is nothing else to do */
582       glutIdleFunc( fgMainLoop );
583
584       /* draw the scene */
585       glutDisplayFunc( fgUpdateVisuals );
586
587       /* pass control off to the GLUT event handler */
588       glutMainLoop();
589     #elif MESA_TK
590       /* call fgReshape() on expose events */
591       tkExposeFunc( fgReshape );
592
593       /* call fgReshape() on window resizes */
594       tkReshapeFunc( fgReshape );
595
596       /* call key() on keyboard event */
597       tkKeyDownFunc( GLTKkey );
598
599       /* call fgMainLoop() whenever there is nothing else to do */
600       tkIdleFunc( fgMainLoop );
601
602       /* draw the scene */
603       tkDisplayFunc( fgUpdateVisuals );
604
605       /* pass control off to the tk event handler */
606       tkExec();
607     #endif
608
609     return(0);
610 }
611
612 #ifdef NO_PRINTF
613
614 #include <stdarg.h>
615 int printf (const char *format, ...) {
616 }
617
618 #endif
619
620
621 /* $Log$
622 /* Revision 1.37  1997/07/19 22:34:02  curt
623 /* Moved PI definitions to ../constants.h
624 /* Moved random() stuff to ../Utils/ and renamed fg_random()
625 /*
626  * Revision 1.36  1997/07/18 23:41:25  curt
627  * Tweaks for building with Cygnus Win32 compiler.
628  *
629  * Revision 1.35  1997/07/18 14:28:34  curt
630  * Hacked in some support for wind/turbulence.
631  *
632  * Revision 1.34  1997/07/16 20:04:48  curt
633  * Minor tweaks to aid Win32 port.
634  *
635  * Revision 1.33  1997/07/12 03:50:20  curt
636  * Added an #include <Windows32/Base.h> to help compiling for Win32
637  *
638  * Revision 1.32  1997/07/11 03:23:18  curt
639  * Solved some scenery display/orientation problems.  Still have a positioning
640  * (or transformation?) problem.
641  *
642  * Revision 1.31  1997/07/11 01:29:58  curt
643  * More tweaking of terrian floor.
644  *
645  * Revision 1.30  1997/07/10 04:26:37  curt
646  * We now can interpolated ground elevation for any position in the grid.  We
647  * can use this to enforce a "hard" ground.  We still need to enforce some
648  * bounds checking so that we don't try to lookup data points outside the
649  * grid data set.
650  *
651  * Revision 1.29  1997/07/09 21:31:12  curt
652  * Working on making the ground "hard."
653  *
654  * Revision 1.28  1997/07/08 18:20:12  curt
655  * Working on establishing a hard ground.
656  *
657  * Revision 1.27  1997/07/07 20:59:49  curt
658  * Working on scenery transformations to enable us to fly fluidly over the
659  * poles with no discontinuity/distortion in scenery.
660  *
661  * Revision 1.26  1997/07/05 20:43:34  curt
662  * renamed mat3 directory to Math so we could add other math related routines.
663  *
664  * Revision 1.25  1997/06/29 21:19:17  curt
665  * Working on scenery management system.
666  *
667  * Revision 1.24  1997/06/26 22:14:53  curt
668  * Beginning work on a scenery management system.
669  *
670  * Revision 1.23  1997/06/26 19:08:33  curt
671  * Restructuring make, adding automatic "make dep" support.
672  *
673  * Revision 1.22  1997/06/25 15:39:47  curt
674  * Minor changes to compile with rsxnt/win32.
675  *
676  * Revision 1.21  1997/06/22 21:44:41  curt
677  * Working on intergrating the VRML (subset) parser.
678  *
679  * Revision 1.20  1997/06/21 17:12:53  curt
680  * Capitalized subdirectory names.
681  *
682  * Revision 1.19  1997/06/18 04:10:31  curt
683  * A couple more runway tweaks ...
684  *
685  * Revision 1.18  1997/06/18 02:21:24  curt
686  * Hacked in a runway
687  *
688  * Revision 1.17  1997/06/17 16:51:58  curt
689  * Timer interval stuff now uses gettimeofday() instead of ftime()
690  *
691  * Revision 1.16  1997/06/17 04:19:16  curt
692  * More timer related tweaks with respect to view direction changes.
693  *
694  * Revision 1.15  1997/06/17 03:41:10  curt
695  * Nonsignal based interval timing is now working.
696  * This would be a good time to look at cleaning up the code structure a bit.
697  *
698  * Revision 1.14  1997/06/16 19:32:51  curt
699  * Starting to add general timer support.
700  *
701  * Revision 1.13  1997/06/02 03:40:06  curt
702  * A tiny bit more view tweaking.
703  *
704  * Revision 1.12  1997/06/02 03:01:38  curt
705  * Working on views (side, front, back, transitions, etc.)
706  *
707  * Revision 1.11  1997/05/31 19:16:25  curt
708  * Elevator trim added.
709  *
710  * Revision 1.10  1997/05/31 04:13:52  curt
711  * WE CAN NOW FLY!!!
712  *
713  * Continuing work on the LaRCsim flight model integration.
714  * Added some MSFS-like keyboard input handling.
715  *
716  * Revision 1.9  1997/05/30 19:27:01  curt
717  * The LaRCsim flight model is starting to look like it is working.
718  *
719  * Revision 1.8  1997/05/30 03:54:10  curt
720  * Made a bit more progress towards integrating the LaRCsim flight model.
721  *
722  * Revision 1.7  1997/05/29 22:39:49  curt
723  * Working on incorporating the LaRCsim flight model.
724  *
725  * Revision 1.6  1997/05/29 12:31:39  curt
726  * Minor tweaks, moving towards general flight model integration.
727  *
728  * Revision 1.5  1997/05/29 02:33:23  curt
729  * Updated to reflect changing interfaces in other "modules."
730  *
731  * Revision 1.4  1997/05/27 17:44:31  curt
732  * Renamed & rearranged variables and routines.   Added some initial simple
733  * timer/alarm routines so the flight model can be updated on a regular 
734  * interval.
735  *
736  * Revision 1.3  1997/05/23 15:40:25  curt
737  * Added GNU copyright headers.
738  * Fog now works!
739  *
740  * Revision 1.2  1997/05/23 00:35:12  curt
741  * Trying to get fog to work ...
742  *
743  * Revision 1.1  1997/05/21 15:57:51  curt
744  * Renamed due to added GLUT support.
745  *
746  * Revision 1.3  1997/05/19 18:22:42  curt
747  * Parameter tweaking ... starting to stub in fog support.
748  *
749  * Revision 1.2  1997/05/17 00:17:34  curt
750  * Trying to stub in support for standard OpenGL.
751  *
752  * Revision 1.1  1997/05/16 16:05:52  curt
753  * Initial revision.
754  *
755  */