diff --git a/src/FGFDMExec.cpp b/src/FGFDMExec.cpp index 9c1dcc6dcc..a34a91e55b 100644 --- a/src/FGFDMExec.cpp +++ b/src/FGFDMExec.cpp @@ -571,6 +571,7 @@ void FGFDMExec::LoadInputs(unsigned int idx) MassBalance->in.TanksWeight = Propulsion->GetTanksWeight(); MassBalance->in.TanksMoment = Propulsion->GetTanksMoment(); MassBalance->in.TankInertia = Propulsion->CalculateTankInertias(); + MassBalance->in.WOW = GroundReactions->GetWOW(); break; case eAircraft: Aircraft->in.AeroForce = Aerodynamics->GetForces(); diff --git a/src/models/FGMassBalance.cpp b/src/models/FGMassBalance.cpp index 2bfc664b88..ffed2a4112 100644 --- a/src/models/FGMassBalance.cpp +++ b/src/models/FGMassBalance.cpp @@ -42,7 +42,6 @@ INCLUDES #include "FGMassBalance.h" #include "FGFDMExec.h" -#include "FGGroundReactions.h" #include "input_output/FGXMLElement.h" using namespace std; @@ -55,7 +54,7 @@ CLASS IMPLEMENTATION FGMassBalance::FGMassBalance(FGFDMExec* fdmex) - : FGModel(fdmex), GroundReactions(nullptr) + : FGModel(fdmex) { Name = "FGMassBalance"; Weight = EmptyWeight = Mass = 0.0; @@ -90,7 +89,6 @@ bool FGMassBalance::InitModel(void) { if (!FGModel::InitModel()) return false; - GroundReactions = FDMExec->GetGroundReactions(); vLastXYZcg.InitMatrix(); vDeltaXYZcg.InitMatrix(); @@ -211,7 +209,7 @@ bool FGMassBalance::Run(bool Holding) // Compensate displacements of the structural frame when the mass distribution // is modified while the aircraft is in contact with the ground. - if (FDMExec->GetHoldDown() || GroundReactions->GetWOW()) + if (FDMExec->GetHoldDown() || in.WOW) Propagate->NudgeBodyLocation(vDeltaXYZcgBody); // Calculate new total moments of inertia diff --git a/src/models/FGMassBalance.h b/src/models/FGMassBalance.h index 6d57d602a3..90c6df5774 100644 --- a/src/models/FGMassBalance.h +++ b/src/models/FGMassBalance.h @@ -190,11 +190,11 @@ class FGMassBalance : public FGModel FGMatrix33 GasInertia; FGColumnVector3 TanksMoment; FGMatrix33 TankInertia; + bool WOW; } in; private: std::shared_ptr Propagate; - std::shared_ptr GroundReactions; double Weight; double EmptyWeight; double Mass;