Jim Wilson:
Here's a patch to fix the asi problem (it affects most aircraft panels). [ Avoids a sqrt( x < 0 ) ]
This commit is contained in:
parent
d4d53763d9
commit
317e48ba4f
1 changed files with 3 additions and 1 deletions
|
@ -59,7 +59,9 @@ AirspeedIndicator::update (double dt)
|
|||
double p = _static_pressure_node->getDoubleValue();
|
||||
double q = ( pt - p ) * INHGTOPSF; // dynamic pressure
|
||||
|
||||
// Now, reverse the equation
|
||||
// Now, reverse the equation (normalize dynamic pressure to
|
||||
// avoid "nan" results from sqrt)
|
||||
if ( q < 0 ) { q = 0.0; }
|
||||
double v_fps = sqrt((2 * q) / SEA_LEVEL_DENSITY_SLUGFT3);
|
||||
|
||||
// Publish the indicated airspeed
|
||||
|
|
Loading…
Reference in a new issue