TestLineAgainstWater: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
{{Client function}}
{{Client function}}
This function checks to see if a line between two points collides with the water. This is similar to [[processLineOfSight]], but only collides with water. Waves are taken into account when testing the line.
This function checks to see if a line between two points collides with the water. This is similar to [[processLineOfSight]], but only collides with water. Waves are taken into account when testing the line.
==Syntax==  
 
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool float float float testLineAgainstWater ( float startX, float startY, float startZ, float endX, float endY, float endZ )
bool float float float testLineAgainstWater ( float startX, float startY, float startZ, float endX, float endY, float endZ )
</syntaxhighlight>
</syntaxhighlight>
===Required Arguments===
*'''startX, startY, startZ:''' the position of the starting point of the line
*'''endX, endY, endZ:''' the position of the end point of the line
===Returns===
Returns ''true'' and the position of the intersection point of the line and the water surface if there is a collision, or ''false'' if there is no collision.
==See Also==
{{Client world functions}}

Revision as of 17:44, 7 February 2009

This function checks to see if a line between two points collides with the water. This is similar to processLineOfSight, but only collides with water. Waves are taken into account when testing the line.

Syntax

bool float float float testLineAgainstWater ( float startX, float startY, float startZ, float endX, float endY, float endZ )

Required Arguments

  • startX, startY, startZ: the position of the starting point of the line
  • endX, endY, endZ: the position of the end point of the line

Returns

Returns true and the position of the intersection point of the line and the water surface if there is a collision, or false if there is no collision.

See Also