From: curt Date: Sat, 3 Apr 1999 04:20:01 +0000 (+0000) Subject: Optimizations (tm) by Norman Vine. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=602ac3e67b862dd96f13b99af60c47459425ec8a;p=flightgear.git Optimizations (tm) by Norman Vine. --- diff --git a/FDM/JSBsim.cxx b/FDM/JSBsim.cxx index 4872c6b9d..b8aa1dff0 100644 --- a/FDM/JSBsim.cxx +++ b/FDM/JSBsim.cxx @@ -248,12 +248,19 @@ int fgJSBsim_2_FGInterface (FGInterface& f) { // D_pilot_above_rwy ); // f.set_Pilot_Rwy_Rwy( X_pilot_rwy, Y_pilot_rwy, H_pilot_rwy ); + f.set_sin_lat_geocentric( lat_geoc ); + f.set_cos_lat_geocentric( lat_geoc ); + f.set_sin_cos_longitude( lon ); + f.set_sin_cos_latitude( lat_geod ); return 0; } // $Log$ +// Revision 1.4 1999/04/03 04:20:01 curt +// Optimizations (tm) by Norman Vine. +// // Revision 1.3 1999/02/26 22:09:10 curt // Added initial support for native SGI compilers. // Integrated Jon's next version of JSBsim. diff --git a/FDM/LaRCsim.cxx b/FDM/LaRCsim.cxx index 22f75966a..b647f0340 100644 --- a/FDM/LaRCsim.cxx +++ b/FDM/LaRCsim.cxx @@ -47,7 +47,7 @@ int fgLaRCsimUpdate(FGInterface& f, int multiloop) { double save_alt = 0.0; // lets try to avoid really screwing up the LaRCsim model - if ( f.get_Altitude() < -9000 ) { + if ( f.get_Altitude() < -9000.0 ) { save_alt = f.get_Altitude(); f.set_Altitude( 0.0 ); } @@ -389,12 +389,25 @@ int fgLaRCsim_2_FGInterface (FGInterface& f) { // D_pilot_above_rwy ); // f.set_Pilot_Rwy_Rwy( X_pilot_rwy, Y_pilot_rwy, H_pilot_rwy ); + f.set_sin_lat_geocentric(Lat_geocentric); + f.set_cos_lat_geocentric(Lat_geocentric); + f.set_sin_cos_longitude(Longitude); + f.set_sin_cos_latitude(Latitude); + + // printf("sin_lat_geo %f cos_lat_geo %f\n", sin_Lat_geoc, cos_Lat_geoc); + // printf("sin_lat %f cos_lat %f\n", + // f.get_sin_latitude(), f.get_cos_latitude()); + // printf("sin_lon %f cos_lon %f\n", + // f.get_sin_longitude(), f.get_cos_longitude()); return 0; } // $Log$ +// Revision 1.12 1999/04/03 04:20:02 curt +// Optimizations (tm) by Norman Vine. +// // Revision 1.11 1999/02/05 21:28:58 curt // Modifications to incorporate Jon S. Berndts flight model code. // diff --git a/FDM/flight.cxx b/FDM/flight.cxx index 734d250fc..f17342687 100644 --- a/FDM/flight.cxx +++ b/FDM/flight.cxx @@ -110,7 +110,7 @@ int fgFDMInit(int model, FGInterface& f, double dt) { fgExternalInit(base_fdm_state); } else { FG_LOG( FG_FLIGHT, FG_WARN, - "Unimplemented flight model == " << model ); + "Unimplemented flight model == " << model ); } // set valid time for this record @@ -195,6 +195,9 @@ void fgFDMSetGroundElevation(int model, double ground_meters) { // $Log$ +// Revision 1.17 1999/04/03 04:20:03 curt +// Optimizations (tm) by Norman Vine. +// // Revision 1.16 1999/02/26 22:09:12 curt // Added initial support for native SGI compilers. // Integrated Jon's next version of JSBsim. diff --git a/FDM/flight.hxx b/FDM/flight.hxx index 9edf224e3..d73f37389 100644 --- a/FDM/flight.hxx +++ b/FDM/flight.hxx @@ -794,6 +794,47 @@ public: // Extrapolate FDM based on time_offset (in usec) void extrapolate( int time_offset ); + // sin/cos lat_geocentric + double sin_lat_geocentric; + double cos_lat_geocentric; + inline void set_sin_lat_geocentric(double parm) { + sin_lat_geocentric = sin(parm); + } + inline void set_cos_lat_geocentric(double parm) { + cos_lat_geocentric = cos(parm); + } + inline double get_sin_lat_geocentric(void) const { + return sin_lat_geocentric; + } + inline double get_cos_lat_geocentric(void) const { + return cos_lat_geocentric; + } + + double sin_longitude; + double cos_longitude; + inline void set_sin_cos_longitude(double parm) { + sin_longitude = sin(parm); + cos_longitude = cos(parm); + } + inline double get_sin_longitude(void) const { + return sin_longitude; + } + inline double get_cos_longitude(void) const { + return cos_longitude; + } + + double sin_latitude; + double cos_latitude; + inline void set_sin_cos_latitude(double parm) { + sin_latitude = sin(parm); + cos_latitude = cos(parm); + } + inline double get_sin_latitude(void) const { + return sin_latitude; + } + inline double get_cos_latitude(void) const { + return cos_latitude; + } }; @@ -819,6 +860,9 @@ void fgFDMSetGroundElevation(int model, double alt_meters); // $Log$ +// Revision 1.14 1999/04/03 04:20:04 curt +// Optimizations (tm) by Norman Vine. +// // Revision 1.13 1999/02/05 21:29:02 curt // Modifications to incorporate Jon S. Berndts flight model code. //