]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGInertial.cpp
Removed useless divisions - As a side effect, it removes the risk of divisions by...
[flightgear.git] / src / FDM / JSBSim / models / FGInertial.cpp
index 0779c695492960ea1159ef3e5e38bca47a46cf56..93874c12064cbcffef39f728d0626fcb2da75ed1 100644 (file)
@@ -45,7 +45,7 @@ using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id: FGInertial.cpp,v 1.19 2010/10/10 15:06:38 jberndt Exp $";
+static const char *IdSrc = "$Id: FGInertial.cpp,v 1.21 2011/05/20 03:18:36 jberndt Exp $";
 static const char *IdHdr = ID_INERTIAL;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -98,8 +98,6 @@ FGInertial::~FGInertial(void)
 
 bool FGInertial::InitModel(void)
 {
-  if (!FGModel::InitModel()) return false;
-
   earthPosAngle   = 0.0;
 
   return true;
@@ -107,16 +105,16 @@ bool FGInertial::InitModel(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGInertial::Run(void)
+bool FGInertial::Run(bool Holding)
 {
   // Fast return if we have nothing to do ...
-  if (FGModel::Run()) return true;
-  if (FDMExec->Holding()) return false;
+  if (FGModel::Run(Holding)) return true;
+  if (Holding) return false;
 
   RunPreFunctions();
 
   // Gravitation accel
-  double r = Propagate->GetRadius();
+  double r = FDMExec->GetPropagate()->GetRadius();
   gAccel = GetGAccel(r);
   earthPosAngle += FDMExec->GetDeltaT()*RotationRate;
 
@@ -145,7 +143,7 @@ FGColumnVector3 FGInertial::GetGravityJ2(FGColumnVector3 position) const
 
   // Gravitation accel
   double r = position.Magnitude();
-  double lat = Propagate->GetLatitude();
+  double lat = FDMExec->GetPropagate()->GetLatitude();
   double sinLat = sin(lat);
 
   double adivr = a/r;