Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_vehicle", "_dir", "_pos", "_yaw", "_bank", "_pitch", "_side", "_y", "_z", "_xy", "_xz", "_yz", "_yx", "_zx", "_zy"];
- _vehicle = _this select 0;
- _dir = getDir2 _vehicle;
- _pos = getPosASL _vehicle;
- //_yaw = getdir _vehicle;
- //_yaw = -_yaw;
- //_bank1 = (vehicle player) call GetBank;
- //_pitch1 = (vehicle player) call GetPitch;
- _yaw = -(_dir select 0);
- _bank = _dir select 1;
- _pitch = _dir select 2;
- //player globalchat format ["%1 %2 %3 %4", _pitch1, _pitch, abs (_pitch1 - _pitch),DUPA];
- //if (abs (_pitch1 - _pitch) > DUPA && abs (_pitch1 - _pitch) < 900 ) then {DUPA=abs (_pitch1 - _pitch)};
- //player globalchat format ["%1 %2 %3", _bank1, _bank, abs (_bank1 - _bank)];
- //if (abs (_bank1 - _bank) > DUPA && abs (_bank1 - _bank) < 900 ) then {DUPA=abs (_bank1 - _bank)};
- _side = _this select 1;
- _forward = _this select 2;
- _up = _this select 3;
- // Rotation around the bank
- _xy = cos(0)*_forward - sin(0)*_up;
- _xz = sin(0)*_forward + cos(0)*_up;
- _yz = cos(_bank)*_xz - sin(_bank)*_side;
- _yx = sin(_bank)*_xz + cos(_bank)*_side;
- _zx = cos(0)*_yx - sin(0)*_xy;
- _zy = sin(0)*_yx + cos(0)*_xy;
- // Rotation around the pitch
- _xy = cos(_pitch)*_zy - sin(_pitch)*_yz;
- _xz = sin(_pitch)*_zy + cos(_pitch)*_yz;
- _yz = cos(0)*_xz - sin(0)*_zx;
- _yx = sin(0)*_xz + cos(0)*_zx;
- _zx = cos(0)*_yx - sin(0)*_xy;
- _zy = sin(0)*_yx + cos(0)*_xy;
- // Rotation around the yaw
- _xy = cos(0)*_zy - sin(0)*_yz;
- _xz = sin(0)*_zy + cos(0)*_yz;
- _yz = cos(0)*_xz - sin(0)*_zx;
- _yx = sin(0)*_xz + cos(0)*_zx;
- _zx = cos(_yaw)*_yx - sin(_yaw)*_xy;
- _zy = sin(_yaw)*_yx + cos(_yaw)*_xy;
- [
- (_pos select 0) + _zx,
- (_pos select 1) + _zy,
- (_pos select 2) + _yz
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement