]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGAuxiliary.cpp
Moved JSBSim.hxx to src/FDM/JSBSim/
[flightgear.git] / src / FDM / JSBSim / FGAuxiliary.cpp
index d744579d36a3d63647cfc2c67f444e4143838778..fd8e65a3fd7606090fad74487a4f34ca72fd3981 100644 (file)
@@ -145,14 +145,19 @@ 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();
+      vToEyePt *= inchtoft;
+      vPilotAccel =  Aerodynamics->GetForces() 
+                  +  Propulsion->GetForces()
+                  +  GroundReactions->GetForces();
+      vPilotAccel /= MassBalance->GetMass();
+      vPilotAccel += Rotation->GetPQRdot() * vToEyePt;
+      vPilotAccel += Rotation->GetPQR() * (Rotation->GetPQR() * vToEyePt);
+      //vPilotAccel(2)*=-1;
+    }
     earthPosAngle += State->Getdt()*Inertial->omega();
     return false;
   } else {