X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGInertial.cpp;h=93874c12064cbcffef39f728d0626fcb2da75ed1;hb=fac1525fde5f30d10c5431c5b02f85abd7589e63;hp=ab2670eb97700868ada2dc29b2ef43ad121e1157;hpb=a61f34667fdb43198f707e719f56f5bbaf2fb7b5;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGInertial.cpp b/src/FDM/JSBSim/models/FGInertial.cpp index ab2670eb9..93874c120 100644 --- a/src/FDM/JSBSim/models/FGInertial.cpp +++ b/src/FDM/JSBSim/models/FGInertial.cpp @@ -45,7 +45,7 @@ using namespace std; namespace JSBSim { -static const char *IdSrc = "$Id: FGInertial.cpp,v 1.18 2010/03/28 05:57:00 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,10 +143,11 @@ 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 preCommon = 1.5*J2*(a/r)*(a/r); + double adivr = a/r; + double preCommon = 1.5*J2*adivr*adivr; double xy = 1.0 - 5.0*(sinLat*sinLat); double z = 3.0 - 5.0*(sinLat*sinLat); double GMOverr2 = GM/(r*r);