checkVisibility: Difference between revisions

From Bohemia Interactive Community
m (Some wiki formatting)
mNo edit summary
 
Line 33: Line 33:
|p3since= arma3 1.62
|p3since= arma3 1.62


|p4= beg: [[Array]] - start position in format [[Position#PositionASL|PositionASL]]
|p4= beg: [[Position#PositionASL|PositionASL]] - start position


|p5= end: [[Array]] - end position in format [[Position#PositionASL|PositionASL]]
|p5= end: [[Position#PositionASL|PositionASL]] - end position


|r1= [[Number]] - how much end position is visible to start position in range 0..1, where 1 is fully visible.
|r1= [[Number]] - how much end position is visible to start position in range 0..1, where 1 is fully visible.

Latest revision as of 05:27, 3 January 2026

Hover & click on the images for description

Description

Description:
Affected by Not affected by
  • terrain grid
  • obstacles
  • particles
    (with blockAIVisibility = 1)

Checks if one position is visible from another position and how much.

Particles that have blockAIVisibility set to 1 will influence the result, but will never make checkVisibility return 0; an extremely small number will be returned instead.
Groups:
Math - Geometry

Syntax

Syntax:
[ignore, LOD, ignore2] checkVisibility [beg, end]
Parameters:
ignore: Object - object to exclude from calculations
LOD: String - level of details to use. Possible values are: "FIRE", "VIEW", "GEOM", "IFIRE", and Arma 3 logo black.png 2.02 "PHYSX"
since Arma 3 logo black.png 1.62
ignore2: Object - (Optional, default objNull) second object to exclude from calculations
beg: PositionASL - start position
end: PositionASL - end position
Return Value:
Number - how much end position is visible to start position in range 0..1, where 1 is fully visible.

Examples

Example 1:
private _canSee = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos unit1];

Additional Information

See also:
lineIntersectsWith lineIntersectsSurfaces lineIntersectsObjs intersect terrainIntersect terrainIntersectASL terrainIntersectAtASL lineIntersects cursorObject cursorTarget disableRemoteSensors

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note