Added: waveHeightAt Function, refs #1024 for use.

This commit is contained in:
jaynus 2015-05-11 16:44:17 -07:00
parent 89d19e817c
commit 7efe8ccba5
2 changed files with 20 additions and 0 deletions

View File

@ -183,6 +183,7 @@ PREP(unmuteUnit);
PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute);
PREP(waveHeightAt);
PREP(translateToWeaponSpace);
PREP(translateToModelSpace);

View File

@ -0,0 +1,19 @@
/*
* Author: jaynus
*
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy
*
* Arguments:
* 0: Position ASL to get height at
*
* Return Value:
* Wave height in meters
*
*/
if(isNil QGVAR(waveHeightLogic)) then {
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
};
GVAR(waveHeightLogic) setPosASL (_this select 0);
(((getPosASLW GVAR(waveHeightLogic)) select 2) - ((getPosASL GVAR(waveHeightLogic)) select 2))