checkVisibility: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <nowiki>[</nowiki>" to " [<nowiki/>")
m (Some wiki formatting)
 
(52 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


|arma3|Game name=
|game1= arma3
|version1= 1.56


|1.56|Game version=
|gr1= Math - Geometry
____________________________________________________________________________________________


| 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=
|descr= {{{!}} class="wikitable float-right"
____________________________________________________________________________________________
! style="width: 50%" {{!}} Affected by
! Not affected by
{{!}}-
{{!}}
* [[getTerrainGrid|terrain grid]]
* obstacles
* particles<br><span style="font-size: .9em">(with <syntaxhighlight lang="cpp" inline>blockAIVisibility = 1</syntaxhighlight>)</span>
{{!}}
* [[time|daylight]]
* [[distance]]
* [[overcast]]
* [[fog]]
{{!}}}
Checks if one position is visible from another position and how much.


| [ignore, LOD, ignore2] [[checkVisibility]] [beg, end] |SYNTAX=
{{Feature|informative|Particles that have {{hl|blockAIVisibility}} set to 1 will influence the result, but will never make [[checkVisibility]] return 0; an extremely small number will be returned instead.}}


|p1= [ignore, LOD, ignore2]: [[Array]] |PARAMETER1=
|s1= [ignore, LOD, ignore2] [[checkVisibility]] [beg, end]


|p2= ignore: [[Object]] - object to exclude from calculations |PARAMETER2=
|p1= ignore: [[Object]] - object to exclude from calculations


|p3= LOD: [[String]] - level of details to use. Possible values are: <tt>"FIRE"</tt>, <tt>"VIEW"</tt>, <tt>"GEOM"</tt>, <tt>"IFIRE"</tt>|PARAMETER3=
|p2= LOD: [[String]] - level of details to use. Possible values are: {{hl|"FIRE"}}, {{hl|"VIEW"}}, {{hl|"GEOM"}}, {{hl|"IFIRE"}}, and {{GVI|arma3|2.02|size= 0.75}} {{hl|"PHYSX"}}


|p4= ignore2 (Optional): [[Object]] - second object to exclude from calculations (Since Arma 3 v1.61.136673) |PARAMETER4=
|p3= ignore2: [[Object]] - (Optional, default [[objNull]]) second object to exclude from calculations
|p3since= arma3 1.62


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


|p6= beg: [[Array]] - start position in format [[PositionASL]] |PARAMETER6=
|p5= end: [[Array]] - end position in format [[Position#PositionASL|PositionASL]]


|p7= end: [[Array]] - end position in format [[PositionASL]]  |PARAMETER7=
|r1= [[Number]] - how much end position is visible to start position in range 0..1, where 1 is fully visible.


| [[Number]] - how much end position is visible to start position in range 0..1, where 1 is fully visible. |RETURNVALUE=
|x1= <sqf>private _canSee = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos unit1];</sqf>
____________________________________________________________________________________________


|x1= <code>_cansee = [<nowiki/>[[objNull]], "VIEW"] [[checkVisibility]] [<nowiki/>[[eyePos]] [[player]], [[eyePos]] unit1];</code> |EXAMPLE1=
|seealso= [[lineIntersectsWith]] [[lineIntersectsSurfaces]] [[lineIntersectsObjs]] [[intersect]] [[terrainIntersect]] [[terrainIntersectASL]] [[terrainIntersectAtASL]] [[lineIntersects]] [[cursorObject]] [[cursorTarget]] [[disableRemoteSensors]]
| [[lineIntersectsWith]], [[lineIntersectsSurfaces]], [[lineIntersectsObjs]], [[intersect]], [[terrainIntersect]], [[terrainIntersectASL]], [[terrainIntersectAtASL]], [[lineIntersects]], [[cursorObject]], [[cursorTarget]], [[disableRemoteSensors]] |SEEALSO=
 
|  |MPBEHAVIOUR=
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on August 8, 2016 - 22:38 (UTC)</dd>
<dt class="note">[[User:BaerMitUmlaut|BaerMitUmlaut]]</dt>
<dd class="note">
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.<br />
Distance, fog, overcast, rain and nighttime have no effect on the result.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 12:25, 10 April 2023

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.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:
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 or on the Forums.
Only post proven facts here! Add Note