2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2018-09-17 19:19:29 +00:00
|
|
|
|
2017-06-08 13:31:51 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE-Team
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ace_laser_fnc_dev_drawVisibleLaserTargets
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2016-10-08 10:55:30 +00:00
|
|
|
// Dev Debug Function
|
2023-10-02 17:29:38 +00:00
|
|
|
// Displays lasers and attempts to lock on to codes 1111 and 1688 from a target vehicle's view
|
2016-10-08 10:55:30 +00:00
|
|
|
// On Screen Debug:
|
|
|
|
// Red - Vanilla Laser Targets
|
|
|
|
// Yellow - Array (vehicle pos/weapon) Laser Targets
|
|
|
|
// Green - Rays
|
|
|
|
// Blue - Seeker Locks
|
|
|
|
|
|
|
|
// Try searching for lasers from a given vehicle position [BLUE]:
|
|
|
|
private _seekerVehicle = vehicle ace_player;
|
2021-10-10 13:37:05 +00:00
|
|
|
private _testSeekerPosASL = _seekerVehicle modelToWorldVisualWorld [0,0,1];
|
2016-10-08 10:55:30 +00:00
|
|
|
private _testSeekerDir = vectorDirVisual _seekerVehicle;
|
|
|
|
{
|
|
|
|
private _code = _x;
|
2023-10-02 17:29:38 +00:00
|
|
|
private _results = [_testSeekerPosASL, _testSeekerDir, 45, 10000, [ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH], _code, _seekerVehicle] call FUNC(seekerFindLaserSpot);
|
2016-10-08 10:55:30 +00:00
|
|
|
private _resultPos = _results select 0;
|
|
|
|
if (!isNil "_resultPos") then {
|
|
|
|
// Draw lock results
|
|
|
|
drawLine3D [ASLtoAGL _testSeekerPosASL, ASLtoAGL _resultPos, [0,0,1,1]];
|
|
|
|
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [0,0,1,1], (ASLtoAGL _resultPos), 1.5, 1.5, 45, format ["%1 from %2", _code, _results select 1], 0.5, 0.025, "TahomaB"];
|
|
|
|
};
|
2023-11-06 20:16:03 +00:00
|
|
|
} forEach [ACE_DEFAULT_LASER_CODE, 1688]; // Scan at codes 1111 and 1688
|
2016-10-08 10:55:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Draw all lasers
|
2021-10-10 16:55:14 +00:00
|
|
|
{
|
|
|
|
//IGNORE_PRIVATE_WARNING ["_x", "_y];
|
|
|
|
// TRACE_2("",_x,_y);
|
|
|
|
_y params ["_obj", "_owner", "_laserMethod", "_waveLength", "_laserCode", "_beamSpread"];
|
2016-10-08 10:55:30 +00:00
|
|
|
|
|
|
|
// Draw vanila lasers [RED]
|
|
|
|
if (_laserMethod isEqualTo QFUNC(findLaserSource)) then { // Normal vanilla laserTarget func
|
|
|
|
private _targetObject = _obj getVariable [QGVAR(targetObject), objNull];
|
|
|
|
private _targetPosASL = getPosASL _targetObject;
|
|
|
|
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _targetPosASL), 0.5, 0.5, 0, "", 0.5, 0.025, "TahomaB"];
|
|
|
|
|
2021-10-10 16:55:14 +00:00
|
|
|
(_y call FUNC(findLaserSource)) params ["_laserPosASL", "_laserDir"];
|
2016-10-08 10:55:30 +00:00
|
|
|
private _resultsRay = [_laserPosASL, _laserDir, _obj] call FUNC(shootRay);
|
|
|
|
|
|
|
|
private _rayPos = _resultsRay select 0;
|
|
|
|
if (isNil "_rayPos") then {
|
|
|
|
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _targetPosASL), 2, 2, 0, "Nil Ray", 0.5, 0.025, "TahomaB"];
|
|
|
|
} else {
|
|
|
|
private _diff = _rayPos vectorDistance (getPosASL _targetObject); // Diff from ray position compared to actual
|
|
|
|
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoAGL _rayPos), 2, 2, 0, format ["Diff %1",_diff], 0.5, 0.025, "TahomaB"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// Draw array weapon lasers [YELLOW]
|
|
|
|
if ((_laserMethod isEqualType []) && {(count _laserMethod) == 2}) then {
|
|
|
|
_laserMethod params ["_modelPosition", "_weaponName"];
|
2021-10-10 13:37:05 +00:00
|
|
|
private _laserPosASL = _obj modelToWorldVisualWorld _modelPosition;
|
2016-10-08 10:55:30 +00:00
|
|
|
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLtoAGL _laserPosASL), 0.5, 0.5, 0, _weaponName, 0.5, 0.025, "TahomaB"];
|
|
|
|
private _laserDir = _obj weaponDirection _weaponName;
|
|
|
|
private _resultsRay = [_laserPosASL, _laserDir, _obj] call FUNC(shootRay);
|
|
|
|
private _rayPos = _resultsRay select 0;
|
|
|
|
if (!isNil "_rayPos") then {
|
|
|
|
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,1,0,1], (ASLtoAGL _rayPos), 2, 2, 0, _weaponName, 0.5, 0.025, "TahomaB"];
|
|
|
|
};
|
|
|
|
};
|
2021-10-10 16:55:14 +00:00
|
|
|
} forEach GVAR(laserEmitters);
|