aeroson

fixed arjay_pointAt

Jun 10th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. arjay_pointAt =
  2. {
  3. private ["_source", "_target", "_relDirHor", "_relDirVer"];
  4.  
  5. _source = _this select 0;
  6. _target = _this select 1;
  7.  
  8. _relDirHor = [_source, _target] call BIS_fnc_DirTo;
  9. _source setDir _relDirHor;
  10. _asin = ((((getPosASL _source) select 2) - ((getPosASL _target) select 2)) / (_target distance _source));
  11. if(_asin>1) then { _asin=1; };
  12. if(_asin<-1) then { _asin=-1; };
  13. _relDirVer = asin _asin
  14. _relDirVer = (_relDirVer * -1);
  15. [_source, _relDirVer, 0] call BIS_fnc_setPitchBank;
  16. };
Advertisement
Add Comment
Please, Sign In to add comment