Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upApex-Framework/Apex_framework.terrain/code/functions/fn_terrainGradAngle.sqf
Go to file| /* | |
| File: fn_terrainGradAngle.sqf | |
| Author: | |
| Quiksilver (credit: Petr Ondracek for BIS_fnc_terrainGradAngle) | |
| Last modified: | |
| 30/07/2016 A3 1.62 by Quiksilver | |
| Description: | |
| Terrain Gradient Angle | |
| __________________________________________________________________________*/ | |
| _pos0 = param [0,objNull,[objNull,[]]]; | |
| _delta = param [1,1.0,[0]]; | |
| _dir = param [2,0,[0]]; | |
| if (_pos0 isEqualType objNull) then {_pos0 = getPosASL _pos0}; | |
| if ((count _pos0) isEqualTo 2) then { | |
| _pos0 = [(_pos0 select 0),(_pos0 select 1),(getTerrainHeightASL _pos0)]; | |
| }; | |
| private _pos1 = _pos0 getPos [_delta,_dir]; | |
| _pos0 = getTerrainHeightASL [(_pos0 select 0),(_pos0 select 1)]; | |
| _pos1 = getTerrainHeightASL [(_pos1 select 0),(_pos1 select 1)]; | |
| (atan((_pos1-_pos0)/_delta)); |