1 /**************************************************************************
2 * GLmain.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 **************************************************************************/
38 #include "../constants.h"
40 #include "../Aircraft/aircraft.h"
41 #include "../Scenery/mesh.h"
42 #include "../Scenery/scenery.h"
43 #include "../Math/fg_geodesy.h"
44 #include "../Math/fg_random.h"
45 #include "../Math/mat3.h"
46 #include "../Math/polar.h"
47 #include "../Time/fg_time.h"
48 #include "../Time/fg_timer.h"
49 #include "../Time/sunpos.h"
50 #include "../Weather/weather.h"
53 /* This is a record containing all the info for the aircraft currently
55 struct aircraft_params current_aircraft;
58 static GLfloat win_ratio = 1.0;
61 static GLfloat sun_vec[4] = {1.0, 0.0, 0.0, 0.0 };
63 /* if the 4th field is 0.0, this specifies a direction ... */
64 /* clear color (sky) */
65 static GLfloat fgClearColor[4] = {0.60, 0.60, 0.90, 1.0};
67 static GLfloat fgFogColor[4] = {0.65, 0.65, 0.85, 1.0};
70 /* extern struct mesh *mesh_ptr; */
71 /* Function prototypes */
72 /* GLint fgSceneryCompile_OLD(); */
73 /* static void fgSceneryDraw_OLD(); */
75 /* pointer to scenery structure */
76 /* static GLint scenery, runway; */
79 double fogDensity = 60000.0; /* in meters */
80 double view_offset = 0.0;
81 double goal_view_offset = 0.0;
84 #define DEFAULT_TIMER_HZ 20
85 #define DEFAULT_MULTILOOP 6
86 #define DEFAULT_MODEL_HZ (DEFAULT_TIMER_HZ * DEFAULT_MULTILOOP)
94 /**************************************************************************
95 * fgInitVisuals() -- Initialize various GL/view parameters
96 **************************************************************************/
98 static void fgInitVisuals() {
99 glEnable( GL_DEPTH_TEST );
100 /* glFrontFace(GL_CW); */
101 glEnable( GL_CULL_FACE );
103 /* If enabled, normal vectors specified with glNormal are scaled
104 to unit length after transformation. See glNormal. */
105 glEnable( GL_NORMALIZE );
107 glLightfv( GL_LIGHT0, GL_POSITION, sun_vec );
108 glEnable( GL_LIGHTING );
109 glEnable( GL_LIGHT0 );
111 glShadeModel( GL_FLAT ); /* glShadeModel( GL_SMOOTH ); */
114 glFogi (GL_FOG_MODE, GL_LINEAR);
115 /* glFogf (GL_FOG_START, 1.0); */
116 glFogf (GL_FOG_END, fogDensity);
117 glFogfv (GL_FOG_COLOR, fgFogColor);
118 /* glFogf (GL_FOG_DENSITY, fogDensity); */
119 /* glHint (GL_FOG_HINT, GL_FASTEST); */
121 glClearColor(fgClearColor[0], fgClearColor[1], fgClearColor[2],
126 /**************************************************************************
127 * Update the view volume, position, and orientation
128 **************************************************************************/
130 static void fgUpdateViewParams() {
131 struct fgCartesianPoint view_pos /*, alt_up */;
132 struct flight_params *f;
133 struct time_params *t;
134 MAT3mat R, TMP, UP, LOCAL, VIEW;
135 MAT3vec vec, view_up, forward, view_forward, local_up, nup, nsun;
136 double sun_angle, temp, ambient, diffuse, sky;
137 GLfloat color[4] = { 1.0, 1.0, 0.50, 1.0 };
138 GLfloat amb[3], diff[3], fog[4], clear[4];
140 f = ¤t_aircraft.flight;
141 t = &cur_time_params;
143 /* Tell GL we are about to modify the projection parameters */
144 glMatrixMode(GL_PROJECTION);
146 gluPerspective(45.0, 1.0/win_ratio, 1.0, 200000.0);
148 glMatrixMode(GL_MODELVIEW);
151 /* calculate view position in current FG view coordinate system */
152 view_pos = fgPolarToCart(FG_Longitude, FG_Lat_geocentric,
153 FG_Radius_to_vehicle * FEET_TO_METER + 1.0);
154 view_pos.x -= scenery.center.x;
155 view_pos.y -= scenery.center.y;
156 view_pos.z -= scenery.center.z;
158 printf("View pos = %.4f, %.4f, %.4f\n", view_pos.x, view_pos.y, view_pos.z);
160 /* Derive the LOCAL aircraft rotation matrix (roll, pitch, yaw) */
161 MAT3_SET_VEC(vec, 0.0, 0.0, 1.0);
162 MAT3rotate(R, vec, FG_Phi);
163 /* printf("Roll matrix\n"); */
164 /* MAT3print(R, stdout); */
166 MAT3_SET_VEC(vec, 0.0, 1.0, 0.0);
167 /* MAT3mult_vec(vec, vec, R); */
168 MAT3rotate(TMP, vec, FG_Theta);
169 /* printf("Pitch matrix\n"); */
170 /* MAT3print(TMP, stdout); */
173 MAT3_SET_VEC(vec, 1.0, 0.0, 0.0);
174 /* MAT3mult_vec(vec, vec, R); */
175 /* MAT3rotate(TMP, vec, FG_Psi - FG_PI_2); */
176 MAT3rotate(TMP, vec, -FG_Psi);
177 /* printf("Yaw matrix\n");
178 MAT3print(TMP, stdout); */
179 MAT3mult(LOCAL, R, TMP);
180 /* printf("LOCAL matrix\n"); */
181 /* MAT3print(LOCAL, stdout); */
183 /* Derive the local UP transformation matrix based on *geodetic*
185 MAT3_SET_VEC(vec, 0.0, 0.0, 1.0);
186 MAT3rotate(R, vec, FG_Longitude); /* R = rotate about Z axis */
187 /* printf("Longitude matrix\n"); */
188 /* MAT3print(R, stdout); */
190 MAT3_SET_VEC(vec, 0.0, 1.0, 0.0);
191 MAT3mult_vec(vec, vec, R);
192 MAT3rotate(TMP, vec, -FG_Latitude); /* TMP = rotate about X axis */
193 /* printf("Latitude matrix\n"); */
194 /* MAT3print(TMP, stdout); */
196 MAT3mult(UP, R, TMP);
197 /* printf("Local up matrix\n"); */
198 /* MAT3print(UP, stdout); */
200 MAT3_SET_VEC(local_up, 1.0, 0.0, 0.0);
201 MAT3mult_vec(local_up, local_up, UP);
203 printf(" Local Up = (%.4f, %.4f, %.4f)\n", local_up[0], local_up[1],
206 /* Alternative method to Derive local up vector based on
207 * *geodetic* coordinates */
208 /* alt_up = fgPolarToCart(FG_Longitude, FG_Latitude, 1.0); */
209 /* printf(" Alt Up = (%.4f, %.4f, %.4f)\n",
210 alt_up.x, alt_up.y, alt_up.z); */
212 /* Derive the VIEW matrix */
213 MAT3mult(VIEW, LOCAL, UP);
214 /* printf("VIEW matrix\n"); */
215 /* MAT3print(VIEW, stdout); */
217 /* generate the current up, forward, and fwrd-view vectors */
218 MAT3_SET_VEC(vec, 1.0, 0.0, 0.0);
219 MAT3mult_vec(view_up, vec, VIEW);
221 MAT3_SET_VEC(vec, 0.0, 0.0, 1.0);
222 MAT3mult_vec(forward, vec, VIEW);
223 printf("Forward vector is (%.2f,%.2f,%.2f)\n", forward[0], forward[1],
226 MAT3rotate(TMP, view_up, view_offset);
227 MAT3mult_vec(view_forward, forward, TMP);
229 /* set up our view volume */
230 gluLookAt(view_pos.x, view_pos.y, view_pos.z,
231 view_pos.x + view_forward[0], view_pos.y + view_forward[1],
232 view_pos.z + view_forward[2],
233 view_up[0], view_up[1], view_up[2]);
235 /* set the sun position */
236 glLightfv( GL_LIGHT0, GL_POSITION, sun_vec );
238 /* calculate lighting parameters based on sun's relative angle to
240 MAT3_COPY_VEC(nup, local_up);
241 nsun[0] = t->fg_sunpos.x;
242 nsun[1] = t->fg_sunpos.y;
243 nsun[2] = t->fg_sunpos.z;
244 MAT3_NORMALIZE_VEC(nup, temp);
245 MAT3_NORMALIZE_VEC(nsun, temp);
247 sun_angle = acos(MAT3_DOT_PRODUCT(nup, nsun));
248 printf("SUN ANGLE relative to current location = %.3f rads.\n", sun_angle);
250 /* ya kind'a have to plot this to see the magic */
251 ambient = 0.4 * pow(2.4, -sun_angle*sun_angle*sun_angle*sun_angle/3.0);
252 diffuse = 0.4 * cos(0.6*sun_angle*sun_angle);
253 sky = 0.85 * pow(1.6, -sun_angle*sun_angle*sun_angle*sun_angle/2.0) + 0.15;
255 if ( ambient < 0.1 ) { ambient = 0.1; }
256 if ( diffuse < 0.0 ) { diffuse = 0.0; }
258 if ( sky < 0.0 ) { sky = 0.0; }
260 amb[0] = color[0] * ambient;
261 amb[1] = color[1] * ambient;
262 amb[2] = color[2] * ambient;
264 diff[0] = color[0] * diffuse;
265 diff[1] = color[1] * diffuse;
266 diff[2] = color[2] * diffuse;
268 /* set lighting parameters */
269 glLightfv(GL_LIGHT0, GL_AMBIENT, amb );
270 glLightfv(GL_LIGHT0, GL_DIFFUSE, diff );
273 fog[0] = fgFogColor[0] * (ambient + diffuse);
274 fog[1] = fgFogColor[1] * (ambient + diffuse);
275 fog[2] = fgFogColor[2] * (ambient + diffuse);
276 fog[3] = fgFogColor[3];
277 glFogfv (GL_FOG_COLOR, fog);
280 clear[0] = fgClearColor[0] * sky;
281 clear[1] = fgClearColor[1] * sky;
282 clear[2] = fgClearColor[2] * sky;
283 clear[3] = fgClearColor[3];
284 glClearColor(clear[0], clear[1], clear[2], clear[3]);
288 /**************************************************************************
289 * Update all Visuals (redraws anything graphics related)
290 **************************************************************************/
292 static void fgUpdateVisuals( void ) {
293 /* update view volume parameters */
294 fgUpdateViewParams();
296 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
298 /* Tell GL we are switching to model view parameters */
299 glMatrixMode(GL_MODELVIEW);
300 /* glLoadIdentity(); */
311 /**************************************************************************
312 * Update internal time dependent calculations (i.e. flight model)
313 **************************************************************************/
315 void fgUpdateTimeDepCalcs(int multi_loop) {
316 struct flight_params *f;
317 struct time_params *t;
320 f = ¤t_aircraft.flight;
321 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 /* refresh shared sun position and sun_vec */
334 /* the sun position has to be translated just like everything else */
335 sun_vec[0] = t->fg_sunpos.x - scenery.center.x;
336 sun_vec[1] = t->fg_sunpos.y - scenery.center.y;
337 sun_vec[2] = t->fg_sunpos.z - scenery.center.z;
338 /* make this a directional light source only */
341 /* update the view angle */
342 for ( i = 0; i < multi_loop; i++ ) {
343 if ( fabs(goal_view_offset - view_offset) < 0.05 ) {
344 view_offset = goal_view_offset;
347 /* move view_offset towards goal_view_offset */
348 if ( goal_view_offset > view_offset ) {
349 if ( goal_view_offset - view_offset < FG_PI ) {
355 if ( view_offset - goal_view_offset < FG_PI ) {
361 if ( view_offset > FG_2PI ) {
362 view_offset -= FG_2PI;
363 } else if ( view_offset < 0 ) {
364 view_offset += FG_2PI;
371 void fgInitTimeDepCalcs() {
372 /* initialize timer */
375 fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
381 /**************************************************************************
382 * Scenery management routines
383 **************************************************************************/
385 /* static void fgSceneryInit_OLD() { */
387 /* scenery = fgSceneryCompile_OLD();
388 runway = fgRunwayHack_OLD(0.69, 53.07);
392 /* create the scenery */
393 /* GLint fgSceneryCompile_OLD() {
396 scenery = mesh2GL(mesh_ptr_OLD);
402 /* hack in a runway */
403 /* GLint fgRunwayHack_OLD(double width, double length) {
404 static GLfloat concrete[4] = { 0.5, 0.5, 0.5, 1.0 };
405 static GLfloat line[4] = { 0.9, 0.9, 0.9, 1.0 };
408 float line_len, line_width_2, cur_pos;
410 runway = glGenLists(1);
411 glNewList(runway, GL_COMPILE);
414 /* glBegin(GL_POLYGON);
415 glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, concrete );
416 glNormal3f(0.0, 0.0, 1.0);
418 glVertex3d( 0.0, -width/2.0, 0.0);
419 glVertex3d( 0.0, width/2.0, 0.0);
420 glVertex3d(length, width/2.0, 0.0);
421 glVertex3d(length, -width/2.0, 0.0);
424 /* draw center line */
425 /* glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, line );
426 line_len = length / ( 2 * num_lines + 1);
427 printf("line_len = %.3f\n", line_len);
430 for ( i = 0; i < num_lines; i++ ) {
432 glVertex3d( cur_pos, -line_width_2, 0.005);
433 glVertex3d( cur_pos, line_width_2, 0.005);
435 glVertex3d( cur_pos, line_width_2, 0.005);
436 glVertex3d( cur_pos, -line_width_2, 0.005);
447 /* draw the scenery */
448 /*static void fgSceneryDraw_OLD() {
449 static float z = 32.35;
455 printf("*** Drawing runway at %.2f\n", z);
457 glTranslatef( -398391.28, 120070.41, 32.35);
458 glRotatef(170.0, 0.0, 0.0, 1.0);
465 /* What should we do when we have nothing else to do? How about get
466 * ready for the next move and update the display? */
467 static void fgMainLoop( void ) {
468 static int remainder = 0;
469 int elapsed, multi_loop;
471 struct flight_params *f;
473 f = ¤t_aircraft.flight;
475 elapsed = fgGetTimeInterval();
476 printf("Time interval is = %d, previous remainder is = %d\n", elapsed,
478 printf("--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
479 elapsed += remainder;
481 multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
482 remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
483 printf("Model iterations needed = %d, new remainder = %d\n", multi_loop,
489 if ( ! use_signals ) {
491 fgUpdateTimeDepCalcs(multi_loop);
494 /* I'm just sticking this here for now, it should probably move
496 rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
497 FG_Latitude * RAD_TO_ARCSEC);
498 printf("Ground elevation is %.2f meters here.\n", rough_elev);
499 /* FG_Runway_altitude = rough_elev * METER_TO_FEET; */
501 if ( FG_Altitude * FEET_TO_METER < rough_elev + 3.758099) {
502 /* set this here, otherwise if we set runway height above our
503 current height we get a really nasty bounce. */
504 FG_Runway_altitude = FG_Altitude - 3.758099;
506 /* now set aircraft altitude above ground */
507 FG_Altitude = rough_elev * METER_TO_FEET + 3.758099;
508 printf("<*> resetting altitude to %.0f meters\n",
509 FG_Altitude * FEET_TO_METER);
512 /* update the weather for our current position */
513 fgWeatherUpdate(FG_Longitude * RAD_TO_ARCSEC,
514 FG_Latitude * RAD_TO_ARCSEC,
515 FG_Altitude * FEET_TO_METER);
519 /**************************************************************************
520 * Handle new window size or exposure
521 **************************************************************************/
523 static void fgReshape( int width, int height ) {
524 /* Do this so we can call fgReshape(0,0) ourselves without having to know
525 * what the values of width & height are. */
526 if ( (height > 0) && (width > 0) ) {
527 win_ratio = (GLfloat) height / (GLfloat) width;
530 /* Inform gl of our view window size */
531 glViewport(0, 0, (GLint)width, (GLint)height);
533 fgUpdateViewParams();
535 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
539 /**************************************************************************
541 **************************************************************************/
543 int main( int argc, char *argv[] ) {
544 struct flight_params *f;
547 f = ¤t_aircraft.flight;
549 printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");
552 /**********************************************************************
553 * Initialize the Window/Graphics environment.
554 **********************************************************************/
557 /* initialize GLUT */
558 glutInit(&argc, argv);
560 /* Define Display Parameters */
561 glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
563 /* Define initial window size */
564 glutInitWindowSize(640, 480);
566 /* Initialize windows */
567 glutCreateWindow("Flight Gear");
570 /* seed the random number generater */
573 /* setup view parameters, only makes GL calls */
577 /****************************************************************
578 * The following section sets up the flight model EOM parameters and
579 * should really be read in from one or more files.
580 ****************************************************************/
582 /* Globe Aiport, AZ */
583 FG_Runway_altitude = 3234.5;
584 FG_Runway_latitude = 120070.41;
585 FG_Runway_longitude = -398391.28;
586 FG_Runway_heading = 102.0 * DEG_TO_RAD;
588 /* Initial Position at GLOBE airport */
589 FG_Latitude = ( 120070.41 / 3600.0 ) * DEG_TO_RAD;
590 FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
591 FG_Altitude = FG_Runway_altitude + 3.758099;
593 /* Initial Position north of the city of Globe */
594 /* FG_Latitude = ( 120625.64 / 3600.0 ) * DEG_TO_RAD; */
595 /* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
596 /* FG_Altitude = 0.0 + 3.758099; */
598 printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude,
599 FG_Longitude, FG_Altitude);
601 /* Initial Velocity */
602 FG_V_north = 0.0 /* 7.287719E+00 */;
603 FG_V_east = 0.0 /* 1.521770E+03 */;
604 FG_V_down = 0.0 /* -1.265722E-05 */;
606 /* Initial Orientation */
607 FG_Phi = -2.658474E-06;
608 FG_Theta = 7.401790E-03;
609 FG_Psi = 270.0 * DEG_TO_RAD;
610 /* FG_Psi = 0.0 * DEG_TO_RAD; */
612 /* Initial Angular B rates */
613 FG_P_body = 7.206685E-05;
614 FG_Q_body = 0.000000E+00;
615 FG_R_body = 9.492658E-05;
617 FG_Earth_position_angle = 0.000000E+00;
619 /* Mass properties and geometry values */
620 FG_Mass = 8.547270E+01;
621 FG_I_xx = 1.048000E+03;
622 FG_I_yy = 3.000000E+03;
623 FG_I_zz = 3.530000E+03;
624 FG_I_xz = 0.000000E+00;
626 /* CG position w.r.t. ref. point */
627 FG_Dx_cg = 0.000000E+00;
628 FG_Dy_cg = 0.000000E+00;
629 FG_Dz_cg = 0.000000E+00;
631 /* Set initial position and slew parameters */
632 /* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
633 /* fgSlewInit(-335340,162540, 15, 4.38); */
634 /* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
636 /* Initialize the Scenery Management system */
639 /* Tell the Scenery Management system where we are so it can load
640 * the correct scenery data */
641 fgSceneryUpdate(FG_Latitude, FG_Longitude, FG_Altitude);
643 /* I'm just sticking this here for now, it should probably move
645 rough_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0,
646 FG_Latitude * RAD_TO_DEG * 3600.0);
647 printf("Ground elevation is %.2f meters here.\n", rough_elev);
648 if ( rough_elev > -9990.0 ) {
649 FG_Runway_altitude = rough_elev * METER_TO_FEET;
652 if ( FG_Altitude < FG_Runway_altitude ) {
653 FG_Altitude = FG_Runway_altitude + 3.758099;
655 /* end of thing that I just stuck in that I should probably move */
657 /* Initialize the flight model data structures base on above values */
658 fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
661 /* init timer routines, signals, etc. Arrange for an alarm
662 signal to be generated, etc. */
663 fgInitTimeDepCalcs();
666 /* Initialize the weather modeling subsystem */
669 /**********************************************************************
670 * Initialize the Event Handlers.
671 **********************************************************************/
674 /* call fgReshape() on window resizes */
675 glutReshapeFunc( fgReshape );
677 /* call key() on keyboard event */
678 glutKeyboardFunc( GLUTkey );
679 glutSpecialFunc( GLUTspecialkey );
681 /* call fgMainLoop() whenever there is nothing else to do */
682 glutIdleFunc( fgMainLoop );
685 glutDisplayFunc( fgUpdateVisuals );
687 /* pass control off to the GLUT event handler */
697 int printf (const char *format, ...) {
703 /* Revision 1.8 1997/08/19 23:55:03 curt
704 /* Worked on better simulating real lighting.
706 * Revision 1.7 1997/08/16 12:22:38 curt
707 * Working on improving the lighting/shading.
709 * Revision 1.6 1997/08/13 20:24:56 curt
710 * Changes due to changing sunpos interface.
712 * Revision 1.5 1997/08/06 21:08:32 curt
713 * Sun position now *really* works (I think) ... I still have sun time warping
714 * code in place, probably should remove it soon.
716 * Revision 1.4 1997/08/06 15:41:26 curt
717 * Working on correct sun position.
719 * Revision 1.3 1997/08/06 00:24:22 curt
720 * Working on correct real time sun lighting.
722 * Revision 1.2 1997/08/04 20:25:15 curt
723 * Organizational tweaking.
725 * Revision 1.1 1997/08/02 18:45:00 curt
726 * Renamed GLmain.c GLUTmain.c
728 * Revision 1.43 1997/08/02 16:23:47 curt
731 * Revision 1.42 1997/08/01 19:43:33 curt
732 * Making progress with coordinate system overhaul.
734 * Revision 1.41 1997/07/31 22:52:37 curt
735 * Working on redoing internal coordinate systems & scenery transformations.
737 * Revision 1.40 1997/07/30 16:12:42 curt
738 * Moved fg_random routines from Util/ to Math/
740 * Revision 1.39 1997/07/21 14:45:01 curt
743 * Revision 1.38 1997/07/19 23:04:47 curt
744 * Added an initial weather section.
746 * Revision 1.37 1997/07/19 22:34:02 curt
747 * Moved PI definitions to ../constants.h
748 * Moved random() stuff to ../Utils/ and renamed fg_random()
750 * Revision 1.36 1997/07/18 23:41:25 curt
751 * Tweaks for building with Cygnus Win32 compiler.
753 * Revision 1.35 1997/07/18 14:28:34 curt
754 * Hacked in some support for wind/turbulence.
756 * Revision 1.34 1997/07/16 20:04:48 curt
757 * Minor tweaks to aid Win32 port.
759 * Revision 1.33 1997/07/12 03:50:20 curt
760 * Added an #include <Windows32/Base.h> to help compiling for Win32
762 * Revision 1.32 1997/07/11 03:23:18 curt
763 * Solved some scenery display/orientation problems. Still have a positioning
764 * (or transformation?) problem.
766 * Revision 1.31 1997/07/11 01:29:58 curt
767 * More tweaking of terrian floor.
769 * Revision 1.30 1997/07/10 04:26:37 curt
770 * We now can interpolated ground elevation for any position in the grid. We
771 * can use this to enforce a "hard" ground. We still need to enforce some
772 * bounds checking so that we don't try to lookup data points outside the
775 * Revision 1.29 1997/07/09 21:31:12 curt
776 * Working on making the ground "hard."
778 * Revision 1.28 1997/07/08 18:20:12 curt
779 * Working on establishing a hard ground.
781 * Revision 1.27 1997/07/07 20:59:49 curt
782 * Working on scenery transformations to enable us to fly fluidly over the
783 * poles with no discontinuity/distortion in scenery.
785 * Revision 1.26 1997/07/05 20:43:34 curt
786 * renamed mat3 directory to Math so we could add other math related routines.
788 * Revision 1.25 1997/06/29 21:19:17 curt
789 * Working on scenery management system.
791 * Revision 1.24 1997/06/26 22:14:53 curt
792 * Beginning work on a scenery management system.
794 * Revision 1.23 1997/06/26 19:08:33 curt
795 * Restructuring make, adding automatic "make dep" support.
797 * Revision 1.22 1997/06/25 15:39:47 curt
798 * Minor changes to compile with rsxnt/win32.
800 * Revision 1.21 1997/06/22 21:44:41 curt
801 * Working on intergrating the VRML (subset) parser.
803 * Revision 1.20 1997/06/21 17:12:53 curt
804 * Capitalized subdirectory names.
806 * Revision 1.19 1997/06/18 04:10:31 curt
807 * A couple more runway tweaks ...
809 * Revision 1.18 1997/06/18 02:21:24 curt
812 * Revision 1.17 1997/06/17 16:51:58 curt
813 * Timer interval stuff now uses gettimeofday() instead of ftime()
815 * Revision 1.16 1997/06/17 04:19:16 curt
816 * More timer related tweaks with respect to view direction changes.
818 * Revision 1.15 1997/06/17 03:41:10 curt
819 * Nonsignal based interval timing is now working.
820 * This would be a good time to look at cleaning up the code structure a bit.
822 * Revision 1.14 1997/06/16 19:32:51 curt
823 * Starting to add general timer support.
825 * Revision 1.13 1997/06/02 03:40:06 curt
826 * A tiny bit more view tweaking.
828 * Revision 1.12 1997/06/02 03:01:38 curt
829 * Working on views (side, front, back, transitions, etc.)
831 * Revision 1.11 1997/05/31 19:16:25 curt
832 * Elevator trim added.
834 * Revision 1.10 1997/05/31 04:13:52 curt
837 * Continuing work on the LaRCsim flight model integration.
838 * Added some MSFS-like keyboard input handling.
840 * Revision 1.9 1997/05/30 19:27:01 curt
841 * The LaRCsim flight model is starting to look like it is working.
843 * Revision 1.8 1997/05/30 03:54:10 curt
844 * Made a bit more progress towards integrating the LaRCsim flight model.
846 * Revision 1.7 1997/05/29 22:39:49 curt
847 * Working on incorporating the LaRCsim flight model.
849 * Revision 1.6 1997/05/29 12:31:39 curt
850 * Minor tweaks, moving towards general flight model integration.
852 * Revision 1.5 1997/05/29 02:33:23 curt
853 * Updated to reflect changing interfaces in other "modules."
855 * Revision 1.4 1997/05/27 17:44:31 curt
856 * Renamed & rearranged variables and routines. Added some initial simple
857 * timer/alarm routines so the flight model can be updated on a regular
860 * Revision 1.3 1997/05/23 15:40:25 curt
861 * Added GNU copyright headers.
864 * Revision 1.2 1997/05/23 00:35:12 curt
865 * Trying to get fog to work ...
867 * Revision 1.1 1997/05/21 15:57:51 curt
868 * Renamed due to added GLUT support.
870 * Revision 1.3 1997/05/19 18:22:42 curt
871 * Parameter tweaking ... starting to stub in fog support.
873 * Revision 1.2 1997/05/17 00:17:34 curt
874 * Trying to stub in support for standard OpenGL.
876 * Revision 1.1 1997/05/16 16:05:52 curt