Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _crosshair = addMissionEventHandler ["draw3D",{
- _arXhair = positionCameraToWorld [0, 0, 20];
- if (alive player) then {
- if (!(isNull cursorObject) && (cursorObject distance player < 10)) then
- {
- _posXhair = AGLToASL (player modelToWorld (player selectionPosition "Weapon"));
- //Create the three axes from the player character model weapon memory point
- _right = _posXhair vectorFromTo AGLToASL (player modelToWorld (player selectionPosition "righthand"));
- _forward = player weaponDirection currentWeapon player;
- _up = _right vectorCrossProduct _forward;
- _right = _forward vectorCrossProduct _up;
- //Offset the laser start position using the three axes created above
- _posLaser = _posXhair;
- {
- _posLaser = _posLaser vectorAdd (_x vectorMultiply ([0.67, 0.77, 0.035] select _forEachIndex));
- }
- forEach [_right, _forward, _up];
- //Find the laser end position by using a 5000m line intersect check
- _posXhair = _posLaser vectorAdd (_forward vectorMultiply 20);
- _hitLaser = lineIntersectsSurfaces [_posLaser, _posXhair, player];
- if (0 < count _hitLaser) then
- {
- _arXhair = ASLToAGL ((_hitLaser select 0) select 0);
- }
- else
- {
- _arXhair = ASLToAGL _posXhair;
- };
- drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectOver_ca.paa", [1, 1, 1, 0.4], _arXhair, 1, 1, 0];
- };
- };
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement