]> git.mxchange.org Git - flightgear.git/commitdiff
Updates so that JSBsim can work.
authorcurt <curt>
Sat, 31 Jul 1999 04:56:13 +0000 (04:56 +0000)
committercurt <curt>
Sat, 31 Jul 1999 04:56:13 +0000 (04:56 +0000)
src/FDM/JSBSim.cxx
src/FDM/JSBSim.hxx
src/FDM/flight.cxx

index 934645318a35fd3ae066269be40c21756d5af982..62289168ab157067e535bea24b9498fcf7fdb113 100644 (file)
@@ -54,7 +54,7 @@ FGFDMExec FDMExec;
 
 // Initialize the JSBsim flight model, dt is the time increment for
 // each subsequent iteration through the EOM
-int fgJSBsimInit(double dt) {
+int fgJSBsimInit(double dt, FGInterface& f) {
     FG_LOG( FG_FLIGHT, FG_INFO, "Starting initializing JSBsim" );
 
     FG_LOG( FG_FLIGHT, FG_INFO, "  created FDMExec" );
@@ -69,7 +69,27 @@ int fgJSBsimInit(double dt) {
                                          engine_path.str(), "X15");
     FG_LOG( FG_FLIGHT, FG_INFO, "  loaded aircraft" );
 
-    FDMExec.GetState()->Reset(aircraft_path.str(), "Reset00");
+//    FDMExec.GetState()->Reset(aircraft_path.str(), "Reset00");
+
+    FDMExec.GetState()->Initialize(
+      current_options.get_uBody(),
+      current_options.get_vBody(),
+      current_options.get_wBody(),
+      f.get_Phi(),
+      f.get_Theta(),
+      f.get_Psi(),
+      f.get_Latitude() * RAD_TO_DEG,
+      f.get_Longitude() * RAD_TO_DEG,
+      f.get_Altitude()
+    );
+
+//    FDMExec.GetState()->Setlatitude(f.get_Latitude());
+//    FDMExec.GetState()->Setlongitude(f.get_Longitude());
+//    FDMExec.GetState()->Seth(f.get_Altitude());
+//    FDMExec.GetRotation()->Setphi(f.get_Phi());
+//    FDMExec.GetRotation()->Settht(f.get_Theta());
+//    FDMExec.GetRotation()->Setpsi(f.get_Psi());
+
     FG_LOG( FG_FLIGHT, FG_INFO, "  loaded initial conditions" );
 
     FDMExec.GetState()->Setdt(dt);
index ac2dd051a1d7fe41b974301907a668960fa670f8..8f416abaf838efc6a9151ed4a95e5957fba281cc 100644 (file)
@@ -31,7 +31,7 @@
 
 
 // reset flight params to a specific position 
-int fgJSBsimInit(double dt);
+int fgJSBsimInit(double dt, FGInterface& f);
 
 // update position based on inputs, positions, velocities, etc.
 int fgJSBsimUpdate(FGInterface& f, int multiloop);
index 530b7ae6e131d9d72b9b38e74237a2f73b24ea40..ccc3f908c4f44f3b0aba492f96cb3b27120d2c0f 100644 (file)
@@ -86,7 +86,7 @@ int fgFDMInit(int model, FGInterface& f, double dt) {
        // fgSlewInit(dt);
 #ifndef __MWERKS__   // -dw- 04/22/99 JSB sim not ported yet
     } else if ( model == FGInterface::FG_JSBSIM ) {
-       fgJSBsimInit(dt);
+       fgJSBsimInit(dt, f);
        fgJSBsim_2_FGInterface(base_fdm_state);
 #endif
     } else if ( model == FGInterface::FG_LARCSIM ) {