terrainIntersect: Difference between revisions

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


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


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


| Checks for intersection of terrain between two positions. Returns true if intersects with terrain. ''Uses [[PositionASL]]'' |= Description
|game3= arma3
|version3= 0.50


| '''Note: This command is CPU intensive on the engine, be careful with its use.'''
|gr1= Math - Geometry
____________________________________________________________________________________________


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


|p1= pos1: [[PositionASL]] |= Parameter 1
|s1= [[terrainIntersect]] [start, end]
|p2= pos2: [[PositionASL]] |= Parameter 2


| [[Boolean]] |= Return value
|p1= start: [[Array]] format [[Position#PositionAGL|PositionAGL]] - start position
____________________________________________________________________________________________
 
|x1= <pre>terrainIntersect [getPosASL player, getPosASL chopper]</pre> |= Example 1
|x2= <pre>_doesIntersect = terrainIntersect [ position player, position enemy1 ];</pre> |= Example 2


____________________________________________________________________________________________
|p2= end: [[Array]] format [[Position#PositionAGL|PositionAGL]] - end position


| [[lineIntersects]], [[lineIntersectsWith]] |= See also
|r1= [[Boolean]]


}}
|x1= <sqf>_intersects = terrainIntersect [getPos player, getPos chopper];</sqf>


<h3 style="display:none">Notes</h3>
|x2= <sqf>_intersects = terrainIntersect [position player, position enemy1];</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on may 31, 2012 - 10:40 (CEST)
|seealso= [[terrainIntersectAtASL]] [[lineIntersectsSurfaces]] [[intersect]] [[lineIntersects]] [[lineIntersectsWith]] [[terrainIntersectASL]] [[lineIntersectsObjs]] [[checkVisibility]]
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''
}}
<dd class="note">Please note the difference :
*terrainIntersect
*lineIntersect'''''s'''''
*lineIntersect'''''s'''''With


<!-- Note Section END -->
{{Note
</dl>
|user= Lou Montana
|timestamp= 20120531104000
|text= Please note the difference:
* terrainIntersect
* terrainIntersectASL
* lineIntersect'''''s'''''
* lineIntersect'''''s'''''With
* lineIntersect'''''s'''''Objs
* intersect
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
|user= Rocket
|timestamp= 20120601155500
|text= This command is CPU intensive on the engine, be careful with its use.
}}


[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
{{Note
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|user= Dwarden
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
|timestamp= 20120623171500
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|text= This command was changed to ATL and counterpart for ASL was added in build 94049.
}}

Latest revision as of 10:38, 13 May 2022

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:
terrainIntersectAtASL lineIntersectsSurfaces intersect lineIntersects lineIntersectsWith terrainIntersectASL 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.
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.