Elevator trim added.
This commit is contained in:
parent
220ee54f33
commit
3daadec894
13 changed files with 163 additions and 83 deletions
|
@ -43,15 +43,18 @@ void aircraft_debug(int type) {
|
||||||
FG_RAD_2_DEG(FG_Longitude) * 3600.0,
|
FG_RAD_2_DEG(FG_Longitude) * 3600.0,
|
||||||
FG_RAD_2_DEG(FG_Latitude) * 3600.0,
|
FG_RAD_2_DEG(FG_Latitude) * 3600.0,
|
||||||
FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
|
FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
|
||||||
printf("Mach = %.2f Elev = %.2f, Aileron = %.2f, Rudder = %.2f\n",
|
printf("Mach = %.2f Elev = %.2f, Aileron = %.2f, Rudder = %.2f Power = %.2f\n",
|
||||||
FG_Mach_number, c->elev, c->aileron, c->rudder);
|
FG_Mach_number, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.5 1997/05/30 19:30:14 curt
|
/* Revision 1.6 1997/05/31 19:16:26 curt
|
||||||
/* The LaRCsim flight model is starting to look like it is working.
|
/* Elevator trim added.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.5 1997/05/30 19:30:14 curt
|
||||||
|
* The LaRCsim flight model is starting to look like it is working.
|
||||||
|
*
|
||||||
* Revision 1.4 1997/05/30 03:54:11 curt
|
* Revision 1.4 1997/05/30 03:54:11 curt
|
||||||
* Made a bit more progress towards integrating the LaRCsim flight model.
|
* Made a bit more progress towards integrating the LaRCsim flight model.
|
||||||
*
|
*
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
TARGET = stamp-done
|
TARGET = libcontrols.a
|
||||||
|
|
||||||
CFILES =
|
CFILES = controls.c
|
||||||
HFILES = controls.h
|
HFILES = controls.h
|
||||||
OFILES = $(CFILES:.c=.o)
|
OFILES = $(CFILES:.c=.o)
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ LIBS =
|
||||||
# Primary Targets
|
# Primary Targets
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
$(TARGET): $(OFILES) $(HFILES)
|
$(TARGET): $(OFILES)
|
||||||
touch stamp-done
|
$(AR) rv $(TARGET) $(OFILES)
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
@ -61,9 +61,15 @@ clean:
|
||||||
controls.h: ../limits.h
|
controls.h: ../limits.h
|
||||||
touch controls.h
|
touch controls.h
|
||||||
|
|
||||||
|
controls.o: controls.c controls.h ../aircraft/aircraft.h
|
||||||
|
$(CC) $(CFLAGS) $(INCLUDES) -c controls.c
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.3 1997/05/31 19:16:27 curt
|
||||||
|
# Elevator trim added.
|
||||||
|
#
|
||||||
# Revision 1.2 1997/05/23 15:40:32 curt
|
# Revision 1.2 1997/05/23 15:40:32 curt
|
||||||
# Added GNU copyright headers.
|
# Added GNU copyright headers.
|
||||||
#
|
#
|
||||||
|
|
|
@ -35,19 +35,58 @@
|
||||||
|
|
||||||
struct control_params {
|
struct control_params {
|
||||||
double aileron;
|
double aileron;
|
||||||
double elev;
|
double elevator;
|
||||||
|
double elevator_trim;
|
||||||
double rudder;
|
double rudder;
|
||||||
double throttle[MAX_ENGINES];
|
double throttle[FG_MAX_ENGINES];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define FG_Elevator c->elevator
|
||||||
|
#define FG_Aileron c->aileron
|
||||||
|
#define FG_Rudder c->rudder
|
||||||
|
#define FG_Throttle c->throttle
|
||||||
|
#define FG_Throttle_All -1
|
||||||
|
#define FG_Elev_Trim c->elevator_trim
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define Left_button cockpit_.left_pb_on_stick
|
||||||
|
#define Right_button cockpit_.right_pb_on_stick
|
||||||
|
#define First_trigger cockpit_.trig_pos_1
|
||||||
|
#define Second_trigger cockpit_.trig_pos_2
|
||||||
|
#define Left_trim cockpit_.left_trim
|
||||||
|
#define Right_trim cockpit_.right_trim
|
||||||
|
#define SB_extend cockpit_.sb_extend
|
||||||
|
#define SB_retract cockpit_.sb_retract
|
||||||
|
#define Gear_sel_up cockpit_.gear_sel_up
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
void fgControlsInit();
|
||||||
|
|
||||||
|
void fgElevMove(double amt);
|
||||||
|
void fgElevSet(double pos);
|
||||||
|
void fgElevTrimMove(double amt);
|
||||||
|
void fgElevTrimSet(double pos);
|
||||||
|
void fgAileronMove(double amt);
|
||||||
|
void fgAileronSet(double pos);
|
||||||
|
void fgRudderMove(double amt);
|
||||||
|
void fgRudderSet(double pos);
|
||||||
|
void fgThrottleMove(int engine, double amt);
|
||||||
|
void fgThrottleSet(int engine, double pos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif CONTROLS_H
|
#endif CONTROLS_H
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1997/05/23 15:40:33 curt
|
/* Revision 1.3 1997/05/31 19:16:27 curt
|
||||||
/* Added GNU copyright headers.
|
/* Elevator trim added.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1997/05/23 15:40:33 curt
|
||||||
|
* Added GNU copyright headers.
|
||||||
|
*
|
||||||
* Revision 1.1 1997/05/16 15:59:48 curt
|
* Revision 1.1 1997/05/16 15:59:48 curt
|
||||||
* Initial revision.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
|
|
||||||
$Header$
|
$Header$
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.2 1997/05/31 19:16:27 curt
|
||||||
|
Elevator trim added.
|
||||||
|
|
||||||
Revision 1.1 1997/05/29 00:09:54 curt
|
Revision 1.1 1997/05/29 00:09:54 curt
|
||||||
Initial Flight Gear revision.
|
Initial Flight Gear revision.
|
||||||
|
|
||||||
|
@ -53,6 +56,7 @@ Initial Flight Gear revision.
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float long_stick, lat_stick, rudder_pedal;
|
float long_stick, lat_stick, rudder_pedal;
|
||||||
|
float long_trim;
|
||||||
float throttle[4];
|
float throttle[4];
|
||||||
short forward_trim, aft_trim, left_trim, right_trim;
|
short forward_trim, aft_trim, left_trim, right_trim;
|
||||||
short left_pb_on_stick, right_pb_on_stick, trig_pos_1, trig_pos_2;
|
short left_pb_on_stick, right_pb_on_stick, trig_pos_1, trig_pos_2;
|
||||||
|
@ -70,6 +74,7 @@ extern COCKPIT cockpit_;
|
||||||
#define First_trigger cockpit_.trig_pos_1
|
#define First_trigger cockpit_.trig_pos_1
|
||||||
#define Second_trigger cockpit_.trig_pos_2
|
#define Second_trigger cockpit_.trig_pos_2
|
||||||
#define Long_control cockpit_.long_stick
|
#define Long_control cockpit_.long_stick
|
||||||
|
#define Long_trim cockpit_.long_trim
|
||||||
#define Lat_control cockpit_.lat_stick
|
#define Lat_control cockpit_.lat_stick
|
||||||
#define Fwd_trim cockpit_.forward_trim
|
#define Fwd_trim cockpit_.forward_trim
|
||||||
#define Aft_trim cockpit_.aft_trim
|
#define Aft_trim cockpit_.aft_trim
|
||||||
|
|
|
@ -501,10 +501,11 @@ int ls_cockpit() {
|
||||||
|
|
||||||
c = ¤t_aircraft.controls;
|
c = ¤t_aircraft.controls;
|
||||||
|
|
||||||
Lat_control = -c->aileron;
|
Lat_control = FG_Aileron;
|
||||||
Long_control = -c->elev;
|
Long_control = FG_Elevator;
|
||||||
Rudder_pedal = c->rudder;
|
Long_trim = FG_Elev_Trim;
|
||||||
Throttle_pct = c->throttle[0];
|
Rudder_pedal = FG_Rudder;
|
||||||
|
Throttle_pct = FG_Throttle[0];
|
||||||
|
|
||||||
/* printf("Mach = %.2f ", Mach_number);
|
/* printf("Mach = %.2f ", Mach_number);
|
||||||
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
|
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
|
||||||
|
@ -908,6 +909,9 @@ int fgLaRCsim_2_Flight (struct flight_params *f) {
|
||||||
/* Flight Gear Modification Log
|
/* Flight Gear Modification Log
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.7 1997/05/31 19:16:28 curt
|
||||||
|
* Elevator trim added.
|
||||||
|
*
|
||||||
* Revision 1.6 1997/05/31 04:13:53 curt
|
* Revision 1.6 1997/05/31 04:13:53 curt
|
||||||
* WE CAN NOW FLY!!!
|
* WE CAN NOW FLY!!!
|
||||||
*
|
*
|
||||||
|
|
|
@ -124,7 +124,7 @@ void aero()
|
||||||
static SCALAR scale = 1.0;
|
static SCALAR scale = 1.0;
|
||||||
|
|
||||||
static SCALAR trim_inc = 0.0002;
|
static SCALAR trim_inc = 0.0002;
|
||||||
static SCALAR long_trim;
|
/* static SCALAR long_trim; */
|
||||||
|
|
||||||
static DATA U_0;
|
static DATA U_0;
|
||||||
static DATA X_0;
|
static DATA X_0;
|
||||||
|
@ -183,10 +183,6 @@ void aero()
|
||||||
N_r = -0.7605;
|
N_r = -0.7605;
|
||||||
N_da = -0.2218;
|
N_da = -0.2218;
|
||||||
N_dr = -4.597;
|
N_dr = -4.597;
|
||||||
|
|
||||||
|
|
||||||
/* initialize trim 'actuator' */
|
|
||||||
long_trim = 1.969572E-03;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u = V_rel_wind - U_0;
|
u = V_rel_wind - U_0;
|
||||||
|
@ -196,8 +192,8 @@ void aero()
|
||||||
aileron = lat_scale * Lat_control;
|
aileron = lat_scale * Lat_control;
|
||||||
rudder = yaw_scale * Rudder_pedal;
|
rudder = yaw_scale * Rudder_pedal;
|
||||||
|
|
||||||
if(Aft_trim) long_trim = long_trim - trim_inc;
|
/* if(Aft_trim) long_trim = long_trim - trim_inc; */
|
||||||
if(Fwd_trim) long_trim = long_trim + trim_inc;
|
/* if(Fwd_trim) long_trim = long_trim + trim_inc; */
|
||||||
|
|
||||||
scale = V_rel_wind*V_rel_wind/(U_0*U_0);
|
scale = V_rel_wind*V_rel_wind/(U_0*U_0);
|
||||||
if (scale > 1.0) scale = 1.0; /* ebj */
|
if (scale > 1.0) scale = 1.0; /* ebj */
|
||||||
|
@ -209,7 +205,7 @@ void aero()
|
||||||
|
|
||||||
M_l_aero = scale*(I_xx*(L_beta*Beta + L_p*P_body + L_r*R_body
|
M_l_aero = scale*(I_xx*(L_beta*Beta + L_p*P_body + L_r*R_body
|
||||||
+ L_da*aileron + L_dr*rudder));
|
+ L_da*aileron + L_dr*rudder));
|
||||||
M_m_aero = scale*(M_0 + I_yy*(M_w*w + M_q*Q_body + M_de*(elevator + long_trim)));
|
M_m_aero = scale*(M_0 + I_yy*(M_w*w + M_q*Q_body + M_de*(elevator + Long_trim)));
|
||||||
M_n_aero = scale*(I_zz*(N_beta*Beta + N_p*P_body + N_r*R_body
|
M_n_aero = scale*(I_zz*(N_beta*Beta + N_p*P_body + N_r*R_body
|
||||||
+ N_da*aileron + N_dr*rudder));
|
+ N_da*aileron + N_dr*rudder));
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,4 @@ void model_init()
|
||||||
|
|
||||||
Dx_pilot = 0; Dy_pilot = 0; Dz_pilot = 0;
|
Dx_pilot = 0; Dy_pilot = 0; Dz_pilot = 0;
|
||||||
|
|
||||||
Runway_altitude = 0;
|
|
||||||
Runway_latitude = 0;
|
|
||||||
Runway_longitude = 0;
|
|
||||||
Runway_heading = 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,32 +43,39 @@ void GLUTkey(unsigned char k, int x, int y) {
|
||||||
|
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case 50: /* numeric keypad 2 */
|
case 50: /* numeric keypad 2 */
|
||||||
c->elev += 0.01;
|
fgElevMove(-0.01);
|
||||||
return;
|
return;
|
||||||
case 56: /* numeric keypad 8 */
|
case 56: /* numeric keypad 8 */
|
||||||
c->elev -= 0.01;
|
fgElevMove(0.01);
|
||||||
|
return;
|
||||||
|
case 49: /* numeric keypad 1 */
|
||||||
|
fgElevTrimMove(-0.001);
|
||||||
|
return;
|
||||||
|
case 55: /* numeric keypad 7 */
|
||||||
|
fgElevTrimMove(0.001);
|
||||||
return;
|
return;
|
||||||
case 52: /* numeric keypad 4 */
|
case 52: /* numeric keypad 4 */
|
||||||
c->aileron += 0.01;
|
fgAileronMove(-0.01);
|
||||||
return;
|
return;
|
||||||
case 54: /* numeric keypad 6 */
|
case 54: /* numeric keypad 6 */
|
||||||
c->aileron -= 0.01;
|
fgAileronMove(0.01);
|
||||||
return;
|
return;
|
||||||
case 48: /* numeric keypad Ins */
|
case 48: /* numeric keypad Ins */
|
||||||
c->rudder -= 0.01;
|
fgRudderMove(-0.01);
|
||||||
return;
|
return;
|
||||||
case 13: /* numeric keypad Enter */
|
case 13: /* numeric keypad Enter */
|
||||||
c->rudder += 0.01;
|
fgRudderMove(0.01);
|
||||||
return;
|
return;
|
||||||
case 53: /* numeric keypad 5 */
|
case 53: /* numeric keypad 5 */
|
||||||
c->aileron = 0.0;
|
fgAileronSet(0.0);
|
||||||
c->elev = 0.0;
|
fgElevSet(0.0);
|
||||||
c->rudder = 0.0;
|
fgRudderSet(0.0);
|
||||||
|
return;
|
||||||
case 57: /* numeric keypad 9 (Pg Up) */
|
case 57: /* numeric keypad 9 (Pg Up) */
|
||||||
c->throttle[0] += 0.05;
|
fgThrottleMove(0, 0.01);
|
||||||
return;
|
return;
|
||||||
case 51: /* numeric keypad 3 (Pg Dn) */
|
case 51: /* numeric keypad 3 (Pg Dn) */
|
||||||
c->throttle[0] -= 0.05;
|
fgThrottleMove(0, -0.01);
|
||||||
return;
|
return;
|
||||||
case 122:
|
case 122:
|
||||||
fogDensity *= 1.10;
|
fogDensity *= 1.10;
|
||||||
|
@ -97,16 +104,16 @@ void GLUTspecialkey(unsigned char k, int x, int y) {
|
||||||
|
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case GLUT_KEY_UP:
|
case GLUT_KEY_UP:
|
||||||
c->elev -= 0.01;
|
fgElevMove(0.01);
|
||||||
return;
|
return;
|
||||||
case GLUT_KEY_DOWN:
|
case GLUT_KEY_DOWN:
|
||||||
c->elev += 0.01;
|
fgElevMove(-0.01);
|
||||||
return;
|
return;
|
||||||
case GLUT_KEY_LEFT:
|
case GLUT_KEY_LEFT:
|
||||||
c->aileron += 0.01;
|
fgAileronMove(-0.01);
|
||||||
return;
|
return;
|
||||||
case GLUT_KEY_RIGHT:
|
case GLUT_KEY_RIGHT:
|
||||||
c->aileron -= 0.01;
|
fgAileronMove(0.01);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,12 +121,15 @@ void GLUTspecialkey(unsigned char k, int x, int y) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.6 1997/05/31 04:13:52 curt
|
/* Revision 1.7 1997/05/31 19:16:25 curt
|
||||||
/* WE CAN NOW FLY!!!
|
/* Elevator trim added.
|
||||||
/*
|
|
||||||
/* Continuing work on the LaRCsim flight model integration.
|
|
||||||
/* Added some MSFS-like keyboard input handling.
|
|
||||||
/*
|
/*
|
||||||
|
* 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
|
* Revision 1.5 1997/05/30 23:26:19 curt
|
||||||
* Added elevator/aileron controls.
|
* Added elevator/aileron controls.
|
||||||
*
|
*
|
||||||
|
|
|
@ -49,8 +49,8 @@
|
||||||
#include "../mat3/mat3.h"
|
#include "../mat3/mat3.h"
|
||||||
|
|
||||||
|
|
||||||
#define FG_RAD_2_DEG(RAD) ((RAD) * 180.0 / M_PI)
|
#define DEG_TO_RAD 0.017453292
|
||||||
#define FG_DEG_2_RAD(DEG) ((DEG) * M_PI / 180.0)
|
#define RAD_TO_DEG 57.29577951
|
||||||
|
|
||||||
/* This is a record containing all the info for the aircraft currently
|
/* This is a record containing all the info for the aircraft currently
|
||||||
being operated */
|
being operated */
|
||||||
|
@ -124,7 +124,6 @@ static void fgUpdateViewParams() {
|
||||||
struct flight_params *f;
|
struct flight_params *f;
|
||||||
MAT3mat R, tmp;
|
MAT3mat R, tmp;
|
||||||
MAT3vec vec, forward, up;
|
MAT3vec vec, forward, up;
|
||||||
MAT3hvec sun;
|
|
||||||
|
|
||||||
f = ¤t_aircraft.flight;
|
f = ¤t_aircraft.flight;
|
||||||
|
|
||||||
|
@ -137,8 +136,8 @@ static void fgUpdateViewParams() {
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
/* calculate position in arc seconds */
|
/* calculate position in arc seconds */
|
||||||
pos_x = FG_RAD_2_DEG(FG_Longitude) * 3600.0;
|
pos_x = (FG_Longitude * RAD_TO_DEG) * 3600.0;
|
||||||
pos_y = FG_RAD_2_DEG(FG_Latitude) * 3600.0;
|
pos_y = (FG_Latitude * RAD_TO_DEG) * 3600.0;
|
||||||
pos_z = FG_Altitude * 0.01; /* (Convert feet to aproximate arcsecs) */
|
pos_z = FG_Altitude * 0.01; /* (Convert feet to aproximate arcsecs) */
|
||||||
|
|
||||||
/* build current rotation matrix */
|
/* build current rotation matrix */
|
||||||
|
@ -353,16 +352,21 @@ int main( int argc, char *argv[] ) {
|
||||||
/* setup view parameters, only makes GL calls */
|
/* setup view parameters, only makes GL calls */
|
||||||
fgInitVisuals();
|
fgInitVisuals();
|
||||||
|
|
||||||
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
|
/* Globe Aiport, AZ */
|
||||||
|
FG_Runway_altitude = 3234.5;
|
||||||
|
FG_Runway_latitude = 120070.41;
|
||||||
|
FG_Runway_longitude = -398391.28;
|
||||||
|
FG_Runway_heading = 102.0 * DEG_TO_RAD;
|
||||||
|
|
||||||
/* Initial Position */
|
/* Initial Position */
|
||||||
FG_Latitude = FG_DEG_2_RAD( 120625.64 / 3600.0 );
|
FG_Latitude = ( 120070.41 / 3600.0 ) * DEG_TO_RAD;
|
||||||
FG_Longitude = FG_DEG_2_RAD( -398673.28 / 3600.0 );
|
FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
|
||||||
FG_Altitude = 3.758099E+00;
|
FG_Altitude = FG_Runway_altitude + 3.758099;
|
||||||
|
|
||||||
printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude,
|
printf("Initial position is: (%.4f, %.4f, %.2f)\n", FG_Latitude,
|
||||||
FG_Longitude, FG_Altitude);
|
FG_Longitude, FG_Altitude);
|
||||||
|
|
||||||
|
|
||||||
/* Initial Velocity */
|
/* Initial Velocity */
|
||||||
FG_V_north = 0.0 /* 7.287719E+00 */;
|
FG_V_north = 0.0 /* 7.287719E+00 */;
|
||||||
FG_V_east = 0.0 /* 1.521770E+03 */;
|
FG_V_east = 0.0 /* 1.521770E+03 */;
|
||||||
|
@ -371,7 +375,7 @@ int main( int argc, char *argv[] ) {
|
||||||
/* Initial Orientation */
|
/* Initial Orientation */
|
||||||
FG_Phi = -2.658474E-06;
|
FG_Phi = -2.658474E-06;
|
||||||
FG_Theta = 7.401790E-03;
|
FG_Theta = 7.401790E-03;
|
||||||
FG_Psi = 2.14 /* 4.38 */;
|
FG_Psi = 102.0 * DEG_TO_RAD;
|
||||||
|
|
||||||
/* Initial Angular B rates */
|
/* Initial Angular B rates */
|
||||||
FG_P_body = 7.206685E-05;
|
FG_P_body = 7.206685E-05;
|
||||||
|
@ -393,7 +397,7 @@ int main( int argc, char *argv[] ) {
|
||||||
FG_Dz_cg = 0.000000E+00;
|
FG_Dz_cg = 0.000000E+00;
|
||||||
|
|
||||||
/* Set initial position and slew parameters */
|
/* Set initial position and slew parameters */
|
||||||
/* fgSlewInit(-398391.3, 120070.4, 244, 3.1415); */ /* GLOBE Airport */
|
/* fgSlewInit(-398391.3, 120070.41, 244, 3.1415); */ /* GLOBE Airport */
|
||||||
/* fgSlewInit(-335340,162540, 15, 4.38); */
|
/* fgSlewInit(-335340,162540, 15, 4.38); */
|
||||||
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
|
/* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
|
||||||
|
|
||||||
|
@ -446,12 +450,15 @@ int main( int argc, char *argv[] ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.10 1997/05/31 04:13:52 curt
|
/* Revision 1.11 1997/05/31 19:16:25 curt
|
||||||
/* WE CAN NOW FLY!!!
|
/* Elevator trim added.
|
||||||
/*
|
|
||||||
/* Continuing work on the LaRCsim flight model integration.
|
|
||||||
/* Added some MSFS-like keyboard input handling.
|
|
||||||
/*
|
/*
|
||||||
|
* 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
|
* Revision 1.9 1997/05/30 19:27:01 curt
|
||||||
* The LaRCsim flight model is starting to look like it is working.
|
* The LaRCsim flight model is starting to look like it is working.
|
||||||
*
|
*
|
||||||
|
|
|
@ -66,9 +66,9 @@ LIBS = $(INTERFACE_LIBS) $(GRAPHICS_LIBS) -lm -lfl
|
||||||
|
|
||||||
CFILES = GLmain.c $(INTERFACE_FILES) mesh2GL.c
|
CFILES = GLmain.c $(INTERFACE_FILES) mesh2GL.c
|
||||||
OFILES = $(CFILES:.c=.o)
|
OFILES = $(CFILES:.c=.o)
|
||||||
AFILES = ../aircraft/libaircraft.a ../flight/libflight.a \
|
AFILES = ../aircraft/libaircraft.a ../controls/libcontrols.a \
|
||||||
../flight/LaRCsim/libLaRCsim.a ../flight/slew/libslew.a \
|
../flight/libflight.a ../flight/LaRCsim/libLaRCsim.a \
|
||||||
../mat3/libmat3.a ../scenery/libscenery.a
|
../flight/slew/libslew.a ../mat3/libmat3.a ../scenery/libscenery.a
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
@ -103,6 +103,9 @@ mesh2GL.o: mesh2GL.c ../scenery/mesh.h
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.11 1997/05/31 19:16:25 curt
|
||||||
|
# Elevator trim added.
|
||||||
|
#
|
||||||
# Revision 1.10 1997/05/31 04:13:53 curt
|
# Revision 1.10 1997/05/31 04:13:53 curt
|
||||||
# WE CAN NOW FLY!!!
|
# WE CAN NOW FLY!!!
|
||||||
#
|
#
|
||||||
|
|
|
@ -44,7 +44,7 @@ GLint mesh2GL(struct mesh *m) {
|
||||||
int i, j, istep, jstep, iend, jend;
|
int i, j, istep, jstep, iend, jend;
|
||||||
float temp;
|
float temp;
|
||||||
|
|
||||||
istep = jstep = 12; /* Detail level 1 -- 1200 ... */
|
istep = jstep = 50; /* Detail level 1 -- 1200 ... */
|
||||||
|
|
||||||
mesh = glGenLists(1);
|
mesh = glGenLists(1);
|
||||||
glNewList(mesh, GL_COMPILE);
|
glNewList(mesh, GL_COMPILE);
|
||||||
|
@ -75,18 +75,18 @@ GLint mesh2GL(struct mesh *m) {
|
||||||
|
|
||||||
if ( j == 0 ) {
|
if ( j == 0 ) {
|
||||||
/* first time through */
|
/* first time through */
|
||||||
glVertex3f(x1, y1, z11-45);
|
glVertex3f(x1, y1, z11);
|
||||||
glVertex3f(x1, y2, z12-45);
|
glVertex3f(x1, y2, z12);
|
||||||
}
|
}
|
||||||
|
|
||||||
glVertex3f(x2, y1, z21-45);
|
glVertex3f(x2, y1, z21);
|
||||||
|
|
||||||
v1[0] = x2 - x1; v1[1] = y1 - y2; v1[2] = z21 - z12;
|
v1[0] = x2 - x1; v1[1] = y1 - y2; v1[2] = z21 - z12;
|
||||||
v2[0] = x2 - x1; v2[1] = 0; v2[2] = z22 - z12;
|
v2[0] = x2 - x1; v2[1] = 0; v2[2] = z22 - z12;
|
||||||
MAT3cross_product(normal, v1, v2);
|
MAT3cross_product(normal, v1, v2);
|
||||||
MAT3_NORMALIZE_VEC(normal,temp);
|
MAT3_NORMALIZE_VEC(normal,temp);
|
||||||
glNormal3d(normal[0], normal[1], normal[2]);
|
glNormal3d(normal[0], normal[1], normal[2]);
|
||||||
glVertex3f(x2, y2, z22-45);
|
glVertex3f(x2, y2, z22);
|
||||||
|
|
||||||
x1 = x2;
|
x1 = x2;
|
||||||
x2 = x1 + (m->row_step * jstep);
|
x2 = x1 + (m->row_step * jstep);
|
||||||
|
@ -104,12 +104,15 @@ GLint mesh2GL(struct mesh *m) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.13 1997/05/31 04:13:53 curt
|
/* Revision 1.14 1997/05/31 19:16:26 curt
|
||||||
/* WE CAN NOW FLY!!!
|
/* Elevator trim added.
|
||||||
/*
|
|
||||||
/* Continuing work on the LaRCsim flight model integration.
|
|
||||||
/* Added some MSFS-like keyboard input handling.
|
|
||||||
/*
|
/*
|
||||||
|
* 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
|
* Revision 1.12 1997/05/30 23:26:20 curt
|
||||||
* Added elevator/aileron controls.
|
* Added elevator/aileron controls.
|
||||||
*
|
*
|
||||||
|
|
|
@ -36,8 +36,8 @@ CC = gcc
|
||||||
CFLAGS = -g -Wall
|
CFLAGS = -g -Wall
|
||||||
# CFLAGS = -O2 -Wall
|
# CFLAGS = -O2 -Wall
|
||||||
|
|
||||||
FLEX = flex -f
|
FLEX = flex -f -L
|
||||||
BISON = bison -v
|
BISON = bison -v --no-lines
|
||||||
AR = ar
|
AR = ar
|
||||||
|
|
||||||
INCLUDES =
|
INCLUDES =
|
||||||
|
@ -57,6 +57,9 @@ $(TARGET): $(OFILES) $(HFILES)
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(TARGET) parser.output *~ core
|
rm -f *.o $(TARGET) parser.output *~ core
|
||||||
|
|
||||||
|
realclean: clean
|
||||||
|
rm -f scanner.c parser.c
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Secondary Targets
|
# Secondary Targets
|
||||||
|
@ -86,6 +89,9 @@ mesh.o: mesh.c mesh.h common.h
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.5 1997/05/31 19:16:29 curt
|
||||||
|
# Elevator trim added.
|
||||||
|
#
|
||||||
# Revision 1.4 1997/05/27 17:48:50 curt
|
# Revision 1.4 1997/05/27 17:48:50 curt
|
||||||
# Added -f flag to flex to generate a "fast" scanner.
|
# Added -f flag to flex to generate a "fast" scanner.
|
||||||
#
|
#
|
||||||
|
|
|
@ -29,16 +29,19 @@
|
||||||
|
|
||||||
|
|
||||||
/* Maximum number of engines for a single aircraft */
|
/* Maximum number of engines for a single aircraft */
|
||||||
#define MAX_ENGINES 10
|
#define FG_MAX_ENGINES 10
|
||||||
|
|
||||||
|
|
||||||
#endif LIMITS_H
|
#endif LIMITS_H
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1997/05/27 17:48:10 curt
|
/* Revision 1.3 1997/05/31 19:16:24 curt
|
||||||
/* Added GNU copyright.
|
/* Elevator trim added.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1997/05/27 17:48:10 curt
|
||||||
|
* Added GNU copyright.
|
||||||
|
*
|
||||||
* Revision 1.1 1997/05/16 16:08:00 curt
|
* Revision 1.1 1997/05/16 16:08:00 curt
|
||||||
* Initial revision.
|
* Initial revision.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue