]> git.mxchange.org Git - flightgear.git/blob - Main/views.cxx
Add my own version of gluLookAt() (which is nearly identical to the
[flightgear.git] / Main / views.cxx
1 // views.cxx -- data structures and routines for managing and view
2 //               parameters.
3 //
4 // Written by Curtis Olson, started August 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 #ifdef HAVE_CONFIG_H
27 #  include <config.h>
28 #endif
29
30 #include <Debug/fg_debug.h>
31 #include <Flight/flight.h>
32 #include <Include/fg_constants.h>
33 #include <Math/mat3.h>
34 #include <Math/polar3d.h>
35 #include <Math/vector.h>
36 #include <Scenery/scenery.hxx>
37 #include <Time/fg_time.hxx>
38
39 #include "options.hxx"
40 #include "views.hxx"
41
42
43 // This is a record containing current view parameters
44 fgVIEW current_view;
45
46
47 // Constructor
48 fgVIEW::fgVIEW( void ) {
49 }
50
51
52 // Initialize a view structure
53 void fgVIEW::Init( void ) {
54     fgPrintf( FG_VIEW, FG_INFO, "Initializing View parameters\n");
55
56     view_offset = 0.0;
57     goal_view_offset = 0.0;
58
59     winWidth = 640;  // FG_DEFAULT_WIN_WIDTH
60     winHeight = 480; // FG_DEFAULT_WIN_HEIGHT
61     win_ratio = (double) winWidth / (double) winHeight;
62     update_fov = TRUE;
63 }
64
65
66 // Update the field of view parameters
67 void fgVIEW::UpdateFOV( fgOPTIONS *o ) {
68     double theta_x, theta_y;
69         
70     // printf("win_ratio = %.2f\n", win_ratio);
71     // calculate sin() and cos() of fov / 2 in X direction;
72     theta_x = (o->fov * win_ratio * DEG_TO_RAD) / 2.0;
73     // printf("theta_x = %.2f\n", theta_x);
74     sin_fov_x = sin(theta_x);
75     cos_fov_x = cos(theta_x);
76     slope_x =  - cos_fov_x / sin_fov_x;
77     // printf("slope_x = %.2f\n", slope_x);
78
79     // calculate sin() and cos() of fov / 2 in Y direction;
80     theta_y = (o->fov * DEG_TO_RAD) / 2.0;
81     // printf("theta_y = %.2f\n", theta_y);
82     sin_fov_y = sin(theta_y);
83     cos_fov_y = cos(theta_y);
84     slope_y = cos_fov_y / sin_fov_y;
85     // printf("slope_y = %.2f\n", slope_y);
86 }
87
88
89 // Update the view parameters
90 void fgVIEW::Update( fgFLIGHT *f ) {
91     fgOPTIONS *o;
92     fgPolarPoint3d p;
93     MAT3vec vec, forward, v0, minus_z;
94     MAT3mat R, TMP, UP, LOCAL, VIEW;
95     double ntmp;
96
97     o = &current_options;
98
99     if(update_fov == TRUE) {
100         // printf("Updating fov\n");
101         UpdateFOV(o);
102         update_fov = FALSE;
103     }
104                 
105     scenery.center.x = scenery.next_center.x;
106     scenery.center.y = scenery.next_center.y;
107     scenery.center.z = scenery.next_center.z;
108
109     // calculate the cartesion coords of the current lat/lon/0 elev
110     p.lon = FG_Longitude;
111     p.lat = FG_Lat_geocentric;
112     p.radius = FG_Sea_level_radius * FEET_TO_METER;
113
114     cur_zero_elev = fgPolarToCart3d(p);
115
116     cur_zero_elev.x -= scenery.center.x;
117     cur_zero_elev.y -= scenery.center.y;
118     cur_zero_elev.z -= scenery.center.z;
119
120     // calculate view position in current FG view coordinate system
121     // p.lon & p.lat are already defined earlier
122     p.radius = FG_Radius_to_vehicle * FEET_TO_METER + 1.0;
123
124     abs_view_pos = fgPolarToCart3d(p);
125
126     view_pos.x = abs_view_pos.x - scenery.center.x;
127     view_pos.y = abs_view_pos.y - scenery.center.y;
128     view_pos.z = abs_view_pos.z - scenery.center.z;
129
130     fgPrintf( FG_VIEW, FG_DEBUG, "Absolute view pos = %.4f, %.4f, %.4f\n", 
131            abs_view_pos.x, abs_view_pos.y, abs_view_pos.z);
132     fgPrintf( FG_VIEW, FG_DEBUG, "Relative view pos = %.4f, %.4f, %.4f\n", 
133            view_pos.x, view_pos.y, view_pos.z);
134
135     // Derive the LOCAL aircraft rotation matrix (roll, pitch, yaw)
136     // from FG_T_local_to_body[3][3]
137
138     // Question: Why is the LaRCsim matrix arranged so differently
139     // than the one we need???
140     LOCAL[0][0] = FG_T_local_to_body_33;
141     LOCAL[0][1] = -FG_T_local_to_body_32;
142     LOCAL[0][2] = -FG_T_local_to_body_31;
143     LOCAL[0][3] = 0.0;
144     LOCAL[1][0] = -FG_T_local_to_body_23;
145     LOCAL[1][1] = FG_T_local_to_body_22;
146     LOCAL[1][2] = FG_T_local_to_body_21;
147     LOCAL[1][3] = 0.0;
148     LOCAL[2][0] = -FG_T_local_to_body_13;
149     LOCAL[2][1] = FG_T_local_to_body_12;
150     LOCAL[2][2] = FG_T_local_to_body_11;
151     LOCAL[2][3] = 0.0;
152     LOCAL[3][0] = LOCAL[3][1] = LOCAL[3][2] = LOCAL[3][3] = 0.0;
153     LOCAL[3][3] = 1.0;
154     // printf("LaRCsim LOCAL matrix\n");
155     // MAT3print(LOCAL, stdout);
156
157 #ifdef OLD_LOCAL_TO_BODY_CODE
158         // old code to calculate LOCAL matrix calculated from Phi,
159         // Theta, and Psi (roll, pitch, yaw)
160
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); */
165
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); */
171         MAT3mult(R, R, TMP);
172
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("FG derived LOCAL matrix\n");
181         // MAT3print(LOCAL, stdout);
182 #endif // OLD_LOCAL_TO_BODY_CODE
183
184     // Derive the local UP transformation matrix based on *geodetic*
185     // coordinates
186     MAT3_SET_VEC(vec, 0.0, 0.0, 1.0);
187     MAT3rotate(R, vec, FG_Longitude);     // R = rotate about Z axis
188     // printf("Longitude matrix\n");
189     // MAT3print(R, stdout);
190
191     MAT3_SET_VEC(vec, 0.0, 1.0, 0.0);
192     MAT3mult_vec(vec, vec, R);
193     MAT3rotate(TMP, vec, -FG_Latitude);  // TMP = rotate about X axis
194     // printf("Latitude matrix\n");
195     // MAT3print(TMP, stdout);
196
197     MAT3mult(UP, R, TMP);
198     // printf("Local up matrix\n");
199     // MAT3print(UP, stdout);
200
201     MAT3_SET_VEC(local_up, 1.0, 0.0, 0.0);
202     MAT3mult_vec(local_up, local_up, UP);
203
204     // printf( "Local Up = (%.4f, %.4f, %.4f)\n",
205     //         local_up[0], local_up[1], local_up[2]);
206     
207     // Alternative method to Derive local up vector based on
208     // *geodetic* coordinates
209     // alt_up = fgPolarToCart(FG_Longitude, FG_Latitude, 1.0);
210     // printf( "    Alt Up = (%.4f, %.4f, %.4f)\n", 
211     //         alt_up.x, alt_up.y, alt_up.z);
212
213     // Calculate the VIEW matrix
214     MAT3mult(VIEW, LOCAL, UP);
215     // printf("VIEW matrix\n");
216     // MAT3print(VIEW, stdout);
217
218     // generate the current up, forward, and fwrd-view vectors
219     MAT3_SET_VEC(vec, 1.0, 0.0, 0.0);
220     MAT3mult_vec(view_up, vec, VIEW);
221
222     MAT3_SET_VEC(vec, 0.0, 0.0, 1.0);
223     MAT3mult_vec(forward, vec, VIEW);
224     // printf( "Forward vector is (%.2f,%.2f,%.2f)\n", forward[0], forward[1], 
225     //         forward[2]);
226
227     MAT3rotate(TMP, view_up, view_offset);
228     MAT3mult_vec(view_forward, forward, TMP);
229
230     // make a vector to the current view position
231     MAT3_SET_VEC(v0, view_pos.x, view_pos.y, view_pos.z);
232
233     // Given a vector pointing straight down (-Z), map into onto the
234     // local plane representing "horizontal".  This should give us the
235     // local direction for moving "south".
236     MAT3_SET_VEC(minus_z, 0.0, 0.0, -1.0);
237     map_vec_onto_cur_surface_plane(local_up, v0, minus_z, surface_south);
238     MAT3_NORMALIZE_VEC(surface_south, ntmp);
239     // printf( "Surface direction directly south %.2f %.2f %.2f\n",
240     //         surface_south[0], surface_south[1], surface_south[2]);
241
242     // now calculate the surface east vector
243     MAT3rotate(TMP, view_up, FG_PI_2);
244     MAT3mult_vec(surface_east, surface_south, TMP);
245     // printf( "Surface direction directly east %.2f %.2f %.2f\n",
246     //         surface_east[0], surface_east[1], surface_east[2]);
247     // printf( "Should be close to zero = %.2f\n", 
248     //         MAT3_DOT_PRODUCT(surface_south, surface_east));
249 }
250
251
252 // Update the "World to Eye" transformation matrix
253 // This is most useful for view frustum culling
254 void fgVIEW::UpdateWorldToEye( fgFLIGHT *f ) {
255     MAT3mat R_Phi, R_Theta, R_Psi, R_Lat, R_Lon, T_view;
256     MAT3mat TMP;
257     MAT3hvec vec;
258
259     // if we have a view offset use slow way for now
260     if(fabs(view_offset)>FG_EPSILON){ 
261         // Roll Matrix
262         MAT3_SET_HVEC(vec, 0.0, 0.0, -1.0, 1.0);
263         MAT3rotate(R_Phi, vec, FG_Phi);
264         // printf("Roll matrix (Phi)\n");
265         // MAT3print(R_Phi, stdout);
266
267         // Pitch Matrix
268         MAT3_SET_HVEC(vec, 1.0, 0.0, 0.0, 1.0);
269         MAT3rotate(R_Theta, vec, FG_Theta);
270         // printf("\nPitch matrix (Theta)\n");
271         // MAT3print(R_Theta, stdout);
272
273         // Yaw Matrix
274         MAT3_SET_HVEC(vec, 0.0, -1.0, 0.0, 1.0);
275         MAT3rotate(R_Psi, vec, FG_Psi + FG_PI - view_offset );
276         // printf("\nYaw matrix (Psi)\n");
277         // MAT3print(R_Psi, stdout);
278
279         // aircraft roll/pitch/yaw
280         MAT3mult(TMP, R_Phi, R_Theta);
281         MAT3mult(AIRCRAFT, TMP, R_Psi);
282
283     } else { // JUST USE LOCAL_TO_BODY  NHV 5/25/98
284         // hey this is even different then LOCAL[][] above ??
285          
286         AIRCRAFT[0][0] = -FG_T_local_to_body_22;
287         AIRCRAFT[0][1] = -FG_T_local_to_body_23;
288         AIRCRAFT[0][2] = FG_T_local_to_body_21;
289         AIRCRAFT[0][3] = 0.0;
290         AIRCRAFT[1][0] = FG_T_local_to_body_32;
291         AIRCRAFT[1][1] = FG_T_local_to_body_33;
292         AIRCRAFT[1][2] = -FG_T_local_to_body_31;
293         AIRCRAFT[1][3] = 0.0;
294         AIRCRAFT[2][0] = FG_T_local_to_body_12;
295         AIRCRAFT[2][1] = FG_T_local_to_body_13;
296         AIRCRAFT[2][2] = -FG_T_local_to_body_11;
297         AIRCRAFT[2][3] = 0.0;
298         AIRCRAFT[3][0] = AIRCRAFT[3][1] = AIRCRAFT[3][2] = AIRCRAFT[3][3] = 0.0;
299         AIRCRAFT[3][3] = 1.0;
300
301         // ??? SOMETHING LIKE THIS SHOULD WORK    NHV
302         // Rotate about LOCAL_UP  (AIRCRAFT[2][])
303         // MAT3_SET_HVEC(vec, AIRCRAFT[2][0], AIRCRAFT[2][1],
304         //                        AIRCRAFT[2][2], AIRCRAFT[2][3]);
305         // MAT3rotate(TMP, vec, FG_PI - view_offset );
306         // MAT3mult(AIRCRAFT, AIRCRAFT, TMP);
307     }
308     // printf("\naircraft roll pitch yaw\n");
309     // MAT3print(AIRCRAFT, stdout);
310
311     // View position in scenery centered coordinates
312     MAT3_SET_HVEC(vec, view_pos.x, view_pos.y, view_pos.z, 1.0);
313     MAT3translate(T_view, vec);
314     // printf("\nTranslation matrix\n");
315     // MAT3print(T_view, stdout);
316
317     // Latitude
318     MAT3_SET_HVEC(vec, 1.0, 0.0, 0.0, 1.0);
319     // R_Lat = rotate about X axis
320     MAT3rotate(R_Lat, vec, FG_Latitude);
321     // printf("\nLatitude matrix\n");
322     // MAT3print(R_Lat, stdout);
323
324     // Longitude
325     MAT3_SET_HVEC(vec, 0.0, 0.0, 1.0, 1.0);
326     // R_Lon = rotate about Z axis
327     MAT3rotate(R_Lon, vec, FG_Longitude - FG_PI_2 );
328     // printf("\nLongitude matrix\n");
329     // MAT3print(R_Lon, stdout);
330
331 #ifdef THIS_IS_OLD_CODE
332     // View position in scenery centered coordinates
333     MAT3_SET_HVEC(vec, view_pos.x, view_pos.y, view_pos.z, 1.0);
334     MAT3translate(T_view, vec);
335     // printf("\nTranslation matrix\n");
336     // MAT3print(T_view, stdout);
337
338     // aircraft roll/pitch/yaw
339     MAT3mult(TMP, R_Phi, R_Theta);
340     MAT3mult(AIRCRAFT, TMP, R_Psi);
341     // printf("\naircraft roll pitch yaw\n");
342     // MAT3print(AIRCRAFT, stdout);
343 #endif THIS_IS_OLD_CODE
344
345     // lon/lat
346     MAT3mult(WORLD, R_Lat, R_Lon);
347     // printf("\nworld\n");
348     // MAT3print(WORLD, stdout);
349
350     MAT3mult(EYE_TO_WORLD, AIRCRAFT, WORLD);
351     MAT3mult(EYE_TO_WORLD, EYE_TO_WORLD, T_view);
352     // printf("\nEye to world\n");
353     // MAT3print(EYE_TO_WORLD, stdout);
354
355     MAT3invert(WORLD_TO_EYE, EYE_TO_WORLD);
356     // printf("\nWorld to eye\n");
357     // MAT3print(WORLD_TO_EYE, stdout);
358
359     // printf( "\nview_pos = %.2f %.2f %.2f\n", 
360     //         view_pos.x, view_pos.y, view_pos.z );
361
362     // MAT3_SET_HVEC(eye, 0.0, 0.0, 0.0, 1.0);
363     // MAT3mult_vec(vec, eye, EYE_TO_WORLD);
364     // printf("\neye -> world = %.2f %.2f %.2f\n", vec[0], vec[1], vec[2]);
365
366     // MAT3_SET_HVEC(vec1, view_pos.x, view_pos.y, view_pos.z, 1.0);
367     // MAT3mult_vec(vec, vec1, WORLD_TO_EYE);
368     // printf( "\nabs_view_pos -> eye = %.2f %.2f %.2f\n", 
369     //         vec[0], vec[1], vec[2]);
370 }
371
372
373 // Destructor
374 fgVIEW::~fgVIEW( void ) {
375 }
376
377
378 // Basically, this is a modified version of the Mesa gluLookAt()
379 // function that's been modified slightly so we can capture the result
380 // before sending it off to OpenGL land.
381 void fg_gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
382                    GLdouble centerx, GLdouble centery, GLdouble centerz,
383                    GLdouble upx, GLdouble upy, GLdouble upz )
384 {
385     GLdouble *m;
386     GLdouble x[3], y[3], z[3];
387     GLdouble mag;
388
389     m = current_view.MODEL_VIEW;
390
391     /* Make rotation matrix */
392
393     /* Z vector */
394     z[0] = eyex - centerx;
395     z[1] = eyey - centery;
396     z[2] = eyez - centerz;
397     mag = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] );
398     if (mag) {  /* mpichler, 19950515 */
399         z[0] /= mag;
400         z[1] /= mag;
401         z[2] /= mag;
402     }
403
404     /* Y vector */
405     y[0] = upx;
406     y[1] = upy;
407     y[2] = upz;
408
409     /* X vector = Y cross Z */
410     x[0] =  y[1]*z[2] - y[2]*z[1];
411     x[1] = -y[0]*z[2] + y[2]*z[0];
412     x[2] =  y[0]*z[1] - y[1]*z[0];
413     
414     /* Recompute Y = Z cross X */
415     y[0] =  z[1]*x[2] - z[2]*x[1];
416     y[1] = -z[0]*x[2] + z[2]*x[0];
417     y[2] =  z[0]*x[1] - z[1]*x[0];
418
419     /* mpichler, 19950515 */
420     /* cross product gives area of parallelogram, which is < 1.0 for
421      * non-perpendicular unit-length vectors; so normalize x, y here
422      */
423
424     mag = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] );
425     if (mag) {
426         x[0] /= mag;
427         x[1] /= mag;
428       x[2] /= mag;
429     }
430
431     mag = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] );
432     if (mag) {
433         y[0] /= mag;
434         y[1] /= mag;
435         y[2] /= mag;
436     }
437
438 #define M(row,col)  m[col*4+row]
439     M(0,0) = x[0];  M(0,1) = x[1];  M(0,2) = x[2];  M(0,3) = 0.0;
440     M(1,0) = y[0];  M(1,1) = y[1];  M(1,2) = y[2];  M(1,3) = 0.0;
441     M(2,0) = z[0];  M(2,1) = z[1];  M(2,2) = z[2];  M(2,3) = 0.0;
442     M(3,0) = 0.0;   M(3,1) = 0.0;   M(3,2) = 0.0;   M(3,3) = 1.0;
443 #undef M
444
445     // Translate Eye to Origin
446     // replaces: glTranslated( -eyex, -eyey, -eyez );
447     m[12] = m[0] * -eyex + m[4] * -eyey + m[8]  * -eyez + m[12];
448     m[13] = m[1] * -eyex + m[5] * -eyey + m[9]  * -eyez + m[13];
449     m[14] = m[2] * -eyex + m[6] * -eyey + m[10] * -eyez + m[14];
450     m[15] = m[3] * -eyex + m[7] * -eyey + m[11] * -eyez + m[15];
451
452     // xglMultMatrixd( m );
453     xglLoadMatrixd( m );
454 }
455
456
457 // $Log$
458 // Revision 1.13  1998/07/04 00:52:27  curt
459 // Add my own version of gluLookAt() (which is nearly identical to the
460 // Mesa/glu version.)  But, by calculating the Model View matrix our selves
461 // we can save this matrix without having to read it back in from the video
462 // card.  This hopefully allows us to save a few cpu cycles when rendering
463 // out the fragments because we can just use glLoadMatrixd() with the
464 // precalculated matrix for each tile rather than doing a push(), translate(),
465 // pop() for every fragment.
466 //
467 // Panel status defaults to off for now until it gets a bit more developed.
468 //
469 // Extract OpenGL driver info on initialization.
470 //
471 // Revision 1.12  1998/06/03 00:47:15  curt
472 // Updated to compile in audio support if OSS available.
473 // Updated for new version of Steve's audio library.
474 // STL includes don't use .h
475 // Small view optimizations.
476 //
477 // Revision 1.11  1998/05/27 02:24:05  curt
478 // View optimizations by Norman Vine.
479 //
480 // Revision 1.10  1998/05/17 16:59:03  curt
481 // First pass at view frustum culling now operational.
482 //
483 // Revision 1.9  1998/05/16 13:08:37  curt
484 // C++ - ified views.[ch]xx
485 // Shuffled some additional view parameters into the fgVIEW class.
486 // Changed tile-radius to tile-diameter because it is a much better
487 //   name.
488 // Added a WORLD_TO_EYE transformation to views.cxx.  This allows us
489 //  to transform world space to eye space for view frustum culling.
490 //
491 // Revision 1.8  1998/05/02 01:51:01  curt
492 // Updated polartocart conversion routine.
493 //
494 // Revision 1.7  1998/04/30 12:34:20  curt
495 // Added command line rendering options:
496 //   enable/disable fog/haze
497 //   specify smooth/flat shading
498 //   disable sky blending and just use a solid color
499 //   enable wireframe drawing mode
500 //
501 // Revision 1.6  1998/04/28 01:20:23  curt
502 // Type-ified fgTIME and fgVIEW.
503 // Added a command line option to disable textures.
504 //
505 // Revision 1.5  1998/04/26 05:10:04  curt
506 // "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
507 //
508 // Revision 1.4  1998/04/25 22:04:53  curt
509 // Use already calculated LaRCsim values to create the roll/pitch/yaw
510 // transformation matrix (we call it LOCAL)
511 //
512 // Revision 1.3  1998/04/25 20:24:02  curt
513 // Cleaned up initialization sequence to eliminate interdependencies
514 // between sun position, lighting, and view position.  This creates a
515 // valid single pass initialization path.
516 //
517 // Revision 1.2  1998/04/24 00:49:22  curt
518 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
519 // Trying out some different option parsing code.
520 // Some code reorganization.
521 //
522 // Revision 1.1  1998/04/22 13:25:45  curt
523 // C++ - ifing the code.
524 // Starting a bit of reorganization of lighting code.
525 //
526 // Revision 1.16  1998/04/18 04:11:29  curt
527 // Moved fg_debug to it's own library, added zlib support.
528 //
529 // Revision 1.15  1998/02/20 00:16:24  curt
530 // Thursday's tweaks.
531 //
532 // Revision 1.14  1998/02/09 15:07:50  curt
533 // Minor tweaks.
534 //
535 // Revision 1.13  1998/02/07 15:29:45  curt
536 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
537 // <chotchkiss@namg.us.anritsu.com>
538 //
539 // Revision 1.12  1998/01/29 00:50:28  curt
540 // Added a view record field for absolute x, y, z position.
541 //
542 // Revision 1.11  1998/01/27 00:47:58  curt
543 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
544 // system and commandline/config file processing code.
545 //
546 // Revision 1.10  1998/01/19 19:27:09  curt
547 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
548 // This should simplify things tremendously.
549 //
550 // Revision 1.9  1998/01/13 00:23:09  curt
551 // Initial changes to support loading and management of scenery tiles.  Note,
552 // there's still a fair amount of work left to be done.
553 //
554 // Revision 1.8  1997/12/30 22:22:33  curt
555 // Further integration of event manager.
556 //
557 // Revision 1.7  1997/12/30 20:47:45  curt
558 // Integrated new event manager with subsystem initializations.
559 //
560 // Revision 1.6  1997/12/22 04:14:32  curt
561 // Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
562 //
563 // Revision 1.5  1997/12/18 04:07:02  curt
564 // Worked on properly translating and positioning the sky dome.
565 //
566 // Revision 1.4  1997/12/17 23:13:36  curt
567 // Began working on rendering a sky.
568 //
569 // Revision 1.3  1997/12/15 23:54:50  curt
570 // Add xgl wrappers for debugging.
571 // Generate terrain normals on the fly.
572 //
573 // Revision 1.2  1997/12/10 22:37:48  curt
574 // Prepended "fg" on the name of all global structures that didn't have it yet.
575 // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
576 //
577 // Revision 1.1  1997/08/27 21:31:17  curt
578 // Initial revision.
579 //