Skip to content

Laser – Fix seeker LOS failing#11155

Merged
PabstMirror merged 2 commits intoacemod:masterfrom
Kitanagoya5381-ARMA3:Laser---Fix-laser-seeker-spot-los-filter
Dec 9, 2025
Merged

Laser – Fix seeker LOS failing#11155
PabstMirror merged 2 commits intoacemod:masterfrom
Kitanagoya5381-ARMA3:Laser---Fix-laser-seeker-spot-los-filter

Conversation

@Hotel2622
Copy link
Copy Markdown
Contributor

Fixes #11136

When merged this pull request will:

  • Fix seeker LOS issues by filtering near-surface intersections that cause false obstructions during laser spot acquisition.

Details

lineIntersectsSurfaces often reports collisions on the outer surface of a vehicle or object, even when the laser spot is actually unobstructed.
This caused the seeker to incorrectly conclude that the spot was not visible.

To avoid this, intersections that are extremely close to the test target position are ignored:

_testIntersections = _testIntersections select {
    (_intersectPosASL vectorDistanceSqr _testPos) > 0.01
};

Notes

While this fix resolves the issue, I am not fully confident that this is the ideal or final approach.
I am not sure whether 0.01 is the correct value.

Additionally, during the initial ray generation for the laser hit point:

_distance = (_posASL vectorDistance _intersectPosASL) - 0.005;

fnc_shootRay.sqf:L42

it might be more appropriate to move the generated laser point slightly further back instead of filtering intersections.
Determining which method is more accurate and robust is not entirely clear, so expert review and feedback would be greatly appreciated.

Visual Demonstration

Testing Debug Code

Below is the code I used during debugging.
Please insert it right after the line I modified.

#ifdef DRAW_LASER_INFO
    drawLine3D [ASLToAGL _posASL, ASLToAGL _testPos, [1,0,0,0.8]];   
    {
        _x params ["_intersectPosASL", "_surfaceNormal", "_intersectObj", "_parentObject", "_selectionNames", "_pathToBisurf"];
        TRACE_1("",_intersectPosASL);
        drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [1,1,0,1], (ASLToAGL _intersectPosASL), 0.5, 0.5, 0, "seekerLOSBlock", 0.5, 0.025, "TahomaB"];
    } forEach _testIntersections;         
#endif

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

Comment on lines +151 to +156
if (_testIntersections isNotEqualTo [] ) then {
_testIntersections = _testIntersections select {
_x params ["_intersectPosASL"];
(_intersectPosASL vectorDistanceSqr _testPos) > 0.01;
};
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it'd be a good idea to see if it's faster to just do the select, since select might already do something like the if before actually iterating, so the 152-155 code never runs if there's nothing to iterate and thus no _x to assign.

^ Even if it doesn't do such a pre-check, it might still be faster.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I’ve updated the code to remove the redundant if check and just use select directly. Appreciate the feedback!

@PabstMirror
Copy link
Copy Markdown
Contributor

seems to work great
0.01 may be a little high (because it's distSqrt)
but I think it will be good for now

another possibility would be to check if emitter can see the new point
but that would be a 3rd raycast

@PabstMirror PabstMirror added this to the 3.20.2 milestone Dec 9, 2025
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Dec 9, 2025
@PabstMirror PabstMirror merged commit 29a436e into acemod:master Dec 9, 2025
3 checks passed
@Hotel2622 Hotel2622 deleted the Laser---Fix-laser-seeker-spot-los-filter branch December 10, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug-fix Release Notes: **FIXED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missle Guidance - Remote lased hellfire seeker jittering

3 participants