* (Log is kept at end of this file)
**************************************************************************/
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "GLTKkey.h"
#endif
-#include "../aircraft/aircraft.h"
-#include "../scenery/scenery.h"
+#include "../Aircraft/aircraft.h"
+#include "../Scenery/scenery.h"
#include "../mat3/mat3.h"
-#include "../timer/fg_timer.h"
+#include "../Timer/fg_timer.h"
#define DEG_TO_RAD 0.017453292
#define RAD_TO_DEG 57.29577951
+#ifndef M_PI
+#define M_PI 3.14159265358979323846 /* pi */
+#endif
+
#ifndef PI2
#define PI2 (M_PI + M_PI)
#endif
+
+#ifndef M_PI_2
+#define M_PI_2 1.57079632679489661923 /* pi/2 */
+#endif
+
/* This is a record containing all the info for the aircraft currently
being operated */
struct aircraft_params current_aircraft;
/* Function prototypes */
GLint fgSceneryCompile();
static void fgSceneryDraw();
-/* pointer to terrain mesh structure */
-static GLint terrain, runway;
+
+/* pointer to scenery structure */
+static GLint scenery, runway;
/* Another hack */
double fogDensity = 2000.0;
glMatrixMode(GL_MODELVIEW);
/* glLoadIdentity(); */
- /* draw terrain mesh */
+ /* draw scenery */
fgSceneryDraw();
#ifdef GLUT
void fgInitTimeDepCalcs() {
/* initialize timer */
+
+#ifdef USE_ITIMER
fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
+#endif USE_ITIMER
+
}
**************************************************************************/
static void fgSceneryInit() {
- /* make terrain mesh */
- terrain = fgSceneryCompile();
+ /* make scenery */
+ scenery = fgSceneryCompile();
runway = fgRunwayHack(0.69, 53.07);
}
-/* create the terrain mesh */
+/* create the scenery */
GLint fgSceneryCompile() {
- GLint terrain;
+ GLint scenery;
- terrain = mesh2GL(mesh_ptr);
+ scenery = mesh2GL(mesh_ptr);
- return(terrain);
+ return(scenery);
}
static GLfloat concrete[4] = { 0.5, 0.5, 0.5, 1.0 };
static GLfloat line[4] = { 0.9, 0.9, 0.9, 1.0 };
int i;
- int num_lines = 8;
+ int num_lines = 16;
float line_len, line_width_2, cur_pos;
runway = glGenLists(1);
}
-/* draw the terrain mesh */
+/* draw the scenery */
static void fgSceneryDraw() {
static float z = 32.35;
- glCallList(terrain);
+ glPushMatrix();
+
+ glCallList(scenery);
- /* z -= 0.01; */
printf("*** Drawing runway at %.2f\n", z);
- glTranslatef( -398391.28, 120070.41, z);
+ glTranslatef( -398391.28, 120070.41, 32.35);
glRotatef(170.0, 0.0, 0.0, 1.0);
glCallList(runway);
+
+ glPopMatrix();
}
f = ¤t_aircraft.flight;
- /* parse the scenery file */
- parse_scenery(argv[1]);
+ printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");
#ifdef GLUT
/* initialize GLUT */
glutInitWindowSize(640, 480);
/* Initialize the main window */
- glutCreateWindow("Terrain Demo");
+ glutCreateWindow("Flight Gear");
#elif MESA_TK
/* Define initial window size */
tkInitPosition(0, 0, 640, 480);
tkInitDisplayMode( TK_RGB | TK_DEPTH | TK_DOUBLE | TK_DIRECT );
/* Initialize the main window */
- if (tkInitWindow("Terrain Demo") == GL_FALSE) {
+ if (tkInitWindow("Flight Gear") == GL_FALSE) {
tkQuit();
}
#endif
}
/* build all objects */
+
+ /* parse the scenery file, and build the OpenGL call list */
+ /* this function will eventually move to the scenery management system */
+ if ( strlen(argv[1]) ) {
+ parse_scenery(argv[1]);
+ }
+
+ /* initialize the scenery */
fgSceneryInit();
#ifdef GLUT
/* $Log$
-/* Revision 1.18 1997/06/18 02:21:24 curt
-/* Hacked in a runway
+/* Revision 1.23 1997/06/26 19:08:33 curt
+/* Restructuring make, adding automatic "make dep" support.
/*
+ * Revision 1.22 1997/06/25 15:39:47 curt
+ * Minor changes to compile with rsxnt/win32.
+ *
+ * Revision 1.21 1997/06/22 21:44:41 curt
+ * Working on intergrating the VRML (subset) parser.
+ *
+ * Revision 1.20 1997/06/21 17:12:53 curt
+ * Capitalized subdirectory names.
+ *
+ * Revision 1.19 1997/06/18 04:10:31 curt
+ * A couple more runway tweaks ...
+ *
+ * Revision 1.18 1997/06/18 02:21:24 curt
+ * Hacked in a runway
+ *
* Revision 1.17 1997/06/17 16:51:58 curt
* Timer interval stuff now uses gettimeofday() instead of ftime()
*