Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marking Laser - Use laserTarget #10351

Open
wants to merge 12 commits into
base: markinglaser
Choose a base branch
from
Open

Conversation

PabstMirror
Copy link
Contributor

Rework #7761

Uses ace_laser system to handle getting origin and direction
eliminates the stair-step flicker of trying to manually sync turret direction
does require the laser to be on as well

@PabstMirror PabstMirror added the kind/feature Release Notes: **ADDED:** label Sep 29, 2024
@PabstMirror PabstMirror added this to the Ongoing milestone Sep 29, 2024
@mrschick
Copy link
Contributor

mrschick commented Oct 1, 2024

I've tested this a bit in SP, when lasing from a loitering UAV (Yabhon) at 1000m AGL, the beam will lag behind a POINT tracked target (relative to the direction of flight) by about 3-4m across the ground. From the POV of the UAV it looks fine.
This isn't really a critical issue though.

Could some flashing pattern be implemented? Afaik irl TGP laser pointers flash in a pattern to be more noticeable, especially from the air or when only the spot on the ground is really going to be visible.

@PabstMirror
Copy link
Contributor Author

because it's scripted, it's pretty easy to add any patterns we want

IZLID lasers mentioned a 3-5Hz pulse, so I went with that

@mrschick
Copy link
Contributor

mrschick commented Oct 3, 2024

Works pretty well, except for the spot being comically large at low TGP zoom levels in any illuminator mode.
20241003170916_1
It's an issue that I didn't get before in markinglaser, where the beam itself could be seen from a UAV's perspective.
image

I'm also not sure about the requirement of the LD having to be on to fire the illuminator.
LDs apparently use 1060nm (some modern ones 1550nm) light, which should be almost invisible to Gen3 tubes (page 2, "HyMa photocathode"), which would defeat the purpose of illumination for all NVG-equipped allies.

@PabstMirror
Copy link
Contributor Author

https://www.youtube.com/watch?v=v1vLwu_oWLQ this is the problem with original markingLaser pr
the syncing became jerky with any movement of source
the LaserTarget marker seems to be updated by the engine fairly rapidly so it's easier to make smooth

addons/markinglaser/XEH_postInit.sqf Outdated Show resolved Hide resolved
addons/markinglaser/functions/fnc_renderPFH.sqf Outdated Show resolved Hide resolved
Comment on lines +46 to +51
private _smoothing = _aircraft getVariable [QGVAR(smoothing), []];
_smoothing pushBack _laserDir;
if (count _smoothing > 5) then { _smoothing deleteAt 0 };
private _smoothDir = [0,0,0];
{ _smoothDir = _smoothDir vectorAdd _x } forEach _smoothing;
_smoothDir = _smoothDir vectorMultiply (1/count _smoothing);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know absolutely nothing about drawLaser, so please forgive my ignorance, but what was wrong with the old method of drawing it to max distance and adding onto it from there?

addons/markinglaser/initSettings.inc.sqf Outdated Show resolved Hide resolved
@PabstMirror PabstMirror changed the base branch from markinglaser to master October 22, 2024 18:47
@PabstMirror PabstMirror changed the base branch from master to markinglaser October 22, 2024 18:48
Comment on lines +27 to +41
["CBA_settingsInitialized", {
TRACE_1("settingsInitialized",1);

GVAR(pfEH) = -1;
["visionMode", LINKFUNC(onLaserOn), true] call CBA_fnc_addPlayerEventHandler;
["ace_laserOn", {
params ["", "_args"];
_args params ["_object"];
if !(_object getVariable [QGVAR(enabled), false]) exitWith {};
_object setVariable [QGVAR(smoothing), []];
_object setVariable [QGVAR(flashOffset), random 1]; // make flashes not synchronized

[] call LINKFUNC(onLaserOn);
}] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this needs to be executed after the CBA settings have been initialised?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure what we wanted to do for settings on this
just threw it inside so it would be easy to add

Copy link
Contributor

@johnb432 johnb432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd update the XEH to make it uniform with the rest of ACE:

class Extended_InitPost_EventHandlers {
    class Air {
        class ADDON {
            init = QUOTE(_this call FUNC(onAircraftInit));
        };
    };
};

Otherwise, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants