terrainIntersect: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
m (Some wiki formatting)
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma2oa
|game1= arma2oa
|version1= 1.62


|1.62
|game2= tkoh
|version2= 1.00
 
|game3= arma3
|version3= 0.50


|gr1= Math - Geometry
|gr1= Math - Geometry


| Checks for intersection of terrain between two AGL positions. Returns [[true]] if intersects with terrain. For ASL variant see [[terrainIntersectASL]]
|descr= Checks for intersection of terrain between two AGL positions. Returns [[true]] if intersects with terrain. For ASL variant see [[terrainIntersectASL]].
 
|s1= [[terrainIntersect]] [start, end]
 
|p1= start: [[Array]] format [[PositionAGL]] - start position


| '''terrainIntersect''' [pos1, pos2]
|p2= end: [[Array]] format [[PositionAGL]] - end position


|p1= [pos1, pos2]: [[Array]]
|r1= [[Boolean]]
|p2= pos1: [[Array]] - start position in format [[PositionAGL]]
|p3= pos2: [[Array]] - end position in format [[PositionAGL]]


| [[Boolean]]
 
|x1= <code>_intersects = [[terrainIntersect]] [<nowiki/>[[getPos]] [[player]], [[getPos]] chopper];</code>
|x1= <code>_intersects = [[terrainIntersect]] [<nowiki/>[[getPos]] [[player]], [[getPos]] chopper];</code>
|x2= <code>_intersects = [[terrainIntersect]] [<nowiki/>[[position]] [[player]], [[position]] enemy1];</code>
|x2= <code>_intersects = [[terrainIntersect]] [<nowiki/>[[position]] [[player]], [[position]] enemy1];</code>


|seealso= [[terrainIntersectAtASL]], [[lineIntersectsSurfaces]], [[intersect]], [[lineIntersects]], [[lineIntersectsWith]], [[terrainIntersectASL]], [[lineIntersectsObjs]], [[checkVisibility]]
}}


| [[terrainIntersectAtASL]], [[lineIntersectsSurfaces]], [[intersect]], [[lineIntersects]], [[lineIntersectsWith]], [[terrainIntersectASL]], [[lineIntersectsObjs]], [[checkVisibility]]
{{Note
|user= Lou Montana
|timestamp= 20120531104000
|text= Please note the difference:
* terrainIntersect
* terrainIntersectASL
* lineIntersect'''''s'''''
* lineIntersect'''''s'''''With
* lineIntersect'''''s'''''Objs
* intersect
}}


{{Note
|user= Rocket
|timestamp= 20120601155500
|text= This command is CPU intensive on the engine, be careful with its use.
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= Dwarden
<!-- Note Section BEGIN -->
|timestamp= 20120623171500
 
|text= This command was changed to ATL and counterpart for ASL was added in build 94049.
<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
*terrainIntersectASL
*lineIntersect'''''s'''''
*lineIntersect'''''s'''''With
*lineIntersect'''''s'''''Objs
*intersect
 
<dd class="notedate">Posted on may 31, 2012 - 10:40 (CEST)
<dt class="note">[[User:Rocket|Rocket]]
<dd class="note">This command is CPU intensive on the engine, be careful with its use.
 
<dd class="notedate">Posted on Jun 23, 2012 - 17:15 (CEST)
<dt class="note">[[User:Dwarden|Dwarden]]
<dd class="note">This command was changed to ATL and counterpart for ASL was added in build 94049.
 
 
<!-- Note Section END -->
</dl>
 
 
[[Category:Arma 2: Operation Arrowhead: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 02:45, 25 November 2021

Hover & click on the images for description

Description

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

Syntax

Syntax:
terrainIntersect [start, end]
Parameters:
start: Array format PositionAGL - start position
end: Array format PositionAGL - end position
Return Value:
Boolean

Examples

Example 1:
_intersects = terrainIntersect [getPos player, getPos chopper];
Example 2:
_intersects = terrainIntersect [position player, position enemy1];

Additional Information

See also:
terrainIntersectAtASLlineIntersectsSurfacesintersectlineIntersectslineIntersectsWithterrainIntersectASLlineIntersectsObjscheckVisibility

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.
Dwarden - c
Posted on Jun 23, 2012 - 17:15 (UTC)
This command was changed to ATL and counterpart for ASL was added in build 94049.