checkVisibility: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{GameCategory\|(arma[0123])\|New[ _]Scripting[ _]Commands[ _]List\}\}" to "{{GameCategory|$1|New Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


|arma3|Game name=
|arma3|Game name=
Line 7: Line 6:


|gr1= Math - Geometry |GROUP1=
|gr1= Math - Geometry |GROUP1=
____________________________________________________________________________________________


| 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. |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. |DESCRIPTION=
____________________________________________________________________________________________


| [ignore, LOD, ignore2] [[checkVisibility]] [beg, end] |SYNTAX=
| [ignore, LOD, ignore2] [[checkVisibility]] [beg, end] |SYNTAX=
Line 29: Line 26:


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


|x1= <code>_cansee = [<nowiki/>[[objNull]], "VIEW"] [[checkVisibility]] [<nowiki/>[[eyePos]] [[player]], [[eyePos]] unit1];</code> |EXAMPLE1=
|x1= <code>_cansee = [<nowiki/>[[objNull]], "VIEW"] [[checkVisibility]] [<nowiki/>[[eyePos]] [[player]], [[eyePos]] unit1];</code> |EXAMPLE1=

Revision as of 00:20, 17 January 2021

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, LOD, ignore2]: Array
ignore: Object - object to exclude from calculations
LOD: String - level of details to use. Possible values are: "FIRE", "VIEW", "GEOM", "IFIRE", "PHYSX" - PhysX geometry LOD (since Arma 3 v2.01.146666)
ignore2 (Optional): Object - second object to exclude from calculations (Since Arma 3 v1.61.136673)
[beg, end]: Array
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:
lineIntersectsWithlineIntersectsSurfaceslineIntersectsObjsintersectterrainIntersectterrainIntersectASLterrainIntersectAtASLlineIntersectscursorObjectcursorTargetdisableRemoteSensors

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

Notes


Bottom Section

Posted on August 8, 2016 - 22:38 (UTC)
BaerMitUmlaut
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.