Last active
July 26, 2021 10:27
-
-
Save commy2/d60b11fd38cf53f5c2ec02cda0dc3426 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CBA_fnc_get3DENRotation = { | |
params ["_object"]; | |
private _dir = vectorDir _object; | |
_dir params ["_xDir", "_yDir", "_zDir"]; | |
private _up = vectorUp _object; | |
_up params ["_xUp", "_yUp", "_zUp"]; | |
private _side = _dir vectorCrossProduct _up; | |
_side params ["_xSide", "_ySide", "_zSide"]; | |
private _xRot = _yUp atan2 _zUp; | |
private _yRot = -_xUp atan2 sqrt (1 - (_xUp ^ 2)); | |
private _zRot = _xDir atan2 _xSide; | |
[_xRot, _yRot, _zRot] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment