Fix a problem where the windspeed could be negative in the property tree. Animations relying on this property could become stressed because of that.
This commit is contained in:
parent
cf96deac29
commit
deccb6c9a7
1 changed files with 10 additions and 0 deletions
|
@ -442,12 +442,22 @@ FGEnvironment::_recalc_hdgspd ()
|
|||
wind_from_heading_deg = 90 - wind_from_heading_deg;
|
||||
else
|
||||
wind_from_heading_deg = 270 - wind_from_heading_deg;
|
||||
|
||||
#if 0
|
||||
// FIXME: Windspeed can become negative with these formulas.
|
||||
// which can cause problems for animations that rely
|
||||
// on the windspeed property.
|
||||
if (angle_rad == 0)
|
||||
wind_speed_kt = fabs(wind_from_east_fps
|
||||
* SG_METER_TO_NM * SG_FEET_TO_METER * 3600);
|
||||
else
|
||||
wind_speed_kt = (wind_from_north_fps / sin(angle_rad))
|
||||
* SG_METER_TO_NM * SG_FEET_TO_METER * 3600;
|
||||
#else
|
||||
wind_speed_kt = sqrt(wind_from_north_fps * wind_from_north_fps +
|
||||
wind_from_east_fps * wind_from_east_fps)
|
||||
* SG_METER_TO_NM * SG_FEET_TO_METER * 3600;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue