terrainIntersect: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Text replacement - "\|x([0-9]) *= * <code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(7 intermediate revisions by the same user not shown)
Line 22: Line 22:
|r1= [[Boolean]]
|r1= [[Boolean]]


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


|x2= <code>_intersects = [[terrainIntersect]] [<nowiki/>[[position]] [[player]], [[position]] enemy1];</code>
|x2= <sqf>_intersects = terrainIntersect [position player, position enemy1];</sqf>


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



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.