Advertisement
Faguss

Untitled

Oct 18th, 2016
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. private ["_vehicle", "_dir", "_pos", "_yaw", "_bank", "_pitch", "_side", "_y", "_z", "_xy", "_xz", "_yz", "_yx", "_zx", "_zy"];
  2.  
  3.  
  4. _vehicle = _this select 0;
  5. _dir = getDir2 _vehicle;
  6. _pos = getPosASL _vehicle;
  7.  
  8. _yaw = -(getdir _vehicle);
  9. _bank = (vehicle player) call GetBank;
  10. _pitch = (vehicle player) call GetPitch;
  11.  
  12. //_yaw = -(_dir select 0);
  13. //_bank = _dir select 1;
  14. //_pitch = _dir select 2;
  15.  
  16. //player globalchat format ["%1 %2 %3 %4", _pitch1, _pitch, abs (_pitch1 - _pitch),DUPA];
  17. //if (abs (_pitch1 - _pitch) > DUPA && abs (_pitch1 - _pitch) < 900 ) then {DUPA=abs (_pitch1 - _pitch)};
  18.  
  19. //player globalchat format ["%1 %2 %3", _bank1, _bank, abs (_bank1 - _bank)];
  20. //if (abs (_bank1 - _bank) > DUPA && abs (_bank1 - _bank) < 900 ) then {DUPA=abs (_bank1 - _bank)};
  21.  
  22.  
  23. _side = _this select 1;
  24. _forward = _this select 2;
  25. _up = _this select 3;
  26.  
  27.  
  28.  
  29. // Rotation around the bank
  30. _Z = cos(_bank)*_up - sin(_bank)*_side;
  31. _X = sin(_bank)*_up + cos(_bank)*_side;
  32.  
  33. // Rotation around the pitch
  34. _xy = cos(_pitch)*_forward - sin(_pitch)*_Z;
  35. _Z = sin(_pitch)*_forward + cos(_pitch)*_Z;
  36.  
  37. // Rotation around the yaw
  38. _Y = sin(_yaw)*_X + cos(_yaw)*_xy;
  39. _X = cos(_yaw)*_X - sin(_yaw)*_xy;
  40.  
  41. [
  42. (_pos select 0) + _X,
  43. (_pos select 1) + _Y,
  44. (_pos select 2) + _Z
  45. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement