]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGTranslation.cpp
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGTranslation.cpp
index 9cdaf9e4ff391f5717c8085ab72c923be29ae91f..4042a02d0c60f7939d45867b924cd75a5a9369a1 100644 (file)
@@ -70,6 +70,8 @@ INCLUDES
 #include "FGOutput.h"
 #include "FGPropertyManager.h"
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_TRANSLATION;
 
@@ -93,6 +95,7 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex)
   vUVWdot_prev[0].InitMatrix();
   vUVWdot_prev[1].InitMatrix();
   vUVWdot_prev[2].InitMatrix();
+  vUVWdot_prev[3].InitMatrix();
 
   bind();
   Debug(0);
@@ -158,6 +161,9 @@ bool FGTranslation::Run(void)
     qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
     qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
     Mach = Vt / State->Geta();
+    vMachUVW(eU) = vAeroUVW(eU) / State->Geta();
+    vMachUVW(eV) = vAeroUVW(eV) / State->Geta();
+    vMachUVW(eW) = vAeroUVW(eW) / State->Geta();
 
     if (debug_lvl > 1) Debug(1);
 
@@ -258,6 +264,7 @@ void FGTranslation::unbind(void)
   PropertyManager->Untie("velocities/mach-norm");
   PropertyManager->Untie("aero/alphadot-rad_sec");
   PropertyManager->Untie("aero/betadot-rad_sec");
+  PropertyManager->Untie("aero/mag-beta-rad");
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -321,4 +328,4 @@ void FGTranslation::Debug(int from)
     }
   }
 }
-
+}