IsLineOfSightClear: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Added documentation page)
Line 1: Line 1:
__NOTOC__
{{Client function}}
{{Needs Checking|Needs verifying default values for all optional args and explaining the meaning of some of them (''checkDummies, seeThroughStuff, ignoreSomeObjectsForCamera''). --[[User:Jbeta|jbeta]] 17:51, 12 August 2007 (CDT)}}
This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements.
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool isLineOfSightClear ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, element ignoredElement ] )
bool isLineOfSightClear ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, element ignoredElement ] )
</syntaxhighlight>
</syntaxhighlight>
===Required Arguments===
*'''startX:''' The first point's world X coordinate.
*'''startY:''' The first point's world Y coordinate.
*'''startZ:''' The first point's world Z coordinate.
*'''endX:''' The second point's world X coordinate.
*'''endY:''' The second point's world X coordinate.
*'''endZ:''' The second point's world X coordinate.
===Optional Arguments===
{{OptionalArg}}
*'''checkBuildings:''' A [[boolean]] denoting whether to check buildings or ignore them.
*'''checkVehicles:''' A [[boolean]] denoting whether to check vehicles or ignore them.
*'''checkPeds:''' A [[boolean]] denoting whether to check peds or ignore them.
*'''checkObjects:''' A [[boolean]] denoting whether to check objects or ignore them.
*'''checkDummies:''' A [[boolean]] denoting whether to check dummies or ignore them.
*'''seeThroughStuff:''' A [[boolean]] denoting whether to check see-through objects or ignore them.
*'''ignoreSomeObjectsForCamera:''' ?.
*'''ignoredElement:''' A physical [[element]] that is to be ignored during the test.
===Returns===
Returns ''true'' if the line between the specified points is clear, ''false'' if there's an obstacle or if invalid parameters are passed.
==Example==
Example goes here
<syntaxhighlight lang="lua">
</syntaxhighlight>
==See Also==
{{Client world functions}}
[[Category:Need_Syntax]]
[[Category:Incomplete]]

Revision as of 22:51, 12 August 2007

Dialog-information.png This article needs checking.

Reason(s): Needs verifying default values for all optional args and explaining the meaning of some of them (checkDummies, seeThroughStuff, ignoreSomeObjectsForCamera). --jbeta 17:51, 12 August 2007 (CDT)

This function checks if there are obstacles between two points of the game world, optionally ignoring certain kinds of elements.

Syntax

bool isLineOfSightClear ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, element ignoredElement ] )

Required Arguments

  • startX: The first point's world X coordinate.
  • startY: The first point's world Y coordinate.
  • startZ: The first point's world Z coordinate.
  • endX: The second point's world X coordinate.
  • endY: The second point's world X coordinate.
  • endZ: The second point's world X coordinate.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • checkBuildings: A boolean denoting whether to check buildings or ignore them.
  • checkVehicles: A boolean denoting whether to check vehicles or ignore them.
  • checkPeds: A boolean denoting whether to check peds or ignore them.
  • checkObjects: A boolean denoting whether to check objects or ignore them.
  • checkDummies: A boolean denoting whether to check dummies or ignore them.
  • seeThroughStuff: A boolean denoting whether to check see-through objects or ignore them.
  • ignoreSomeObjectsForCamera: ?.
  • ignoredElement: A physical element that is to be ignored during the test.

Returns

Returns true if the line between the specified points is clear, false if there's an obstacle or if invalid parameters are passed.

Example

Example goes here


See Also

Shared