ACE3/addons/weather/functions/fnc_updateWind.sqf

25 lines
807 B
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
/*
2015-04-24 08:58:55 +00:00
* Author: ACE2 Team, Ruthberg
* Smoothly updates wind on the server (based on time of year and map data)
*
2016-06-18 09:50:41 +00:00
* Arguments:
* None
*
2016-06-18 09:50:41 +00:00
* Return Value:
* None
*
* Example:
* [] call ace_weather_fnc_updateWind
*
* Public: No
*/
// Public API to temporarily disable wind simulation
if (missionNamespace getVariable [QGVAR(disableWindSimulation), false]) exitWith {};
private _speed = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_speed), GVAR(next_wind_speed), true];
private _direction = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_direction), GVAR(next_wind_direction), true];
setWind [-_speed * sin(_direction), -_speed * cos(_direction), true];