This is an old revision of the document!
⇐ Index
GetTerrainLOS(<-start <-end <-checkLastCell) ->hit
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.
V3(0 2 0) ->start V3(20 2 0) ->end GetTerrainLOS(<-start <-end) ->hit
⇐ Index