1
0
Fork 0

Beginning work on a scenery management system.

This commit is contained in:
curt 1997-06-26 22:14:53 +00:00
parent 9205d3928b
commit 812700adda
4 changed files with 60 additions and 19 deletions

View file

@ -422,6 +422,11 @@ int main( int argc, char *argv[] ) {
printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n"); printf("Flight Gear: prototype code to test OpenGL, LaRCsim, and VRML\n\n");
/**********************************************************************
* Initialize the Window/Graphics environment.
**********************************************************************/
#ifdef GLUT #ifdef GLUT
/* initialize GLUT */ /* initialize GLUT */
glutInit(&argc, argv); glutInit(&argc, argv);
@ -450,6 +455,12 @@ int main( int argc, char *argv[] ) {
/* setup view parameters, only makes GL calls */ /* setup view parameters, only makes GL calls */
fgInitVisuals(); fgInitVisuals();
/****************************************************************
* The following section sets up the flight model EOM parameters and
* should really be read in from one or more files.
****************************************************************/
/* Globe Aiport, AZ */ /* Globe Aiport, AZ */
FG_Runway_altitude = 3234.5; FG_Runway_altitude = 3234.5;
FG_Runway_latitude = 120070.41; FG_Runway_latitude = 120070.41;
@ -464,7 +475,6 @@ int main( int argc, char *argv[] ) {
printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude, printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude,
FG_Longitude, FG_Altitude); FG_Longitude, FG_Altitude);
/* Initial Velocity */ /* Initial Velocity */
FG_V_north = 0.0 /* 7.287719E+00 */; FG_V_north = 0.0 /* 7.287719E+00 */;
FG_V_east = 0.0 /* 1.521770E+03 */; FG_V_east = 0.0 /* 1.521770E+03 */;
@ -499,6 +509,7 @@ int main( int argc, char *argv[] ) {
/* fgSlewInit(-335340,162540, 15, 4.38); */ /* fgSlewInit(-335340,162540, 15, 4.38); */
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */ /* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
/* Initialize the flight model data structures base on above values */
fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ ); fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
if ( use_signals ) { if ( use_signals ) {
@ -507,17 +518,25 @@ int main( int argc, char *argv[] ) {
fgInitTimeDepCalcs(); fgInitTimeDepCalcs();
} }
/* build all objects */
/* parse the scenery file, and build the OpenGL call list */ /**********************************************************************
/* this function will eventually move to the scenery management system */ * The following section (and the functions elsewhere in this file)
if ( strlen(argv[1]) ) { * set up the scenery management system. This part is a big hack,
parse_scenery(argv[1]); * and needs to be moved to it's own area.
} **********************************************************************/
/* initialize the scenery */ /* Initialize the Scenery Management system */
fgSceneryInit(); fgSceneryInit();
/* Tell the Scenery Management system where we are so it can load
* the correct scenery data */
fgSceneryUpdate(FG_Latitude, FG_Longitude, FG_Altitude);
/**********************************************************************
* Initialize the Event Handlers.
**********************************************************************/
#ifdef GLUT #ifdef GLUT
/* call fgReshape() on window resizes */ /* call fgReshape() on window resizes */
glutReshapeFunc( fgReshape ); glutReshapeFunc( fgReshape );
@ -559,9 +578,12 @@ int main( int argc, char *argv[] ) {
/* $Log$ /* $Log$
/* Revision 1.23 1997/06/26 19:08:33 curt /* Revision 1.24 1997/06/26 22:14:53 curt
/* Restructuring make, adding automatic "make dep" support. /* Beginning work on a scenery management system.
/* /*
* 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 * Revision 1.22 1997/06/25 15:39:47 curt
* Minor changes to compile with rsxnt/win32. * Minor changes to compile with rsxnt/win32.
* *

View file

@ -66,7 +66,7 @@ OFILES = $(CFILES:.c=.o)
AFILES = ../Aircraft/libAircraft.a ../Controls/libControls.a \ AFILES = ../Aircraft/libAircraft.a ../Controls/libControls.a \
../Flight/libFlight.a ../Flight/LaRCsim/libLaRCsim.a \ ../Flight/libFlight.a ../Flight/LaRCsim/libLaRCsim.a \
../Flight/Slew/libSlew.a ../mat3/libmat3.a \ ../Flight/Slew/libSlew.a ../mat3/libmat3.a \
../Scenery/ParseScn/libParseScn.a ../Scenery/libScenery.a \ ../Scenery/ParseVRML/libParseVRML.a ../Scenery/libScenery.a \
../Timer/libTimer.a ../Timer/libTimer.a
@ -107,6 +107,9 @@ mesh2GL.o:
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# $Log$ # $Log$
# Revision 1.17 1997/06/26 22:14:54 curt
# Beginning work on a scenery management system.
#
# Revision 1.16 1997/06/26 19:08:33 curt # Revision 1.16 1997/06/26 19:08:33 curt
# Restructuring make, adding automatic "make dep" support. # Restructuring make, adding automatic "make dep" support.
# #

View file

@ -26,7 +26,7 @@
TARGET = libScenery.a TARGET = libScenery.a
CFILES = common.c mesh.c CFILES = common.c mesh.c scenery.c
HFILES = HFILES =
OFILES = $(CFILES:.c=.o) OFILES = $(CFILES:.c=.o)
@ -66,9 +66,15 @@ common.o:
mesh.o: mesh.o:
$(CC) $(CFLAGS) -c mesh.c $(CC) $(CFLAGS) -c mesh.c
scenery.o:
$(CC) $(CFLAGS) -c scenery.c
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# $Log$ # $Log$
# Revision 1.11 1997/06/26 22:14:57 curt
# Beginning work on a scenery management system.
#
# Revision 1.10 1997/06/26 19:08:34 curt # Revision 1.10 1997/06/26 19:08:34 curt
# Restructuring make, adding automatic "make dep" support. # Restructuring make, adding automatic "make dep" support.
# #

View file

@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* scenery.h -- data structures and routines for processing terrain meshes * scenery.h -- data structures and routines for managing scenery.
* *
* Written by Curtis Olson, started May 1997. * Written by Curtis Olson, started May 1997.
* *
@ -28,17 +28,27 @@
#define SCENERY_H #define SCENERY_H
/* parse a scenery file */ /* Initialize the Scenery Management system */
int parse_scenery(char *file); void fgSceneryInit();
/* Tell the scenery manager where we are so it can load the proper data, and
* build the proper structures. */
void fgSceneryUpdate(double lon, double lat, double elev);
/* Render out the current scene */
void fgSceneryRender();
#endif SCENERY_H #endif SCENERY_H
/* $Log$ /* $Log$
/* Revision 1.4 1997/06/21 17:57:21 curt /* Revision 1.5 1997/06/26 22:14:57 curt
/* directory shuffling ... /* Beginning work on a scenery management system.
/* /*
* Revision 1.4 1997/06/21 17:57:21 curt
* directory shuffling ...
*
* Revision 1.2 1997/05/23 15:40:43 curt * Revision 1.2 1997/05/23 15:40:43 curt
* Added GNU copyright headers. * Added GNU copyright headers.
* *