From 83ce3fa2bda08c8a7fe0342a40a611292046483b Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 14 Apr 2015 13:14:37 +0200 Subject: [PATCH] remove drawline3d --- .../functions/fnc_drawLaserpoint.sqf | 31 ++++++++++++++----- addons/laserpointer/functions/fnc_onDraw.sqf | 2 +- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 82b989e470..93a421a094 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,6 +1,19 @@ // by commy2 and esteldunedain #include "script_component.hpp" +// init object +/*if (isNil QGVAR(laserdot)) then { + _light = "#lightpoint" createVehicleLocal [0,0,0]; + _light setLightBrightness 10; + _light setLightColor [1,0,0]; + _light setLightAmbient [1,0,0]; + _light setLightDayLight true; + //_light lightAttachObject [GVAR(laserdot), [0,0,0]]; + _light setLightAttenuation [0.04,4,4,0,0.04,0.08]; + + GVAR(laserdot) = _light; +};*/ + EXPLODE_3_PVT(_this,_unit,_range,_isGreen); _p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); @@ -97,15 +110,15 @@ if (!surfaceIsWater _pL) then { _pL = ASLtoATL _pL; }; -if (call EFUNC(common,ambientBrightness) < 0.2) then { - drawLine3D [ - _p0Pos, - _pL, - [[1,0,0,1], [0,1,0,1]] select _isGreen - ]; -}; +/* +drawLine3D [ + _p0Pos, + _pL, + [[1,0,0,1], [0,1,0,1]] select _isGreen +]; +*/ -_size = 2 * (_range - (positionCameraToWorld [0,0,0] distance _pL)) / _range; +_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; _camPos = positionCameraToWorld [0,0,0.2]; if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; @@ -116,6 +129,8 @@ if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; if ( lineIntersects [_camPos, _pL2]) exitWith {}; +//GVAR(laserdot) setPos _pL; + drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], [[1,0.25,0.25,0.5*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen, diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 6fa7275531..0e4ddf981a 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -28,7 +28,7 @@ _isIR = _isIR == 1; _laserID = ["ACE_acc_pointer_red", "ACE_acc_pointer_green"] find _laser; if (_laserID > -1 && {_x isFlashlightOn _weapon}) then { - [_x, 30, _laserID == 1 || _isIR] call FUNC(drawLaserpoint); + [_x, 50, _laserID == 1 || _isIR] call FUNC(drawLaserpoint); }; } forEach GVAR(nearUnits);