Created
June 10, 2019 07:28
-
-
Save commy2/120c3b58f55d507fde4a57796eccc853 to your computer and use it in GitHub Desktop.
This file contains 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_debug", "onEachFrame", { | |
params ["_unit", "_weapon", "_pos"]; | |
private _aim = _unit modelToWorldVisualWorld (_unit selectionPosition "aimPoint"); | |
private _cam = _unit modelToWorldVisualWorld (_unit selectionPosition "camera"); | |
private _up = _aim vectorFromTo _cam; | |
private _wDir = _unit weaponDirection _weapon; | |
private _wLat = vectorNormalized (_wDir vectorCrossProduct _up); | |
private _wUp = _wLat vectorCrossProduct _wDir; | |
private _origin = _unit modelToWorldVisualWorld (_unit selectionPosition "proxy:\a3\characters_f\proxies\weapon.001") vectorAdd | |
(_wDir vectorMultiply _pos#0) vectorAdd | |
(_wLat vectorMultiply _pos#1) vectorAdd | |
(_wUp vectorMultiply _pos#2); | |
drawLine3D [ASLToAGL _origin, ASLToAGL (_origin vectorAdd _wDir), [1,0,0,1]]; | |
drawLine3D [ASLToAGL _origin, ASLToAGL (_origin vectorAdd _wLat), [0,1,0,1]]; | |
drawLine3D [ASLToAGL _origin, ASLToAGL (_origin vectorAdd _wUp), [0,0,1,1]]; | |
}, [player, currentWeapon player, [-0.02,0.11,1]]] call BIS_fnc_addStackedEventHandler; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment