User Tools

Site Tools


4rpl:commands:getterrainlos

This is an old revision of the document!


Index

GetTerrainLOS

GetTerrainLOS(<-start <-end <-checkLastCell) ->hit

Description

Checks a line running from start to end and returns the terrain cell (if any) that the line first intersects. The 'start', 'end' and 'hit' vars are all vectors. This routine is useful for checking the exact terrain line of sight. If a unit wants to fire from any location in 3d space to any location in 3d space, this routine can check if there is any terrain in the way. The return value is the vector position in 3d space (floats) of the location where the collision took place. If there is no collision, then the returned hit locations are negative.

Examples

V3(0 2 0) ->start
V3(20 2 0) ->end
GetTerrainLOS(<-start <-end) ->hit

Index

4rpl/commands/getterrainlos.1610121708.txt.gz · Last modified: 2021/01/08 11:01 by 127.0.0.1