Skip to content

Instantly share code, notes, and snippets.

@commy2
Created June 10, 2019 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commy2/120c3b58f55d507fde4a57796eccc853 to your computer and use it in GitHub Desktop.
Save commy2/120c3b58f55d507fde4a57796eccc853 to your computer and use it in GitHub Desktop.
["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