]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a bug that would occur on 5GHz computers, and disable the altitude damping feature.
authorehofman <ehofman>
Tue, 22 Jul 2003 08:51:31 +0000 (08:51 +0000)
committerehofman <ehofman>
Tue, 22 Jul 2003 08:51:31 +0000 (08:51 +0000)
src/Main/viewer.cxx

index 21e3d42f20c6f2825a21c6df54560daaf22c907b..1fd0ebff1dfecead342ba171c6180fbd21ea71e1 100644 (file)
@@ -725,6 +725,8 @@ FGViewer::copyLocationData()
 void
 FGViewer::dampEyeData (double &alt_ft, double &roll_deg, double &pitch_deg, double &heading_deg)
 {
+  const double interval = 0.01;
+
   static FGViewer *last = 0;
   if (last != this) {
     _damp_sync = 0.0;
@@ -736,16 +738,20 @@ FGViewer::dampEyeData (double &alt_ft, double &roll_deg, double &pitch_deg, doub
     return;
   }
 
-  if (_damp_sync < 0.01) {
-    alt_ft = _damped_alt_ft;
-    roll_deg = _damped_roll_deg;
-    pitch_deg = _damped_pitch_deg;
-    heading_deg = _damped_heading_deg;
+  if (_damp_sync < interval) {
+    if (_damp_alt > 0.0)
+      alt_ft = _damped_alt_ft;
+    if (_damp_roll > 0.0)
+      roll_deg = _damped_roll_deg;
+    if (_damp_pitch > 0.0)
+      pitch_deg = _damped_pitch_deg;
+    if (_damp_heading > 0.0)
+      heading_deg = _damped_heading_deg;
     return;
   }
 
-  while (_damp_sync >= 0.01) {
-    _damp_sync -= 0.01;
+  while (_damp_sync >= interval) {
+    _damp_sync -= interval;
 
     double d;
     if (_damp_alt > 0.0)