terrainIntersectASL: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
Line 23: Line 23:
|r1= [[Boolean]]
|r1= [[Boolean]]


|x1= <code>_intersects = terrainIntersectASL [<nowiki/>getPosASL player, [[getPosASL]] chopper];</code>
|x1= <code>_intersects = terrainIntersectASL [<nowiki/>getPosASL player, getPosASL chopper];</code>


|x2= <code>_intersects = terrainIntersectASL [<nowiki/>eyePos player, [[eyePos]] enemy1];</code>
|x2= <code>_intersects = terrainIntersectASL [<nowiki/>eyePos player, eyePos enemy1];</code>


|seealso= [[terrainIntersectAtASL]] [[lineIntersectsSurfaces]] [[intersect]] [[lineIntersects]] [[lineIntersectsWith]] [[terrainIntersect]] [[lineIntersectsObjs]] [[checkVisibility]]
|seealso= [[terrainIntersectAtASL]] [[lineIntersectsSurfaces]] [[intersect]] [[lineIntersects]] [[lineIntersectsWith]] [[terrainIntersect]] [[lineIntersectsObjs]] [[checkVisibility]]

Revision as of 11:19, 12 May 2022

Hover & click on the images for description

Description

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

Syntax

Syntax:
terrainIntersectASL [start, end]
Parameters:
start: Array format PositionASL - start position
end: Array format PositionASL - end position
Return Value:
Boolean

Examples

Example 1:
_intersects = terrainIntersectASL [getPosASL player, getPosASL chopper];
Example 2:
_intersects = terrainIntersectASL [eyePos player, eyePos enemy1];

Additional Information

See also:
terrainIntersectAtASL lineIntersectsSurfaces intersect lineIntersects lineIntersectsWith terrainIntersect 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.
bloodwyn1756 - c
Posted on Mar 02, 2019 - 20:29 (UTC)
If one of the two positions is below sea level, the command always returns true.