]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGLGear.cpp
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGLGear.cpp
index 3de603f40e7b82e702b06ff8b96dafc06c18fd2f..4bdb1f2feb146928c5e6bbb0fb4b8ec1f9ee9fbe 100644 (file)
@@ -115,9 +115,7 @@ FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : Exec(fdmex)
   MaximumStrutForce = MaximumStrutTravel = 0.0;
   SinkRate = GroundSpeed = 0.0;
 
-  vWhlBodyVec     = (vXYZ - MassBalance->GetXYZcg()) / 12.0;
-  vWhlBodyVec(eX) = -vWhlBodyVec(eX);
-  vWhlBodyVec(eZ) = -vWhlBodyVec(eZ);
+  vWhlBodyVec = MassBalance->StructuralToBody(vXYZ);
   
   vLocalGear = State->GetTb2l() * vWhlBodyVec;
 
@@ -233,9 +231,7 @@ FGColumnVector3& FGLGear::Force(void)
       
   if (GearDown) {
 
-    vWhlBodyVec     = (vXYZ - MassBalance->GetXYZcg()) / 12.0;
-    vWhlBodyVec(eX) = -vWhlBodyVec(eX);
-    vWhlBodyVec(eZ) = -vWhlBodyVec(eZ);
+    vWhlBodyVec = MassBalance->StructuralToBody(vXYZ);
 
 // vWhlBodyVec now stores the vector from the cg to this wheel
 
@@ -403,11 +399,6 @@ FGColumnVector3& FGLGear::Force(void)
         FCoeff = dynamicFCoeff*fabs(WheelSlip)/WheelSlip;
       }
 
-      // A negative force coefficient will result in a force pulling the wheel(s)
-      // back instead of trying to stop them from moving.
-      if (FCoeff < 0.0)
-          FCoeff = 0.0;
-
 // Compute the vertical force on the wheel using square-law damping (per comment
 // in paper AIAA-2000-4303 - see header prologue comments). We might consider
 // allowing for both square and linear damping force calculation. Also need to