# define _G_NO_EXTERN_TEMPLATES
#endif
-#include <string>
+#include <Include/compiler.h>
+
+#include STL_STRING
#include <Include/fg_constants.h>
+#include <Debug/logstream.hxx>
#include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx>
#include <Astro/sky.hxx>
#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx>
-#include <Debug/logstream.hxx>
#include <Joystick/joystick.hxx>
#include <Math/fg_geodesy.hxx>
#include <Math/fg_random.h>
#include "fg_init.hxx"
#include "options.hxx"
#include "views.hxx"
+#include "fg_serial.hxx"
+FG_USING_STD(string);
extern const char *default_root;
// Set initial position and orientation
int fgInitPosition( void ) {
string id;
- FGState *f;
+ FGInterface *f;
f = current_aircraft.fdm_state;
"starting altitude is = " << current_options.get_altitude() );
f->set_Altitude( current_options.get_altitude() * METER_TO_FEET );
- f->set_Runway_altitude( f->get_Altitude() - 3.758099 );
+ fgFDMSetGroundElevation( current_options.get_flight_model(),
+ (f->get_Altitude() - 3.758099) * FEET_TO_METER );
FG_LOG( FG_GENERAL, FG_INFO,
"Initial position is: ("
// General house keeping initializations
int fgInitGeneral( void ) {
string root;
- int i;
+ // int i;
FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" );
FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" );
// Returns non-zero if a problem encountered.
int fgInitSubsystems( void )
{
- FGState *f; // assigned later
+ FGInterface *f; // assigned later
fgLIGHT *l = &cur_light_params;
fgTIME *t = &cur_time_params;
FGView *v = ¤t_view;
- Point3D geod_pos, tmp_abs_view_pos;
FG_LOG( FG_GENERAL, FG_INFO, "Initialize Subsystems");
FG_LOG( FG_GENERAL, FG_INFO, "========== ==========");
exit(-1);
}
+ FG_LOG( FG_GENERAL, FG_DEBUG,
+ "Current terrain elevation after tile mgr init " <<
+ scenery.cur_elev );
+
// Calculate ground elevation at starting point (we didn't have
// tmp_abs_view_pos calculated when fgTileMgrUpdate() was called above
-
+ //
// calculalate a cartesian point somewhere along the line between
// the center of the earth and our view position. Doesn't have to
// be the exact elevation (this is good because we don't know it
// yet :-)
+
+ // now handled inside of the fgTileMgrUpdate()
+
+ /*
geod_pos = Point3D( f->get_Longitude(), f->get_Latitude(), 0.0);
tmp_abs_view_pos = fgGeodToCart(geod_pos);
- FG_LOG( FG_GENERAL, FG_DEBUG,
- "Altitude before update " << scenery.cur_elev );
FG_LOG( FG_GENERAL, FG_DEBUG,
"Initial abs_view_pos = " << tmp_abs_view_pos );
scenery.cur_elev =
- fgTileMgrCurElevOLD( f->get_Longitude(),
- f->get_Latitude(),
- tmp_abs_view_pos );
+ fgTileMgrCurElev( f->get_Longitude(), f->get_Latitude(),
+ tmp_abs_view_pos );
FG_LOG( FG_GENERAL, FG_DEBUG,
"Altitude after update " << scenery.cur_elev );
- f->set_Runway_altitude( scenery.cur_elev * METER_TO_FEET );
+ */
+
+ fgFDMSetGroundElevation( current_options.get_flight_model(),
+ scenery.cur_elev );
// Reset our altitude if we are below ground
+ FG_LOG( FG_GENERAL, FG_DEBUG, "Current altitude = " << f->get_Altitude() );
+ FG_LOG( FG_GENERAL, FG_DEBUG, "Current runway altitude = " <<
+ f->get_Runway_altitude() );
+
if ( f->get_Altitude() < f->get_Runway_altitude() + 3.758099) {
f->set_Altitude( f->get_Runway_altitude() + 3.758099 );
}
// Initialize the flight model subsystem data structures base on
// above values
- fgFlightModelInit( current_options.get_flight_model(), cur_fdm_state,
+ fgFDMInit( current_options.get_flight_model(), cur_fdm_state,
1.0 / DEFAULT_MODEL_HZ );
// I'm just sticking this here for now, it should probably move
// $Log$
+// Revision 1.68 1999/03/02 01:03:15 curt
+// Tweaks for building with native SGI compilers.
+//
+// Revision 1.67 1999/02/26 22:09:48 curt
+// Added initial support for native SGI compilers.
+//
+// Revision 1.66 1999/02/05 21:29:10 curt
+// Modifications to incorporate Jon S. Berndts flight model code.
+//
+// Revision 1.65 1999/02/02 20:13:36 curt
+// MSVC++ portability changes by Bernie Bright:
+//
+// Lib/Serial/serial.[ch]xx: Initial Windows support - incomplete.
+// Simulator/Astro/stars.cxx: typo? included <stdio> instead of <cstdio>
+// Simulator/Cockpit/hud.cxx: Added Standard headers
+// Simulator/Cockpit/panel.cxx: Redefinition of default parameter
+// Simulator/Flight/flight.cxx: Replaced cout with FG_LOG. Deleted <stdio.h>
+// Simulator/Main/fg_init.cxx:
+// Simulator/Main/GLUTmain.cxx:
+// Simulator/Main/options.hxx: Shuffled <fg_serial.hxx> dependency
+// Simulator/Objects/material.hxx:
+// Simulator/Time/timestamp.hxx: VC++ friend kludge
+// Simulator/Scenery/tile.[ch]xx: Fixed using std::X declarations
+// Simulator/Main/views.hxx: Added a constant
+//
+// Revision 1.64 1999/02/01 21:15:43 curt
+// Removed unused variables.
+//
+// Revision 1.63 1999/01/27 04:49:19 curt
+// Game mode fixes from Norman Vine.
+// Initial altitude setting tweaks and fixes (especially for when starting
+// below sea level.)
+//
+// Revision 1.62 1999/01/20 13:42:25 curt
+// Tweaked FDM interface.
+// Testing check sum support for NMEA serial output.
+//
+// Revision 1.61 1999/01/08 03:23:57 curt
+// Beginning work on compensating for sim time vs. real world time "jitter".
+//
// Revision 1.60 1999/01/07 20:25:09 curt
// Updated struct fgGENERAL to class FGGeneral.
//