Simplified the wind direction change calculation

This commit is contained in:
ulteq 2015-04-22 19:46:27 +02:00
parent caf2f12eb9
commit a9726d2b60
2 changed files with 4 additions and 2 deletions

View File

@ -28,4 +28,6 @@ TRACE_2("Dir: Current/Change",Round(_dir),Round(_dirChange));
TRACE_2("Spd: Current/Change",Round(_spd * 10) / 10,Round(_spdChange * 10) / 10);
TRACE_3("Period/Position/Percent",Round(_period),Round(_periodPosition),Round(_periodPercent * 100) / 100);
// TODO: Add some deterministic noise
[-_spd * sin(_dir), -_spd * cos(_dir), 0]

View File

@ -53,10 +53,10 @@ if(GVAR(wind_period_count) > GVAR(wind_next_period)) then {
_windDirection = (360 + GVAR(wind_direction_reference) + _windDirectionVariance) % 360;
_windDirectionChange = _windDirection - GVAR(current_wind_direction);
if (_windDirectionChange > 180) then {
_windDirectionChange = 360 - _windDirectionChange;
_windDirectionChange = _windDirectionChange - 360;
};
if (_windDirectionChange < -180) then {
_windDirectionChange = -360 - _windDirectionChange;
_windDirectionChange = 360 + _windDirectionChange;
};
_windMaxDiff = GVAR(mean_wind_speed) - GVAR(max_wind_speed);