{"name":"terrainIntersect","title":"terrainIntersect","type":"command","url":"https://community.bistudio.com/wiki/terrainIntersect","revid":377407,"updated":"2026-01-02T06:45:07Z","groups":["Math - Geometry"],"status":"ok","games":{"arma2oa":"1.62","tkoh":"1.00","arma3":"0.50"},"since":"arma2oa 1.62","arma3_since":"0.50","description":"Checks for intersection of terrain between two AGL positions. Returns true if intersects with terrain. For ASL variant see terrainIntersectASL.","syntaxes":[{"syntax":"terrainIntersect [start, end]","params":[{"name":"start","type":"PositionAGL","description":"start position","type_expr":"PositionAGL"},{"name":"end","type":"PositionAGL","description":"end position","type_expr":"PositionAGL"}],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"unary","right":{"text":"[start, end]"}}],"examples":[{"code":["_intersects = terrainIntersect [getPos player, getPos chopper];"]},{"code":["_intersects = terrainIntersect [position player, position enemy1];"]}],"see_also":["terrainIntersectAtASL","lineIntersectsSurfaces","intersect","lineIntersects","lineIntersectsWith","terrainIntersectASL","lineIntersectsObjs","checkVisibility"],"notes":[{"user":"Lou Montana","date":"2012-05-31T10:40:00Z","text":"Please note the difference:\n\n- terrainIntersect\n- terrainIntersectASL\n- lineIntersect***s***\n- lineIntersect***s***With\n- lineIntersect***s***Objs\n- intersect"},{"user":"Rocket","date":"2012-06-01T15:55:00Z","text":"This command is CPU intensive on the engine, be careful with its use."},{"user":"Dwarden","date":"2012-06-23T17:15:00Z","text":"This command was changed to ATL and counterpart for ASL was added in build 94049."}]}