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
- _Z = cos(_bank)*_up - sin(_bank)*_side;
- // Rotation around the pitch
- _xy = cos(_pitch)*_forward - sin(_pitch)*_Z;
- _Z = sin(_pitch)*_forward + cos(_pitch)*_Z;
- // Rotation around the bank
- _X = sin(_bank)*_up + cos(_bank)*_side;
- // Rotation around the yaw
- _Y = sin(_yaw)*_X + cos(_yaw)*_xy;
- _X = cos(_yaw)*_X - sin(_yaw)*_xy;
- [
- (_pos select 0) + _X,
- (_pos select 1) + _Y,
- (_pos select 2) + _Z
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement