terrainIntersectASL: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix username deletion mistake)
m (Text replacement - "\|x([0-9]) *= * <code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(41 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |Game name=
|game1= arma2oa
|version1= 1.62


|1.62|Game version=
|game2= tkoh
____________________________________________________________________________________________
|version2= 1.00


| Checks for intersection of terrain between two ASL positions. Returns [[true]] if intersects with terrain.
|game3= arma3
For AGL variant, see [[terrainIntersect]]. |DESCRIPTION=
|version3= 0.50
____________________________________________________________________________________________


| [[terrainIntersectASL]] [pos1, pos2] |SYNTAX=
|gr1= Math - Geometry


|p1= [pos1, pos2]: [[Array]]|PARAMETER1=
|descr= Checks for intersection of terrain between two ASL positions. Returns [[true]] if intersects with terrain.
For AGL variant, see [[terrainIntersect]].


|p2= pos1: [[Array]] - start position in format [[PositionASL]]|PARAMETER2=
|s1= [[terrainIntersectASL]] [start, end]


|p3= pos2: [[Array]] - end position in format [[PositionASL]]|PARAMETER3=
|p1= start: [[Array]] format [[Position#PositionASL|PositionASL]] - start position


| [[Boolean]] |RETURNVALUE=
|p2= end: [[Array]] format [[Position#PositionASL|PositionASL]] - end position
____________________________________________________________________________________________
 
|x1= <code>_intersects = [[terrainIntersectASL]] [<nowiki/>[[getPosASL]] [[player]], [[getPosASL]] chopper];</code> |EXAMPLE1=


|x2= <code>_intersects = [[terrainIntersectASL]] [<nowiki/>[[eyePos]] [[player]], [[eyePos]] enemy1];</code> |EXAMPLE2=
|r1= [[Boolean]]


____________________________________________________________________________________________
|x1= <sqf>_intersects = terrainIntersectASL [getPosASL player, getPosASL chopper];</sqf>


|[[terrainIntersectAtASL]], [[lineIntersectsSurfaces]], [[intersect]], [[lineIntersects]], [[lineIntersectsWith]], [[terrainIntersect]], [[lineIntersectsObjs]], [[checkVisibility]] |SEEALSO=
|x2= <sqf>_intersects = terrainIntersectASL [eyePos player, eyePos enemy1];</sqf>
 
|seealso= [[terrainIntersectAtASL]] [[lineIntersectsSurfaces]] [[intersect]] [[lineIntersects]] [[lineIntersectsWith]] [[terrainIntersect]] [[lineIntersectsObjs]] [[checkVisibility]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= Lou Montana
<!-- Note Section BEGIN -->
|timestamp= 20120531104000
 
|text= Please note the difference:
<dd class="notedate">Posted on may 31, 2012 - 10:40 (CEST)
<dt class="note">[[User:Lou Montana|Lou Montana]]
<dd class="note">Please note the difference :
* terrainIntersect
* terrainIntersect
* terrainIntersectASL
* terrainIntersectASL
* lineIntersect'''''s'''''
* lineIntersect'''''s'''''
* lineIntersect'''''s'''''With
* lineIntersect'''''s'''''With
* lineIntersect'''''s'''''Objs  
* lineIntersect'''''s'''''Objs
* intersect
* intersect
}}


<dd class="notedate">Posted on may 31, 2012 - 10:40 (CEST)
{{Note
<dt class="note">[[User:Rocket|Rocket]]
|user= Rocket
<dd class="note">This command is CPU intensive on the engine, be careful with its use.
|timestamp= 20120601155500
|text= This command is CPU intensive on the engine, be careful with its use.
}}


<dd class="notedate">Posted on March 2, 2019 - 20:29 (UTC)</dd>
{{Note
<dt class="note">[[User:bloodwyn1756|bloodwyn1756]]</dt>
|user= bloodwyn1756
<dd class="note">
|timestamp= 20190302202900
If one of the two positions is below sea level, the command always returns true.
|text= If one of the two positions is below sea level, the command always returns true.
</dd>
}}
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:38, 13 May 2022

Hover & click on the images for description

Description

Description:
Checks for intersection of terrain between two ASL positions. Returns true if intersects with terrain. For AGL variant, see terrainIntersect.
Groups:
Math - Geometry

Syntax

Syntax:
terrainIntersectASL [start, end]
Parameters:
start: Array format PositionASL - start position
end: Array format PositionASL - end position
Return Value:
Boolean

Examples

Example 1:
_intersects = terrainIntersectASL [getPosASL player, getPosASL chopper];
Example 2:
_intersects = terrainIntersectASL [eyePos player, eyePos enemy1];

Additional Information

See also:
terrainIntersectAtASL lineIntersectsSurfaces intersect lineIntersects lineIntersectsWith terrainIntersect lineIntersectsObjs checkVisibility

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
Lou Montana - c
Posted on May 31, 2012 - 10:40 (UTC)
Please note the difference:
  • terrainIntersect
  • terrainIntersectASL
  • lineIntersects
  • lineIntersectsWith
  • lineIntersectsObjs
  • intersect
Rocket - c
Posted on Jun 01, 2012 - 15:55 (UTC)
This command is CPU intensive on the engine, be careful with its use.
bloodwyn1756 - c
Posted on Mar 02, 2019 - 20:29 (UTC)
If one of the two positions is below sea level, the command always returns true.