1
0
Fork 0

Divide-by-zero fixes from Csaba Halász

This commit is contained in:
timoore 2009-01-08 07:57:04 +00:00 committed by Tim Moore
parent e98ffd1006
commit 17ccf72e44
3 changed files with 6 additions and 6 deletions

View file

@ -87,7 +87,7 @@ HeadingIndicator::update (double dt)
// Next, calculate the indicated heading, // Next, calculate the indicated heading,
// introducing errors. // introducing errors.
double factor = 0.01 / (spin * spin * spin * spin * spin * spin); double factor = 100 * (spin * spin * spin * spin * spin * spin);
double heading = _heading_in_node->getDoubleValue(); double heading = _heading_in_node->getDoubleValue();
// Now, we have to get the current // Now, we have to get the current
@ -98,7 +98,7 @@ HeadingIndicator::update (double dt)
while ((heading - _last_heading_deg) < -180) while ((heading - _last_heading_deg) < -180)
_last_heading_deg -= 360; _last_heading_deg -= 360;
heading = fgGetLowPass(_last_heading_deg, heading, dt/factor); heading = fgGetLowPass(_last_heading_deg, heading, dt * factor);
_last_heading_deg = heading; _last_heading_deg = heading;
heading += offset; heading += offset;

View file

@ -108,7 +108,7 @@ HeadingIndicatorDG::update (double dt)
// Next, calculate the indicated heading, // Next, calculate the indicated heading,
// introducing errors. // introducing errors.
double factor = 0.01 / (spin * spin * spin * spin * spin * spin); double factor = 100 * (spin * spin * spin * spin * spin * spin);
double heading = _heading_in_node->getDoubleValue(); double heading = _heading_in_node->getDoubleValue();
// Now, we have to get the current // Now, we have to get the current
@ -119,7 +119,7 @@ HeadingIndicatorDG::update (double dt)
while ((heading - _last_heading_deg) < -180) while ((heading - _last_heading_deg) < -180)
_last_heading_deg -= 360; _last_heading_deg -= 360;
heading = fgGetLowPass(_last_heading_deg, heading, dt/factor); heading = fgGetLowPass(_last_heading_deg, heading, dt * factor);
_last_heading_deg = heading; _last_heading_deg = heading;
heading += offset; heading += offset;

View file

@ -109,7 +109,7 @@ HeadingIndicatorFG::update (double dt)
// Next, calculate the indicated heading, // Next, calculate the indicated heading,
// introducing errors. // introducing errors.
double factor = 0.01 / (spin * spin * spin * spin * spin * spin); double factor = 100 * (spin * spin * spin * spin * spin * spin);
double heading = _heading_in_node->getDoubleValue(); double heading = _heading_in_node->getDoubleValue();
// Now, we have to get the current // Now, we have to get the current
@ -120,7 +120,7 @@ HeadingIndicatorFG::update (double dt)
while ((heading - _last_heading_deg) < -180) while ((heading - _last_heading_deg) < -180)
_last_heading_deg -= 360; _last_heading_deg -= 360;
heading = fgGetLowPass(_last_heading_deg, heading, dt/factor); heading = fgGetLowPass(_last_heading_deg, heading, dt * factor);
_last_heading_deg = heading; _last_heading_deg = heading;
heading += offset; heading += offset;