Difference between revisions of "DCS func getClosestPointOnRoads"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
Line 16: Line 16:
  
 
NOTE that this function does not use vec2 or vec3. It uses individual values representing a vec2 for x and y.  
 
NOTE that this function does not use vec2 or vec3. It uses individual values representing a vec2 for x and y.  
 +
 +
Valid road type values: 'roads' and 'railroads'
  
 
|rtnType= number, number
 
|rtnType= number, number

Revision as of 05:15, 18 October 2020

Scripting Root

Envrioment: Mission Scripting
Function: getClosestPointOnRoads Added with: 2.5
Member Of: land
Syntax: number, number land.getClosestPointOnRoads(string roadType , number xCoord , number yCoord )
Description: Returns a coordinate of the nearest road from the passed point.

NOTE that this function does not use vec2 or vec3. It uses individual values representing a vec2 for x and y.

Valid road type values: 'roads' and 'railroads'


Return Value: number, number
Return Example: 233324, 423423
Examples: The following returns the closest road to a point.

local testPoint = trigger.misc.getZone('test').point local x, y = land.getClosestPointOnRoads('roads',testPoint.x, testPoint.z)

Related Functions: land functions: getHeight, getSurfaceHeightWithSeabed, getSurfaceType, isVisible, getIP, profile, getClosestPointOnRoads, findPathOnRoads
Notes: