]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGBuoyantForces.cpp
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / FGBuoyantForces.cpp
index 96fd81d67cc756db3220ba4a483fe611c0146b5e..b5081760850183e647859ae7b12e9147b969d9d7 100644 (file)
@@ -5,7 +5,7 @@
  Date started: 01/21/08
  Purpose:      Encapsulates the buoyant forces
 
- ------------- Copyright (C) 2008 - 2010  Anders Gidenstam        -------------
+ ------------- Copyright (C) 2008 - 2011  Anders Gidenstam        -------------
  ------------- Copyright (C) 2008  Jon S. Berndt (jon@jsbsim.org) -------------
 
  This program is free software; you can redistribute it and/or modify it under
@@ -45,7 +45,7 @@ using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id: FGBuoyantForces.cpp,v 1.17 2011/05/20 03:18:36 jberndt Exp $";
+static const char *IdSrc = "$Id: FGBuoyantForces.cpp,v 1.21 2011/10/31 14:54:41 bcoconni Exp $";
 static const char *IdHdr = ID_BUOYANTFORCES;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -131,7 +131,7 @@ bool FGBuoyantForces::Load(Element *element)
   gas_cell_element = document->FindElement("gas_cell");
   while (gas_cell_element) {
     NoneDefined = false;
-    Cells.push_back(new FGGasCell(FDMExec, gas_cell_element, Cells.size()));
+    Cells.push_back(new FGGasCell(FDMExec, gas_cell_element, Cells.size(), in));
     gas_cell_element = document->FindNextElement("gas_cell");
   }
   
@@ -146,7 +146,7 @@ bool FGBuoyantForces::Load(Element *element)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-double FGBuoyantForces::GetGasMass(void)
+double FGBuoyantForces::GetGasMass(void) const
 {
   double Gw = 0.0;
 
@@ -179,16 +179,7 @@ const FGMatrix33& FGBuoyantForces::GetGasMassInertia(void)
   gasCellJ = FGMatrix33();
 
   for (unsigned int i=0; i < size; i++) {
-    FGColumnVector3 v = FDMExec->GetMassBalance()->StructuralToBody( Cells[i]->GetXYZ() );
-    // Body basis is in FT. 
-    const double mass = Cells[i]->GetMass();
-    
-    // FIXME: Verify that this is the correct way to change between the
-    //        coordinate frames.
-    gasCellJ += Cells[i]->GetInertia() + 
-      FGMatrix33( 0,                - mass*v(1)*v(2), - mass*v(1)*v(3),
-                  - mass*v(2)*v(1), 0,                - mass*v(2)*v(3),
-                  - mass*v(3)*v(1), - mass*v(3)*v(2), 0 );
+    gasCellJ += Cells[i]->GetInertia();
   }
   
   return gasCellJ;
@@ -196,7 +187,7 @@ const FGMatrix33& FGBuoyantForces::GetGasMassInertia(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGBuoyantForces::GetBuoyancyStrings(string delimeter)
+string FGBuoyantForces::GetBuoyancyStrings(const string& delimeter)
 {
   string CoeffStrings = "";
 /*
@@ -226,7 +217,7 @@ string FGBuoyantForces::GetBuoyancyStrings(string delimeter)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-string FGBuoyantForces::GetBuoyancyValues(string delimeter)
+string FGBuoyantForces::GetBuoyancyValues(const string& delimeter)
 {
   string SDValues = "";
 /*