]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPropagate.cpp
Make yasim accept the launchbar and hook properties. They are not tied to anything...
[flightgear.git] / src / FDM / JSBSim / FGPropagate.cpp
index e97184031a387bbc4dc65f399591e3587b4913fa..3890d6e64384bbb2330dcc338cf8c965ab8439ed 100644 (file)
@@ -152,6 +152,9 @@ void FGPropagate::SetInitialState(const FGInitialCondition *FGIC)
 
   // Compute some derived values.
   vVel = VState.vQtrn.GetTInv()*VState.vUVW;
+
+  // Finaly make shure that the quaternion stays normalized.
+  VState.vQtrn.Normalize();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -207,12 +210,12 @@ bool FGPropagate::Run(void)
   // Compute body frame accelerations based on the current body forces
   vUVWdot = VState.vUVW*VState.vPQR + vForces/mass;
 
-  // Centrifugal acceleration.
+  // Coriolis acceleration.
   FGColumnVector3 ecVel = Tl2ec*vVel;
   FGColumnVector3 ace = 2.0*omega*ecVel;
   vUVWdot -= Tl2b*(Tec2l*ace);
 
-  // Coriolis acceleration.
+  // Centrifugal acceleration.
   FGColumnVector3 aeec = omega*(omega*VState.vLocation);
   vUVWdot -= Tl2b*(Tec2l*aeec);
 
@@ -289,13 +292,13 @@ void FGPropagate::bind(void)
 
   PropertyManager->Tie("metrics/runway-radius", this, &FGPropagate::GetRunwayRadius, &FGPropagate::SetRunwayRadius);
 
-  PropertyManager->Tie("attitude/phi-rad", this, &FGPropagate::Getphi);
-  PropertyManager->Tie("attitude/theta-rad", this, &FGPropagate::Gettht);
-  PropertyManager->Tie("attitude/psi-rad", this, &FGPropagate::Getpsi);
+  PropertyManager->Tie("attitude/phi-rad", this, (int)ePhi, (PMF)&FGPropagate::GetEuler);
+  PropertyManager->Tie("attitude/theta-rad", this, (int)eTht, (PMF)&FGPropagate::GetEuler);
+  PropertyManager->Tie("attitude/psi-rad", this, (int)ePsi, (PMF)&FGPropagate::GetEuler);
 
-  PropertyManager->Tie("attitude/roll-rad", this, &FGPropagate::Getphi);
-  PropertyManager->Tie("attitude/pitch-rad", this, &FGPropagate::Gettht);
-  PropertyManager->Tie("attitude/heading-true-rad", this, &FGPropagate::Getpsi);
+  PropertyManager->Tie("attitude/roll-rad", this, (int)ePhi, (PMF)&FGPropagate::GetEuler);
+  PropertyManager->Tie("attitude/pitch-rad", this, (int)eTht, (PMF)&FGPropagate::GetEuler);
+  PropertyManager->Tie("attitude/heading-true-rad", this, (int)ePsi, (PMF)&FGPropagate::GetEuler);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%