#include "aircraft.h"
-#define FG_LON_2_DEG(RAD) ((RAD) * 180.0 / M_PI)
-#define FG_LAT_2_DEG(RAD) (-1.0 * (RAD) * 180.0 / M_PI)
+#define FG_RAD_2_DEG(RAD) ((RAD) * 180.0 / M_PI)
/* Display various parameters to stdout */
void aircraft_debug(int type) {
c = ¤t_aircraft.controls;
printf("Pos = (%.2f,%.2f,%.2f) Dir = %.2f Mach = %.2f\n",
- FG_LAT_2_DEG(FG_Latitude) * 3600.0,
- FG_LON_2_DEG(FG_Longitude) * 3600.0,
+ FG_RAD_2_DEG(FG_Longitude) * 3600.0,
+ FG_RAD_2_DEG(FG_Latitude) * 3600.0,
FG_Altitude, FG_Psi, FG_Mach_number);
printf("Elev = %.2f, Aileron = %.2f, Rudder = %.2f\n",
c->elev, c->aileron, c->rudder);
/* $Log$
-/* Revision 1.3 1997/05/29 22:39:56 curt
-/* Working on incorporating the LaRCsim flight model.
+/* Revision 1.4 1997/05/30 03:54:11 curt
+/* Made a bit more progress towards integrating the LaRCsim flight model.
/*
+ * Revision 1.3 1997/05/29 22:39:56 curt
+ * Working on incorporating the LaRCsim flight model.
+ *
* Revision 1.2 1997/05/23 15:40:29 curt
* Added GNU copyright headers.
*
$Header$
$Log$
+Revision 1.2 1997/05/30 03:54:12 curt
+Made a bit more progress towards integrating the LaRCsim flight model.
+
Revision 1.1 1997/05/29 00:09:51 curt
Initial Flight Gear revision.
Throttle_pct = 0.85;
- /* printf("Mach = %.2f ", Mach_number);
+ printf("Mach = %.2f ", Mach_number);
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
- printf("%.2f,%.2f,%.2f\n", Phi, Theta, Psi); */
+ printf("%.2f,%.2f,%.2f\n", Phi, Theta, Psi);
return(abort);
}
int ls_cockpit() {
sim_control_.paused = 0;
- Throttle_pct = 0.25;
+ Throttle_pct = 0.99;
- printf("Mach = %.2f ", Mach_number);
+ /* printf("Mach = %.2f ", Mach_number);
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
- printf("%.2f,%.2f,%.2f\n", Phi, Theta, Psi);
+ printf("%.2f,%.2f,%.2f\n", Phi, Theta, Psi); */
}
/* Flight Gear Modification Log
*
* $Log$
+ * Revision 1.3 1997/05/30 03:54:12 curt
+ * Made a bit more progress towards integrating the LaRCsim flight model.
+ *
* Revision 1.2 1997/05/29 22:39:59 curt
* Working on incorporating the LaRCsim flight model.
*
#include "../aircraft/aircraft.h"
#include "../scenery/scenery.h"
-#define FG_LON_2_DEG(RAD) ((RAD) * 180.0 / M_PI)
-#define FG_LAT_2_DEG(RAD) (-1.0 * (RAD) * 180.0 / M_PI)
-
-#define FG_DEG_2_LON(DEG) ((DEG) * M_PI / 180.0)
-#define FG_DEG_2_LAT(DEG) (-1.0 * (DEG) * M_PI / 180.0)
+#define FG_RAD_2_DEG(RAD) ((RAD) * 180.0 / M_PI)
+#define FG_DEG_2_RAD(DEG) ((DEG) * M_PI / 180.0)
/* This is a record containing all the info for the aircraft currently
being operated */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- pos_x = FG_LAT_2_DEG(FG_Latitude) * 3600.0;
- pos_y = FG_LON_2_DEG(FG_Longitude) * 3600.0;
- pos_z = FG_Altitude;
+ pos_x = FG_RAD_2_DEG(FG_Longitude) * 3600.0;
+ pos_y = FG_RAD_2_DEG(FG_Latitude) * 3600.0;
+ pos_z = FG_Altitude * 0.01; /* (Convert feet to aproximate arcsecs) */
+
+ glRotatef(FG_Phi, 1.0, 0.0, 0.0);
+ glRotatef(FG_Theta, 0.0, 1.0, 0.0);
+ glRotatef(FG_Psi, 0.0, 0.0, 1.0);
gluLookAt(pos_x, pos_y, pos_z,
- pos_x + cos(FG_Psi), pos_y + sin(FG_Psi), pos_z,
+ pos_x + 1.0, pos_y, pos_z,
0.0, 0.0, 1.0);
+
}
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
/* Initial Position */
- FG_Latitude = FG_DEG_2_LAT( -398673.28 / 3600.0 );
- FG_Longitude = FG_DEG_2_LON( 120625.64 / 3600.0 );
+ FG_Latitude = FG_DEG_2_RAD( 120625.64 / 3600.0 );
+ FG_Longitude = FG_DEG_2_RAD( -398673.28 / 3600.0 );
FG_Altitude = 3.758099E+00;
printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude,
/* Initial Orientation */
FG_Phi = -2.658474E-06;
FG_Theta = 7.401790E-03;
- FG_Psi = 1.391358E-03;
+ FG_Psi = 4.38;
/* Initial Angular B rates */
FG_P_body = 7.206685E-05;
/* $Log$
-/* Revision 1.7 1997/05/29 22:39:49 curt
-/* Working on incorporating the LaRCsim flight model.
+/* Revision 1.8 1997/05/30 03:54:10 curt
+/* Made a bit more progress towards integrating the LaRCsim flight model.
/*
+ * Revision 1.7 1997/05/29 22:39:49 curt
+ * Working on incorporating the LaRCsim flight model.
+ *
* Revision 1.6 1997/05/29 12:31:39 curt
* Minor tweaks, moving towards general flight model integration.
*
int i, j, istep, jstep, iend, jend;
float temp;
- istep = jstep = 100; /* Detail level 1 -- 1200 ... */
+ istep = jstep = 25; /* Detail level 1 -- 1200 ... */
mesh = glGenLists(1);
glNewList(mesh, GL_COMPILE);
/* $Log$
-/* Revision 1.9 1997/05/29 22:39:51 curt
-/* Working on incorporating the LaRCsim flight model.
+/* Revision 1.10 1997/05/30 03:54:11 curt
+/* Made a bit more progress towards integrating the LaRCsim flight model.
/*
+ * Revision 1.9 1997/05/29 22:39:51 curt
+ * Working on incorporating the LaRCsim flight model.
+ *
* Revision 1.8 1997/05/29 12:31:40 curt
* Minor tweaks, moving towards general flight model integration.
*