#include "ls_aux.h"
#include "ls_model.h"
#include "ls_init.h"
-#include <Flight/flight.h>
-#include <Aircraft/aircraft.h>
+
+// #include <Flight/flight.h>
+// #include <Aircraft/aircraft.h>
+// #include <Debug/fg_debug.h>
+
/* global variable declarations */
int ls_cockpit( void ) {
- fgCONTROLS *c;
+ // fgCONTROLS *c;
sim_control_.paused = 0;
- c = current_aircraft.controls;
+ // c = current_aircraft.controls;
- Lat_control = FG_Aileron;
- Long_control = FG_Elevator;
- Long_trim = FG_Elev_Trim;
- Rudder_pedal = FG_Rudder;
- Throttle_pct = FG_Throttle[0];
+ // Lat_control = FG_Aileron;
+ // Long_control = FG_Elevator;
+ // Long_trim = FG_Elev_Trim;
+ // Rudder_pedal = FG_Rudder;
+ // Throttle_pct = FG_Throttle[0];
/* printf("Mach = %.2f ", Mach_number);
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude);
/* Initialize the LaRCsim flight model, dt is the time increment for
each subsequent iteration through the EOM */
-int fgLaRCsimInit(double dt) {
+int ls_toplevel_init(double dt) {
model_dt = dt;
ls_setdefopts(); /* set default options */
return 1;
}
- printf("LS pre Init pos = %.2f\n", Latitude);
+ /* printf("LS pre Init pos = %.2f\n", Latitude); */
ls_init();
- printf("LS post Init pos = %.2f\n", Latitude);
+ /* printf("LS post Init pos = %.2f\n", Latitude); */
if (speedup > 0) {
/* Initialize (get) cockpit (controls) settings */
/* Run an iteration of the EOM (equations of motion) */
-int fgLaRCsimUpdate(int multiloop) {
+int ls_update(int multiloop) {
int i;
if (speedup > 0) {
ls_loop( model_dt, 0);
}
- return(1);
+ return 1;
}
+#if 0
/* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (fgFLIGHT *f) {
Mass = FG_Mass;
return ( 0 );
}
+#endif
+
+/* Set the altitude (force) */
+int ls_ForceAltitude(double alt_feet) {
+ Altitude = alt_feet;
+ ls_geod_to_geoc( Latitude, Altitude, &Sea_level_radius, &Lat_geocentric);
+ Radius_to_vehicle = Altitude + Sea_level_radius;
+}
+
/* Flight Gear Modification Log
*
* $Log$
+ * Revision 1.23 1998/10/16 23:27:44 curt
+ * C++-ifying.
+ *
+ * Revision 1.22 1998/09/29 02:02:59 curt
+ * Added a brake + autopilot mods.
+ *
+ * Revision 1.21 1998/08/22 14:49:56 curt
+ * Attempting to iron out seg faults and crashes.
+ * Did some shuffling to fix a initialization order problem between view
+ * position, scenery elevation.
+ *
+ * Revision 1.20 1998/07/12 03:11:03 curt
+ * Removed some printf()'s.
+ * Fixed the autopilot integration so it should be able to update it's control
+ * positions every time the internal flight model loop is run, and not just
+ * once per rendered frame.
+ * Added a routine to do the necessary stuff to force an arbitrary altitude
+ * change.
+ * Gave the Navion engine just a tad more power.
+ *
+ * Revision 1.19 1998/05/11 18:17:28 curt
+ * Output message tweaking.
+ *
+ * Revision 1.18 1998/04/21 16:59:38 curt
+ * Integrated autopilot.
+ * Prepairing for C++ integration.
+ *
* Revision 1.17 1998/02/23 19:07:58 curt
* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
* calculation code between sun display, and other FG sections that use this