C++ - ifing the code.
Starting a bit of reorganization of lighting code.
This commit is contained in:
parent
73ed3c180e
commit
920eefd4a7
10 changed files with 139 additions and 107 deletions
|
@ -35,16 +35,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <Debug/fg_debug.h>
|
|
||||||
#include <Main/GLUTkey.h>
|
|
||||||
#include <Main/views.h>
|
|
||||||
|
|
||||||
#include <Include/fg_constants.h>
|
|
||||||
|
|
||||||
#include <Aircraft/aircraft.h>
|
#include <Aircraft/aircraft.h>
|
||||||
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
|
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
|
||||||
|
#include <Debug/fg_debug.h>
|
||||||
|
#include <Include/fg_constants.h>
|
||||||
#include <Weather/weather.h>
|
#include <Weather/weather.h>
|
||||||
|
|
||||||
|
#include "GLUTkey.hxx"
|
||||||
|
#include "views.hxx"
|
||||||
|
|
||||||
|
|
||||||
extern int show_hud; /* HUD state */
|
extern int show_hud; /* HUD state */
|
||||||
extern int displayInstruments;
|
extern int displayInstruments;
|
||||||
|
@ -257,9 +256,13 @@ void GLUTspecialkey(int k, int x, int y) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.33 1998/04/18 04:11:25 curt
|
/* Revision 1.1 1998/04/22 13:25:40 curt
|
||||||
/* Moved fg_debug to it's own library, added zlib support.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.33 1998/04/18 04:11:25 curt
|
||||||
|
* Moved fg_debug to it's own library, added zlib support.
|
||||||
|
*
|
||||||
* Revision 1.32 1998/04/14 02:21:01 curt
|
* Revision 1.32 1998/04/14 02:21:01 curt
|
||||||
* Incorporated autopilot heading hold contributed by: Jeff Goeke-Smith
|
* Incorporated autopilot heading hold contributed by: Jeff Goeke-Smith
|
||||||
* <jgoeke@voyager.net>
|
* <jgoeke@voyager.net>
|
|
@ -28,8 +28,8 @@
|
||||||
#define _GLUTKEY_H
|
#define _GLUTKEY_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifndef __cplusplus
|
||||||
extern "C" {
|
# error This library requires C++
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,23 +42,23 @@ extern "C" {
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <XGL/xgl.h>
|
#include <XGL/xgl.h>
|
||||||
|
|
||||||
|
|
||||||
/* Handle keyboard events */
|
/* Handle keyboard events */
|
||||||
void GLUTkey(unsigned char k, int x, int y);
|
void GLUTkey(unsigned char k, int x, int y);
|
||||||
void GLUTspecialkey(int k, int x, int y);
|
void GLUTspecialkey(int k, int x, int y);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _GLUTKEY_H */
|
#endif /* _GLUTKEY_H */
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.9 1998/04/21 17:02:36 curt
|
/* Revision 1.1 1998/04/22 13:25:41 curt
|
||||||
/* Prepairing for C++ integration.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.9 1998/04/21 17:02:36 curt
|
||||||
|
* Prepairing for C++ integration.
|
||||||
|
*
|
||||||
* Revision 1.8 1998/04/03 22:09:02 curt
|
* Revision 1.8 1998/04/03 22:09:02 curt
|
||||||
* Converting to Gnu autoconf system.
|
* Converting to Gnu autoconf system.
|
||||||
*
|
*
|
|
@ -40,35 +40,35 @@
|
||||||
# include <getopt.h>
|
# include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Debug/fg_debug.h>
|
|
||||||
#include <Main/GLUTkey.h>
|
|
||||||
#include <Main/fg_init.h>
|
|
||||||
#include <Main/fg_getopt.h>
|
|
||||||
#include <Main/views.h>
|
|
||||||
|
|
||||||
#include <Include/cmdargs.h> // Line to command line arguments
|
#include <Include/cmdargs.h> // Line to command line arguments
|
||||||
#include <Include/fg_constants.h> // for VERSION
|
#include <Include/fg_constants.h> // for VERSION
|
||||||
#include <Include/general.h>
|
#include <Include/general.h>
|
||||||
|
|
||||||
#include <Aircraft/aircraft.h>
|
#include <Aircraft/aircraft.h>
|
||||||
#include <Astro/moon.h>
|
#include <Astro/moon.hxx>
|
||||||
#include <Astro/planets.h>
|
#include <Astro/planets.hxx>
|
||||||
#include <Astro/sky.h>
|
#include <Astro/sky.hxx>
|
||||||
#include <Astro/stars.h>
|
#include <Astro/stars.hxx>
|
||||||
#include <Astro/sun.h>
|
#include <Astro/sun.hxx>
|
||||||
#include <Cockpit/cockpit.h>
|
#include <Cockpit/cockpit.h>
|
||||||
|
#include <Debug/fg_debug.h>
|
||||||
#include <Joystick/joystick.h>
|
#include <Joystick/joystick.h>
|
||||||
#include <Math/fg_geodesy.h>
|
#include <Math/fg_geodesy.h>
|
||||||
#include <Math/mat3.h>
|
#include <Math/mat3.h>
|
||||||
#include <Math/polar.h>
|
#include <Math/polar.h>
|
||||||
#include <Scenery/scenery.h>
|
#include <Scenery/scenery.h>
|
||||||
#include <Scenery/tilemgr.h>
|
#include <Scenery/tilemgr.hxx>
|
||||||
#include <Time/event.h>
|
#include <Time/event.h>
|
||||||
#include <Time/fg_time.h>
|
#include <Time/fg_time.h>
|
||||||
#include <Time/fg_timer.h>
|
#include <Time/fg_timer.h>
|
||||||
#include <Time/sunpos.h>
|
#include <Time/sunpos.hxx>
|
||||||
#include <Weather/weather.h>
|
#include <Weather/weather.h>
|
||||||
|
|
||||||
|
#include "GLUTkey.hxx"
|
||||||
|
#include "fg_init.hxx"
|
||||||
|
#include "fg_getopt.h"
|
||||||
|
#include "views.hxx"
|
||||||
|
|
||||||
|
|
||||||
// This is a record containing global housekeeping information
|
// This is a record containing global housekeeping information
|
||||||
fgGENERAL general;
|
fgGENERAL general;
|
||||||
|
@ -777,6 +777,10 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.2 1998/04/22 13:25:41 curt
|
||||||
|
// C++ - ifing the code.
|
||||||
|
// Starting a bit of reorganization of lighting code.
|
||||||
|
//
|
||||||
// Revision 1.1 1998/04/21 17:02:39 curt
|
// Revision 1.1 1998/04/21 17:02:39 curt
|
||||||
// Prepairing for C++ integration.
|
// Prepairing for C++ integration.
|
||||||
//
|
//
|
||||||
|
|
|
@ -5,12 +5,12 @@ bin_PROGRAMS = fg
|
||||||
bin_SCRIPTS = runfg runfg.bat
|
bin_SCRIPTS = runfg runfg.bat
|
||||||
|
|
||||||
fg_SOURCES = \
|
fg_SOURCES = \
|
||||||
GLUTkey.c GLUTkey.h \
|
GLUTkey.cxx GLUTkey.hxx \
|
||||||
GLUTmain.cxx \
|
GLUTmain.cxx \
|
||||||
fg_config.h \
|
fg_config.h \
|
||||||
fg_getopt.c fg_getopt.h \
|
fg_getopt.c fg_getopt.h \
|
||||||
fg_init.c fg_init.h \
|
fg_init.cxx fg_init.hxx \
|
||||||
views.c views.h
|
views.cxx views.hxx
|
||||||
|
|
||||||
fg_LDADD = \
|
fg_LDADD = \
|
||||||
$(top_builddir)/Simulator/Aircraft/libAircraft.la \
|
$(top_builddir)/Simulator/Aircraft/libAircraft.la \
|
||||||
|
|
|
@ -78,12 +78,12 @@ bin_PROGRAMS = fg
|
||||||
bin_SCRIPTS = runfg runfg.bat
|
bin_SCRIPTS = runfg runfg.bat
|
||||||
|
|
||||||
fg_SOURCES = \
|
fg_SOURCES = \
|
||||||
GLUTkey.c GLUTkey.h \
|
GLUTkey.cxx GLUTkey.hxx \
|
||||||
GLUTmain.cxx \
|
GLUTmain.cxx \
|
||||||
fg_config.h \
|
fg_config.h \
|
||||||
fg_getopt.c fg_getopt.h \
|
fg_getopt.c fg_getopt.h \
|
||||||
fg_init.c fg_init.h \
|
fg_init.cxx fg_init.hxx \
|
||||||
views.c views.h
|
views.cxx views.hxx
|
||||||
|
|
||||||
fg_LDADD = \
|
fg_LDADD = \
|
||||||
$(top_builddir)/Simulator/Aircraft/libAircraft.la \
|
$(top_builddir)/Simulator/Aircraft/libAircraft.la \
|
||||||
|
|
|
@ -122,17 +122,23 @@ extern int getargs(int argc, char *argv[],int num_opt, Option ** optarr,
|
||||||
|
|
||||||
extern void print_desc(int num_opt, Option **optarr); // Not original code
|
extern void print_desc(int num_opt, Option **optarr); // Not original code
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1998/04/21 17:02:41 curt
|
/* Revision 1.3 1998/04/22 13:25:43 curt
|
||||||
/* Prepairing for C++ integration.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1998/04/21 17:02:41 curt
|
||||||
|
* Prepairing for C++ integration.
|
||||||
|
*
|
||||||
* Revision 1.1 1998/02/13 00:23:39 curt
|
* Revision 1.1 1998/02/13 00:23:39 curt
|
||||||
* Initial revision.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
|
|
|
@ -26,34 +26,37 @@
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <Main/fg_init.h>
|
|
||||||
#include <Main/views.h>
|
|
||||||
|
|
||||||
#include <Include/cmdargs.h>
|
#include <Include/cmdargs.h>
|
||||||
#include <Include/fg_constants.h>
|
#include <Include/fg_constants.h>
|
||||||
#include <Include/general.h>
|
#include <Include/general.h>
|
||||||
|
|
||||||
#include <Aircraft/aircraft.h>
|
#include <Aircraft/aircraft.h>
|
||||||
#include <Astro/moon.h>
|
#include <Astro/moon.hxx>
|
||||||
#include <Astro/planets.h>
|
#include <Astro/planets.hxx>
|
||||||
#include <Astro/sky.h>
|
#include <Astro/sky.hxx>
|
||||||
#include <Astro/stars.h>
|
#include <Astro/stars.hxx>
|
||||||
#include <Astro/sun.h>
|
#include <Astro/sun.hxx>
|
||||||
#include <Autopilot/autopilot.h>
|
#include <Autopilot/autopilot.h>
|
||||||
#include <Cockpit/cockpit.h>
|
#include <Cockpit/cockpit.h>
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <Joystick/joystick.h>
|
#include <Joystick/joystick.h>
|
||||||
#include <Math/fg_random.h>
|
#include <Math/fg_random.h>
|
||||||
#include <Scenery/scenery.h>
|
#include <Scenery/scenery.h>
|
||||||
#include <Scenery/tilemgr.h>
|
#include <Scenery/tilemgr.hxx>
|
||||||
#include <Time/event.h>
|
#include <Time/event.h>
|
||||||
#include <Time/fg_time.h>
|
#include <Time/fg_time.h>
|
||||||
#include <Time/sunpos.h>
|
#include <Time/light.hxx>
|
||||||
|
#include <Time/sunpos.hxx>
|
||||||
#include <Weather/weather.h>
|
#include <Weather/weather.h>
|
||||||
|
|
||||||
|
#include "fg_init.hxx"
|
||||||
|
#include "views.hxx"
|
||||||
|
|
||||||
extern int show_hud; /* HUD state */
|
extern int show_hud; /* HUD state */
|
||||||
extern int displayInstruments;
|
extern int displayInstruments;
|
||||||
extern const char *default_root;
|
extern const char *default_root;
|
||||||
|
@ -102,7 +105,7 @@ int fgInitSubsystems( void ) {
|
||||||
double cur_elev;
|
double cur_elev;
|
||||||
|
|
||||||
// Ok will be flagged only if we get EVERYTHING done.
|
// Ok will be flagged only if we get EVERYTHING done.
|
||||||
int ret_val = 1 /* TRUE */;
|
int ret_val = 1 /* TRUE */;
|
||||||
|
|
||||||
fgFLIGHT *f;
|
fgFLIGHT *f;
|
||||||
struct fgLIGHT *l;
|
struct fgLIGHT *l;
|
||||||
|
@ -121,8 +124,8 @@ int fgInitSubsystems( void ) {
|
||||||
* should really be read in from one or more files.
|
* should really be read in from one or more files.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
/* Must happen before any of the flight model or control
|
// Must happen before any of the flight model or control
|
||||||
* parameters are set */
|
// parameters are set
|
||||||
|
|
||||||
fgAircraftInit(); // In the future this might not be the case.
|
fgAircraftInit(); // In the future this might not be the case.
|
||||||
f = current_aircraft.flight;
|
f = current_aircraft.flight;
|
||||||
|
@ -238,69 +241,76 @@ int fgInitSubsystems( void ) {
|
||||||
FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
|
FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG,
|
||||||
FG_Altitude * FEET_TO_METER);
|
FG_Altitude * FEET_TO_METER);
|
||||||
|
|
||||||
/* 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 */;
|
||||||
FG_V_down = 0.0 /* -1.265722E-05 */;
|
FG_V_down = 0.0 /* -1.265722E-05 */;
|
||||||
|
|
||||||
/* Initial Orientation */
|
// Initial Orientation
|
||||||
FG_Phi = -2.658474E-06;
|
FG_Phi = -2.658474E-06;
|
||||||
FG_Theta = 7.401790E-03;
|
FG_Theta = 7.401790E-03;
|
||||||
FG_Psi = 260.0 * DEG_TO_RAD;
|
FG_Psi = 270.0 * DEG_TO_RAD;
|
||||||
|
|
||||||
/* Initial Angular B rates */
|
// Initial Angular B rates
|
||||||
FG_P_body = 7.206685E-05;
|
FG_P_body = 7.206685E-05;
|
||||||
FG_Q_body = 0.000000E+00;
|
FG_Q_body = 0.000000E+00;
|
||||||
FG_R_body = 9.492658E-05;
|
FG_R_body = 9.492658E-05;
|
||||||
|
|
||||||
FG_Earth_position_angle = 0.000000E+00;
|
FG_Earth_position_angle = 0.000000E+00;
|
||||||
|
|
||||||
/* Mass properties and geometry values */
|
// Mass properties and geometry values
|
||||||
FG_Mass = 8.547270E+01;
|
FG_Mass = 8.547270E+01;
|
||||||
FG_I_xx = 1.048000E+03;
|
FG_I_xx = 1.048000E+03;
|
||||||
FG_I_yy = 3.000000E+03;
|
FG_I_yy = 3.000000E+03;
|
||||||
FG_I_zz = 3.530000E+03;
|
FG_I_zz = 3.530000E+03;
|
||||||
FG_I_xz = 0.000000E+00;
|
FG_I_xz = 0.000000E+00;
|
||||||
|
|
||||||
/* CG position w.r.t. ref. point */
|
// CG position w.r.t. ref. point
|
||||||
FG_Dx_cg = 0.000000E+00;
|
FG_Dx_cg = 0.000000E+00;
|
||||||
FG_Dy_cg = 0.000000E+00;
|
FG_Dy_cg = 0.000000E+00;
|
||||||
FG_Dz_cg = 0.000000E+00;
|
FG_Dz_cg = 0.000000E+00;
|
||||||
|
|
||||||
/* Set initial position and slew parameters */
|
// Set initial position and slew parameters
|
||||||
/* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
|
// fgSlewInit(-398391.3, 120070.41, 244, 3.1415); // GLOBE Airport
|
||||||
/* 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 event manager */
|
// Initialize the event manager
|
||||||
fgEventInit();
|
fgEventInit();
|
||||||
|
|
||||||
/* Dump event stats every 60 seconds */
|
// Dump event stats every 60 seconds
|
||||||
fgEventRegister( "fgEventPrintStats()", fgEventPrintStats,
|
fgEventRegister( "fgEventPrintStats()", fgEventPrintStats,
|
||||||
FG_EVENT_READY, 60000 );
|
FG_EVENT_READY, 60000 );
|
||||||
|
|
||||||
/* Initialize "time" */
|
// Initialize "time"
|
||||||
fgTimeInit(t);
|
fgTimeInit(t);
|
||||||
fgTimeUpdate(f, t);
|
fgTimeUpdate(f, t);
|
||||||
|
|
||||||
/* fgViewUpdate() needs the sun in the right place, while
|
// fgViewUpdate() needs the sun in the right place, while
|
||||||
* fgUpdateSunPos() needs to know the view position. I'll get
|
// fgUpdateSunPos() needs to know the view position. I'll get
|
||||||
* around this interdependency for now by calling fgUpdateSunPos()
|
// around this interdependency for now by calling fgUpdateSunPos()
|
||||||
* once, then moving on with normal initialization. */
|
// once, then moving on with normal initialization.
|
||||||
fgUpdateSunPos();
|
fgUpdateSunPos();
|
||||||
|
|
||||||
/* Initialize view parameters */
|
// Initialize view parameters
|
||||||
fgViewInit(v);
|
fgViewInit(v);
|
||||||
fgViewUpdate(f, v, l);
|
fgViewUpdate(f, v, l);
|
||||||
|
|
||||||
/* Initialize the weather modeling subsystem */
|
// Initialize Lighting interpolation tables
|
||||||
|
fgLightInit();
|
||||||
|
|
||||||
|
// update the lighting parameters (based on sun angle)
|
||||||
|
fgEventRegister( "fgLightUpdate()", fgLightUpdate,
|
||||||
|
FG_EVENT_READY, 30000 );
|
||||||
|
|
||||||
|
// Initialize the weather modeling subsystem
|
||||||
fgWeatherInit();
|
fgWeatherInit();
|
||||||
|
|
||||||
/* update the weather for our current position */
|
// update the weather for our current position
|
||||||
fgEventRegister( "fgWeatherUpdate()", fgWeatherUpdate,
|
fgEventRegister( "fgWeatherUpdate()", fgWeatherUpdate,
|
||||||
FG_EVENT_READY, 120000 );
|
FG_EVENT_READY, 120000 );
|
||||||
|
|
||||||
/* Initialize the Cockpit subsystem */
|
// Initialize the Cockpit subsystem
|
||||||
if( fgCockpitInit( ¤t_aircraft )) {
|
if( fgCockpitInit( ¤t_aircraft )) {
|
||||||
// Cockpit initialized ok.
|
// Cockpit initialized ok.
|
||||||
} else {
|
} else {
|
||||||
|
@ -348,10 +358,10 @@ int fgInitSubsystems( void ) {
|
||||||
// I'm just sticking this here for now, it should probably move
|
// I'm just sticking this here for now, it should probably move
|
||||||
// eventually
|
// eventually
|
||||||
// cur_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0,
|
// cur_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0,
|
||||||
// FG_Latitude * RAD_TO_DEG * 3600.0); */
|
// FG_Latitude * RAD_TO_DEG * 3600.0);
|
||||||
// fgPrintf( FG_GENERAL, FG_INFO,
|
// fgPrintf( FG_GENERAL, FG_INFO,
|
||||||
// "True ground elevation is %.2f meters here.\n",
|
// "True ground elevation is %.2f meters here.\n",
|
||||||
// cur_elev); */
|
// cur_elev);
|
||||||
|
|
||||||
cur_elev = FG_Runway_altitude * FEET_TO_METER;
|
cur_elev = FG_Runway_altitude * FEET_TO_METER;
|
||||||
if ( cur_elev > -9990.0 ) {
|
if ( cur_elev > -9990.0 ) {
|
||||||
|
@ -367,10 +377,10 @@ int fgInitSubsystems( void ) {
|
||||||
FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
|
FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
|
||||||
FG_Altitude * FEET_TO_METER);
|
FG_Altitude * FEET_TO_METER);
|
||||||
|
|
||||||
/* end of thing that I just stuck in that I should probably move */
|
// end of thing that I just stuck in that I should probably move
|
||||||
|
|
||||||
/* Initialize the flight model subsystem data structures base on
|
// Initialize the flight model subsystem data structures base on
|
||||||
* above values */
|
// above values
|
||||||
|
|
||||||
fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
|
fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
|
||||||
|
|
||||||
|
@ -387,7 +397,7 @@ int fgInitSubsystems( void ) {
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT, "Error in Joystick initialization!\n" );
|
fgPrintf( FG_GENERAL, FG_EXIT, "Error in Joystick initialization!\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Autopilot init added here, by Jeff Goeke-Smith
|
// Autopilot init added here, by Jeff Goeke-Smith
|
||||||
fgAPInit(¤t_aircraft);
|
fgAPInit(¤t_aircraft);
|
||||||
// end added section;
|
// end added section;
|
||||||
|
|
||||||
|
@ -401,9 +411,13 @@ int fgInitSubsystems( void ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.56 1998/04/18 04:11:28 curt
|
/* Revision 1.1 1998/04/22 13:25:44 curt
|
||||||
/* Moved fg_debug to it's own library, added zlib support.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.56 1998/04/18 04:11:28 curt
|
||||||
|
* Moved fg_debug to it's own library, added zlib support.
|
||||||
|
*
|
||||||
* Revision 1.55 1998/04/14 02:21:03 curt
|
* Revision 1.55 1998/04/14 02:21:03 curt
|
||||||
* Incorporated autopilot heading hold contributed by: Jeff Goeke-Smith
|
* Incorporated autopilot heading hold contributed by: Jeff Goeke-Smith
|
||||||
* <jgoeke@voyager.net>
|
* <jgoeke@voyager.net>
|
|
@ -28,8 +28,8 @@
|
||||||
#define _FG_INIT_H
|
#define _FG_INIT_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifndef __cplusplus
|
||||||
extern "C" {
|
# error This library requires C++
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,18 +42,17 @@ int fgInitGeneral ( void );
|
||||||
int fgInitSubsystems( void );
|
int fgInitSubsystems( void );
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _FG_INIT_H */
|
#endif /* _FG_INIT_H */
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.4 1998/04/21 17:02:41 curt
|
/* Revision 1.1 1998/04/22 13:25:44 curt
|
||||||
/* Prepairing for C++ integration.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.4 1998/04/21 17:02:41 curt
|
||||||
|
* Prepairing for C++ integration.
|
||||||
|
*
|
||||||
* Revision 1.3 1998/02/12 21:59:50 curt
|
* Revision 1.3 1998/02/12 21:59:50 curt
|
||||||
* Incorporated code changes contributed by Charlie Hotchkiss
|
* Incorporated code changes contributed by Charlie Hotchkiss
|
||||||
* <chotchkiss@namg.us.anritsu.com>
|
* <chotchkiss@namg.us.anritsu.com>
|
|
@ -24,18 +24,20 @@
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include <Main/views.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <Include/fg_constants.h>
|
|
||||||
|
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <Flight/flight.h>
|
#include <Flight/flight.h>
|
||||||
|
#include <Include/fg_constants.h>
|
||||||
#include <Math/mat3.h>
|
#include <Math/mat3.h>
|
||||||
#include <Math/polar.h>
|
#include <Math/polar.h>
|
||||||
#include <Math/vector.h>
|
#include <Math/vector.h>
|
||||||
#include <Scenery/scenery.h>
|
#include <Scenery/scenery.h>
|
||||||
#include <Time/fg_time.h>
|
#include <Time/fg_time.h>
|
||||||
|
|
||||||
|
#include "views.hxx"
|
||||||
|
|
||||||
|
|
||||||
/* This is a record containing current view parameters */
|
/* This is a record containing current view parameters */
|
||||||
struct fgVIEW current_view;
|
struct fgVIEW current_view;
|
||||||
|
|
||||||
|
@ -50,7 +52,7 @@ void fgViewInit(struct fgVIEW *v) {
|
||||||
|
|
||||||
|
|
||||||
/* Update the view parameters */
|
/* Update the view parameters */
|
||||||
void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
|
void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, fgLIGHT *l) {
|
||||||
MAT3vec vec, forward, v0, minus_z;
|
MAT3vec vec, forward, v0, minus_z;
|
||||||
MAT3mat R, TMP, UP, LOCAL, VIEW;
|
MAT3mat R, TMP, UP, LOCAL, VIEW;
|
||||||
double ntmp;
|
double ntmp;
|
||||||
|
@ -188,9 +190,13 @@ void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.16 1998/04/18 04:11:29 curt
|
/* Revision 1.1 1998/04/22 13:25:45 curt
|
||||||
/* Moved fg_debug to it's own library, added zlib support.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.16 1998/04/18 04:11:29 curt
|
||||||
|
* Moved fg_debug to it's own library, added zlib support.
|
||||||
|
*
|
||||||
* Revision 1.15 1998/02/20 00:16:24 curt
|
* Revision 1.15 1998/02/20 00:16:24 curt
|
||||||
* Thursday's tweaks.
|
* Thursday's tweaks.
|
||||||
*
|
*
|
|
@ -1,5 +1,5 @@
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* views.h -- data structures and routines for managing and view parameters.
|
* views.hxx -- data structures and routines for managing and view parameters.
|
||||||
*
|
*
|
||||||
* Written by Curtis Olson, started August 1997.
|
* Written by Curtis Olson, started August 1997.
|
||||||
*
|
*
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
#define _VIEWS_H
|
#define _VIEWS_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifndef __cplusplus
|
||||||
extern "C" {
|
# error This library requires C++
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ extern "C" {
|
||||||
#include <Flight/flight.h>
|
#include <Flight/flight.h>
|
||||||
#include <Math/mat3.h>
|
#include <Math/mat3.h>
|
||||||
#include <Time/fg_time.h>
|
#include <Time/fg_time.h>
|
||||||
|
#include <Time/light.hxx>
|
||||||
|
|
||||||
|
|
||||||
/* Define a structure containing view information */
|
/* Define a structure containing view information */
|
||||||
|
@ -90,21 +91,20 @@ extern struct fgVIEW current_view;
|
||||||
void fgViewInit(struct fgVIEW *v);
|
void fgViewInit(struct fgVIEW *v);
|
||||||
|
|
||||||
/* Update the view parameters */
|
/* Update the view parameters */
|
||||||
void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l);
|
void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, fgLIGHT *l);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#endif /* _VIEWS_HXX */
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _VIEWS_H */
|
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.11 1998/04/21 17:02:42 curt
|
/* Revision 1.1 1998/04/22 13:25:46 curt
|
||||||
/* Prepairing for C++ integration.
|
/* C++ - ifing the code.
|
||||||
|
/* Starting a bit of reorganization of lighting code.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.11 1998/04/21 17:02:42 curt
|
||||||
|
* Prepairing for C++ integration.
|
||||||
|
*
|
||||||
* Revision 1.10 1998/02/07 15:29:45 curt
|
* Revision 1.10 1998/02/07 15:29:45 curt
|
||||||
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
|
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
|
||||||
* <chotchkiss@namg.us.anritsu.com>
|
* <chotchkiss@namg.us.anritsu.com>
|
Loading…
Add table
Reference in a new issue