Continuing work on the LaRCsim flight model integration.
Added some MSFS-like keyboard input handling.
int ls_cockpit() {
struct control_params *c;
+ sim_control_.paused = 0;
+
c = ¤t_aircraft.controls;
Lat_control = -c->aileron;
Long_control = -c->elev;
-
- sim_control_.paused = 0;
-
- Throttle_pct = 0.95;
+ Rudder_pedal = c->rudder;
+ Throttle_pct = c->throttle[0];
/* printf("Mach = %.2f ", Mach_number);
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
/* Flight Gear Modification Log
*
* $Log$
+ * Revision 1.6 1997/05/31 04:13:53 curt
+ * WE CAN NOW FLY!!!
+ *
+ * Continuing work on the LaRCsim flight model integration.
+ * Added some MSFS-like keyboard input handling.
+ *
* Revision 1.5 1997/05/30 23:26:25 curt
* Added elevator/aileron controls.
*
printf("Key hit = %d\n", k);
switch (k) {
- case GLUT_KEY_UP:
- c->elev -= 0.01;
- return;
- case GLUT_KEY_DOWN:
+ case 50: /* numeric keypad 2 */
c->elev += 0.01;
return;
- case GLUT_KEY_LEFT:
+ case 56: /* numeric keypad 8 */
+ c->elev -= 0.01;
+ return;
+ case 52: /* numeric keypad 4 */
c->aileron += 0.01;
return;
- case GLUT_KEY_RIGHT:
+ case 54: /* numeric keypad 6 */
c->aileron -= 0.01;
return;
- case 1 /* TK_END */:
+ case 48: /* numeric keypad Ins */
c->rudder -= 0.01;
return;
- case 2 /* TK_PGDWN */:
+ case 13: /* numeric keypad Enter */
c->rudder += 0.01;
return;
- case 3:
- c->throttle[0] -= 0.05;
- return;
- case 4:
+ case 53: /* numeric keypad 5 */
+ c->aileron = 0.0;
+ c->elev = 0.0;
+ c->rudder = 0.0;
+ case 57: /* numeric keypad 9 (Pg Up) */
c->throttle[0] += 0.05;
return;
+ case 51: /* numeric keypad 3 (Pg Dn) */
+ c->throttle[0] -= 0.05;
+ return;
case 122:
fogDensity *= 1.10;
glFogf(GL_FOG_END, fogDensity);
}
+/* Handle "special" keyboard events */
+void GLUTspecialkey(unsigned char k, int x, int y) {
+ struct control_params *c;
+
+ c = ¤t_aircraft.controls;
+
+ printf("Special key hit = %d\n", k);
+
+ switch (k) {
+ case GLUT_KEY_UP:
+ c->elev -= 0.01;
+ return;
+ case GLUT_KEY_DOWN:
+ c->elev += 0.01;
+ return;
+ case GLUT_KEY_LEFT:
+ c->aileron += 0.01;
+ return;
+ case GLUT_KEY_RIGHT:
+ c->aileron -= 0.01;
+ return;
+ }
+
+}
+
+
/* $Log$
-/* Revision 1.5 1997/05/30 23:26:19 curt
-/* Added elevator/aileron controls.
+/* Revision 1.6 1997/05/31 04:13:52 curt
+/* WE CAN NOW FLY!!!
/*
+/* Continuing work on the LaRCsim flight model integration.
+/* Added some MSFS-like keyboard input handling.
+/*
+ * Revision 1.5 1997/05/30 23:26:19 curt
+ * Added elevator/aileron controls.
+ *
* Revision 1.4 1997/05/27 17:44:31 curt
* Renamed & rearranged variables and routines. Added some initial simple
* timer/alarm routines so the flight model can be updated on a regular interval.
/* Handle keyboard events */
void GLUTkey(unsigned char k, int x, int y);
+void GLUTspecialkey(unsigned char k, int x, int y);
#endif GLUTKEY_H
/* $Log$
-/* Revision 1.2 1997/05/23 15:40:25 curt
-/* Added GNU copyright headers.
-/* Fog now works!
+/* Revision 1.3 1997/05/31 04:13:52 curt
+/* WE CAN NOW FLY!!!
/*
+/* Continuing work on the LaRCsim flight model integration.
+/* Added some MSFS-like keyboard input handling.
+/*
+ * Revision 1.2 1997/05/23 15:40:25 curt
+ * Added GNU copyright headers.
+ * Fog now works!
+ *
* Revision 1.1 1997/05/21 15:57:51 curt
* Renamed due to added GLUT support.
*
/* view parameters */
static GLfloat win_ratio = 1.0;
+/* sun direction */
+static GLfloat sun_vec[4] = {-3.0, 1.0, 2.0, 0.0 };
+
/* temporary hack */
extern struct mesh *mesh_ptr;
/* Function prototypes */
static void fgInitVisuals() {
/* if the 4th field is 0.0, this specifies a direction ... */
- static GLfloat sun_vec[4] = {3.0, 1.0, 3.0, 0.0 };
static GLfloat color[4] = { 0.3, 0.7, 0.2, 1.0 };
static GLfloat fogColor[4] = {0.65, 0.65, 0.85, 1.0};
struct flight_params *f;
MAT3mat R, tmp;
MAT3vec vec, forward, up;
+ MAT3hvec sun;
f = ¤t_aircraft.flight;
pos_x + forward[0], pos_y + forward[1], pos_z + forward[2],
up[0], up[1], up[2]);
+ glLightfv( GL_LIGHT0, GL_POSITION, sun_vec );
}
static double lastSimtime = -99.9;
int Overrun;
+ /* ignore any SIGALRM's until we come back from our EOM iteration */
+ signal(SIGALRM, SIG_IGN);
+
f = ¤t_aircraft.flight;
/* printf("In fgTimerCatch()\n"); */
/* fgSlewInit(-335340,162540, 15, 4.38); */
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
- fgFlightModelInit(FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ);
+ fgFlightModelInit(FG_LARCSIM, f, 1.0/(DEFAULT_MODEL_HZ*DEFAULT_MULTILOOP));
/* build all objects */
fgSceneryInit();
/* call key() on keyboard event */
glutKeyboardFunc( GLUTkey );
- glutSpecialFunc( GLUTkey );
+ glutSpecialFunc( GLUTspecialkey );
/* call fgMainLoop() whenever there is nothing else to do */
glutIdleFunc( fgMainLoop );
/* $Log$
-/* Revision 1.9 1997/05/30 19:27:01 curt
-/* The LaRCsim flight model is starting to look like it is working.
+/* Revision 1.10 1997/05/31 04:13:52 curt
+/* WE CAN NOW FLY!!!
/*
+/* Continuing work on the LaRCsim flight model integration.
+/* Added some MSFS-like keyboard input handling.
+/*
+ * Revision 1.9 1997/05/30 19:27:01 curt
+ * The LaRCsim flight model is starting to look like it is working.
+ *
* Revision 1.8 1997/05/30 03:54:10 curt
* Made a bit more progress towards integrating the LaRCsim flight model.
*
#---------------------------------------------------------------------------
# For OpenGL
-GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
+# GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
# For Mesa
-# MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
-# X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
-# GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
CFLAGS = $(STD_CFLAGS) $(INTERFACE_FLAGS)
#---------------------------------------------------------------------------
# $Log$
+# Revision 1.10 1997/05/31 04:13:53 curt
+# WE CAN NOW FLY!!!
+#
+# Continuing work on the LaRCsim flight model integration.
+# Added some MSFS-like keyboard input handling.
+#
# Revision 1.9 1997/05/30 23:26:19 curt
# Added elevator/aileron controls.
#
int i, j, istep, jstep, iend, jend;
float temp;
- istep = jstep = 4; /* Detail level 1 -- 1200 ... */
+ istep = jstep = 12; /* Detail level 1 -- 1200 ... */
mesh = glGenLists(1);
glNewList(mesh, GL_COMPILE);
/* $Log$
-/* Revision 1.12 1997/05/30 23:26:20 curt
-/* Added elevator/aileron controls.
+/* Revision 1.13 1997/05/31 04:13:53 curt
+/* WE CAN NOW FLY!!!
/*
+/* Continuing work on the LaRCsim flight model integration.
+/* Added some MSFS-like keyboard input handling.
+/*
+ * Revision 1.12 1997/05/30 23:26:20 curt
+ * Added elevator/aileron controls.
+ *
* Revision 1.11 1997/05/30 19:27:02 curt
* The LaRCsim flight model is starting to look like it is working.
*
standardized interface to all interesting flight model variabls.
+mat3/
+-----
+Contains miscellaneous matrix/vector routines.
+
+
scenery/
--------
Scenery parsing/generating code.