]> git.mxchange.org Git - flightgear.git/commitdiff
temporary fix for a division by zero problem for some aircraft
authorehofman <ehofman>
Sat, 22 Aug 2009 13:40:30 +0000 (13:40 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 23 Aug 2009 19:43:10 +0000 (21:43 +0200)
src/FDM/JSBSim/models/FGLGear.cpp

index 2a9b472e9004badf4cf5aec71863246336616211..e8df4370ad99c828950097f6721c05ae415d02cb 100644 (file)
@@ -392,6 +392,13 @@ FGColumnVector3& FGLGear::Force(void)
 
 void FGLGear::ComputeGroundCoordSys(void)
 {
+  if( fabs(vGroundNormal(eZ)) < 1e-3 ) {
+    cout << "BOMB: ";
+    cout << vGroundNormal(eX) << "/" << vGroundNormal(eY) << "/" << 
+         vGroundNormal(eZ) << " - " << SteerAngle << endl;
+    return;
+  }
+
   // Compute the rolling direction projected on the ground
   // It consists in finding a vector 'r' such that 'r' lies in the plane (w,z) and r.n = 0 (scalar
   // product) where: