]> git.mxchange.org Git - flightgear.git/commitdiff
Made a bit more progress towards integrating the LaRCsim flight model.
authorcurt <curt>
Fri, 30 May 1997 03:54:10 +0000 (03:54 +0000)
committercurt <curt>
Fri, 30 May 1997 03:54:10 +0000 (03:54 +0000)
Aircraft/aircraft.c
LaRCsim/LaRCsim.c
LaRCsim/ls_interface.c
Main/GLmain.c
Main/mesh2GL.c

index d641ea8925427e8955b6002edaf48737b8a81ce0..c3ffc4e85f43c4892ab7c20e6f800bd706c7c6ae 100644 (file)
@@ -29,8 +29,7 @@
 
 #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) {
@@ -41,8 +40,8 @@ void aircraft_debug(int type) {
     c = &current_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);
@@ -50,9 +49,12 @@ void aircraft_debug(int type) {
 
 
 /* $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.
  *
index b3d094fda5e9cdd2c28b6dd605fbcfa2fd265a99..acddbb7650c5ac8ee4e814b6f4953a1ab0f40eb9 100644 (file)
@@ -64,6 +64,9 @@
 
 $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.
 
@@ -478,9 +481,9 @@ int ls_cockpit() {
 
     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);
 }
index 9e591c6c00e5d51ed7b5b5ab54cb8f739119b0ee..fc0779fde51cc390a8e5b9bff9a2a73dea281988 100644 (file)
@@ -496,11 +496,11 @@ int initialize;
 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); */
 
 }
 
@@ -900,6 +900,9 @@ int fgLaRCsim_2_Flight (struct flight_params *f) {
 /* 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.
  *
index b8025c84f458f91a7ed6793df80f3a52888c3fe2..a53dd3ba8b9f57b1e3713f897e76363df1e6e240 100644 (file)
 #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 */
@@ -132,13 +129,18 @@ static void fgUpdateViewParams() {
     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);
+
 }
 
 
@@ -318,8 +320,8 @@ int main( int argc, char *argv[] ) {
     /* 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, 
@@ -333,7 +335,7 @@ int main( int argc, char *argv[] ) {
     /* 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;
@@ -408,9 +410,12 @@ int main( int argc, char *argv[] ) {
 
 
 /* $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.
  *
index ed3b555c07c453f13d26f2f48cbccea1b4c03aaf..6fa34ef992b03c72468453637ef5bab3b8055b32 100644 (file)
@@ -59,7 +59,7 @@ GLint mesh2GL(struct mesh *m) {
     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);
@@ -119,9 +119,12 @@ GLint mesh2GL(struct mesh *m) {
 
 
 /* $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.
  *