User Tools

Site Tools


4rpl:commands:getterrainlos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:getterrainlos [2024/04/09 16:52] – Cracked down on details and updated using vigerous testing Vertu4rpl:commands:getterrainlos [2024/04/13 14:27] (current) – [Description] durikkan
Line 3: Line 3:
  
 ====== GetTerrainLOS ====== ====== GetTerrainLOS ======
-GetTerrainLOS(<-start <-endPos <-checkLastCell) ->hit+GetTerrainLOS(<-startPos <-endPos <-checkLastCell) ->hitPos
  
 ===== Description ===== ===== Description =====
-Checks a line running from start to endPos and returns the world position (if any) where the line first ever intersects terrain geometry.\\+Checks a line running from startPos to endPos and returns the world position (if any) where the line first ever intersects terrain geometry.\\
 This routine is useful for checking the exact terrain Line Of Sight (LOS) between two points and where the LOS was blocked. 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 and where. This routine is useful for checking the exact terrain Line Of Sight (LOS) between two points and where the LOS was blocked. 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 and where.
  
--The 'start', 'endPos', and 'hit' vars are all vectors ([[V3]]) as floats.\\ +-The 'startPos ', 'endPos', and 'hitPos' vars are all vectors ([[V3]]) as floats.\\ 
--Returns the world space location of where the collision took place. If no hit occurs then all vector items are -2,147,483,648 (minimum 32 bit number).+-Returns the world space location of where the collision took place. If no hit occurs then the returned vector is the minimum value [-3.402823E+38-3.402823E+38-3.402823E+38].
  
 -CheckLastCell is a Boolean that will have the API extend its calculations past the endPos until it exits the cell the end position is within or a hit is encountered. A cell is a 1x1 square and any location within this square is within that cell (no matter the Y position). For reference, the center location of cell 10,15 is (10.5,15.5)((Any position with an X position between (10.000-11.000] and Z position between (15.000-16.000] would be within this cell.\\ -CheckLastCell is a Boolean that will have the API extend its calculations past the endPos until it exits the cell the end position is within or a hit is encountered. A cell is a 1x1 square and any location within this square is within that cell (no matter the Y position). For reference, the center location of cell 10,15 is (10.5,15.5)((Any position with an X position between (10.000-11.000] and Z position between (15.000-16.000] would be within this cell.\\
4rpl/commands/getterrainlos.txt · Last modified: 2024/04/13 14:27 by durikkan