#include <Aircraft/aircraft.hxx>
#include <Debug/logstream.hxx>
#include <Include/fg_constants.h>
-#include <Include/general.h>
+#include <Include/general.hxx>
#include <Main/options.hxx>
#include <Main/views.hxx>
#include <Math/fg_random.h>
double get_latitude( void )
{
- fgFLIGHT *f;
- f = current_aircraft.flight;
-
-// return( toDM(FG_Latitude * RAD_TO_DEG) );
- return((double)((int)( FG_Latitude * RAD_TO_DEG)) );
+ return((double)((int)( current_aircraft.fdm_state->get_Latitude()
+ * RAD_TO_DEG)) );
}
+
double get_lat_min( void )
{
- fgFLIGHT *f;
- double a, d;
-
- f = current_aircraft.flight;
-
- a = FG_Latitude * RAD_TO_DEG;
- if (a < 0.0) {
- a = -a;
- }
- d = (double) ( (int) a);
- return( (a - d) * 60.0);
-}
+ double a, d;
+ a = current_aircraft.fdm_state->get_Latitude() * RAD_TO_DEG;
+ if (a < 0.0) {
+ a = -a;
+ }
+ d = (double) ( (int) a);
+ return( (a - d) * 60.0);
+}
double get_longitude( void )
{
- fgFLIGHT *f;
- f = current_aircraft.flight;
-
-// return( toDM(FG_Longitude * RAD_TO_DEG) );
- return((double)((int) (FG_Longitude * RAD_TO_DEG)) );
+ return( (double)((int) (current_aircraft.fdm_state->get_Longitude()
+ * RAD_TO_DEG)) );
}
+
double get_long_min( void )
{
- fgFLIGHT *f;
- double a, d;
-
- f = current_aircraft.flight;
-
- a = FG_Longitude * RAD_TO_DEG;
- if (a < 0.0) {
- a = -a;
- }
- d = (double) ( (int) a);
- return( (a - d) * 60.0);
+ double a, d;
+
+ a = current_aircraft.fdm_state->get_Longitude() * RAD_TO_DEG;
+ if (a < 0.0) {
+ a = -a;
+ }
+ d = (double) ( (int) a);
+ return( (a - d) * 60.0);
}
double get_throttleval( void )
double get_speed( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
- return( FG_V_equiv_kts ); // Make an explicit function call.
+ return( current_aircraft.fdm_state->get_V_equiv_kts() );
}
double get_aoa( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
- return( FG_Gamma_vert_rad * RAD_TO_DEG );
+ return( current_aircraft.fdm_state->get_Alpha() * RAD_TO_DEG );
}
double get_roll( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
- return( FG_Phi );
+ return( current_aircraft.fdm_state->get_Phi() );
}
double get_pitch( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
- return( FG_Theta );
+ return( current_aircraft.fdm_state->get_Theta() );
}
double get_heading( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
- return( FG_Psi * RAD_TO_DEG );
+ return( current_aircraft.fdm_state->get_Psi() * RAD_TO_DEG );
}
double get_altitude( void )
{
- fgFLIGHT *f;
- // double rough_elev;
-
- f = current_aircraft.flight;
- // rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
- // FG_Latitude * RAD_TO_ARCSEC);
-
- if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
- return FG_Altitude;
- } else {
- return FG_Altitude * FEET_TO_METER;
- }
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return current_aircraft.fdm_state->get_Altitude();
+ } else {
+ return current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER;
+ }
}
double get_agl( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
-
- if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
- return FG_Altitude - scenery.cur_elev * METER_TO_FEET;
- } else {
- return FG_Altitude * FEET_TO_METER - scenery.cur_elev;
- }
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return current_aircraft.fdm_state->get_Altitude()
+ - scenery.cur_elev * METER_TO_FEET;
+ } else {
+ return current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER
+ - scenery.cur_elev;
+ }
}
double get_sideslip( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
-
- return( FG_Beta );
+ return( current_aircraft.fdm_state->get_Beta() );
}
double get_frame_rate( void )
{
- fgGENERAL *pgeneral;
-
- pgeneral = &general;
-
- return pgeneral->frame_rate;
+ return (double) general.get_frame_rate();
}
double get_fov( void )
double get_vfc_ratio( void )
{
- fgVIEW *pview;
-
- pview = ¤t_view;
-
- return pview->vfc_ratio;
+ return current_view.get_vfc_ratio();
}
double get_vfc_tris_drawn ( void )
{
- return current_view.tris_rendered;
+ return current_view.get_tris_rendered();
}
double get_climb_rate( void )
{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
-
- if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
- return FG_Climb_Rate * 60.0;
- } else {
- return FG_Climb_Rate * FEET_TO_METER * 60.0;
- }
+ if ( current_options.get_units() == fgOPTIONS::FG_UNITS_FEET ) {
+ return current_aircraft.fdm_state->get_Climb_Rate() * 60.0;
+ } else {
+ return current_aircraft.fdm_state->get_Climb_Rate()
+ * FEET_TO_METER * 60.0;
+ }
}
void fgCockpitUpdate( void ) {
- fgVIEW *pview;
-
- pview = ¤t_view;
-
FG_LOG( FG_COCKPIT, FG_DEBUG,
"Cockpit: code " << ac_cockpit->code() << " status "
<< ac_cockpit->status() );
}
if ( current_options.get_panel_status() &&
- (fabs(pview->view_offset) < 0.2) ) {
+ (fabs( current_view.get_view_offset() ) < 0.2) )
+ {
+ xglViewport( 0, 0,
+ current_view.get_winWidth(),
+ current_view.get_winHeight() );
fgPanelUpdate();
}
}
// $Log$
+// Revision 1.30 1999/02/05 21:28:57 curt
+// Modifications to incorporate Jon S. Berndts flight model code.
+//
+// Revision 1.29 1999/01/08 19:27:34 curt
+// Fixed AOA reading on HUD.
+// Continued work on time jitter compensation.
+//
+// Revision 1.28 1999/01/07 20:24:17 curt
+// Update fgGENERAL to FGGeneral.
+//
+// Revision 1.27 1998/12/18 23:35:09 curt
+// Converted to a simpler frame rate counting method.
+//
+// Revision 1.26 1998/12/09 18:50:19 curt
+// Converted "class fgVIEW" to "class FGView" and updated to make data
+// members private and make required accessor functions.
+//
+// Revision 1.25 1998/12/05 15:54:07 curt
+// Renamed class fgFLIGHT to class FGState as per request by JSB.
+//
+// Revision 1.24 1998/12/03 01:16:00 curt
+// Converted fgFLIGHT to a class.
+//
+// Revision 1.23 1998/11/09 23:38:50 curt
+// Panel updates from Friedemann.
+//
// Revision 1.22 1998/11/06 21:17:45 curt
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using