Arma 3 Scripting

Command in Math - Geometry

terrainIntersect

Also available as Markdown and JSON, or read the original wiki page.

Description

Checks for intersection of terrain between two AGL positions. Returns true if intersects with terrain. For ASL variant see terrainIntersectASL.

Syntax

terrainIntersect [start, end]

Parameters:

Returns: Boolean

Examples

Example 1

_intersects = terrainIntersect [getPos player, getPos chopper];

Example 2

_intersects = terrainIntersect [position player, position enemy1];

See also

terrainIntersectAtASL · lineIntersectsSurfaces · intersect · lineIntersects · lineIntersectsWith · terrainIntersectASL · lineIntersectsObjs · checkVisibility

Community notes

Lou Montana

Please note the difference:

  • terrainIntersect
  • terrainIntersectASL
  • lineIntersects
  • lineIntersectsWith
  • lineIntersectsObjs
  • intersect
Rocket

This command is CPU intensive on the engine, be careful with its use.

Dwarden

This command was changed to ATL and counterpart for ASL was added in build 94049.