checkVisibility

From Bohemia Interactive Community
Revision as of 12:02, 12 May 2022 by Lou Montana (talk | contribs) (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Checks if one position is visible from another position and how much. The results can be affected by getTerrainGrid value, especially if position is near the ground. Particle effects such as smoke can also affect the results.
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.png2.02 "PHYSX"
since Arma 3 logo black.png1.62
ignore2: Object - (Optional, default objNull) second object to exclude from calculations
beg: Array - start position in format PositionASL
end: Array - end position in format PositionASL
Return Value:
Number - how much end position is visible to start position in range 0..1, where 1 is fully visible.

Examples

Example 1:
_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 or on the Forums.
Only post proven facts here! Add Note
BaerMitUmlaut - c
Posted on Aug 08, 2016 - 22:38 (UTC)
Particles that have blockAIVisibility set to 1 will influence the result, but will not make checkVisibility return 0. Instead an extremly small number will be returned.
Distance, fog, overcast, rain and nighttime have no effect on the result.