]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAuxiliary.cpp
Latest JSBSim changes, including a kludge from Tony to keep the
[flightgear.git] / src / FDM / JSBSim / FGAuxiliary.cpp
index d744579d36a3d63647cfc2c67f444e4143838778..84232e89b14ae52b2114d6976a70add99bf91674 100644 (file)
@@ -145,14 +145,18 @@ bool FGAuxiliary::Run()
     // mass, the acceleration vector is calculated. The term wdot is equivalent
     // to the JSBSim vPQRdot vector, and the w parameter is equivalent to vPQR.
     // The radius R is calculated below in the vector vToEyePt.
-        
-    vToEyePt = Aircraft->GetXYZep() - MassBalance->GetXYZcg();
-
-    vPilotAccel = Aircraft->GetBodyAccel()
-                  + Rotation->GetPQRdot() * vToEyePt
-                  + Rotation->GetPQR() * (Rotation->GetPQR() * vToEyePt)
-                  + Inertial->GetGravity();
-
+    
+    vPilotAccel.InitMatrix();   
+    if( Translation->GetVt() > 1 ) {
+      vToEyePt = Aircraft->GetXYZep() - MassBalance->GetXYZcg();
+
+      vPilotAccel =  Aerodynamics->GetForces() 
+                  +  Propulsion->GetForces()
+                  +  GroundReactions->GetForces();
+      vPilotAccel /= MassBalance->GetMass();
+      vPilotAccel += Rotation->GetPQRdot() * vToEyePt;
+      vPilotAccel += Rotation->GetPQR() * (Rotation->GetPQR() * vToEyePt);
+    }
     earthPosAngle += State->Getdt()*Inertial->omega();
     return false;
   } else {