Difference between revisions of "DCS func getIP"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
Line 56: Line 56:
 
}}
 
}}
 
[[Category:Singleton Functions|getIP]]
 
[[Category:Singleton Functions|getIP]]
 +
[[Category:Game Patch 1.2.0|getIP]]

Latest revision as of 06:48, 17 March 2022

Scripting Root

Envrioment: Mission Scripting
Function: getIP Added with: 1.2.0
Member Of: land
Syntax: vec3 land.getIP(table origin , table direction , number distance )
Description: Returns an intercept point at which a ray drawn from the origin in the passed normalized direction for a specified distance. If no intersection found the function will return nil.


Return Value: vec3
Return Example: vec3
Examples: The following is a sample of a tracked weapon object that is checked periodically and updates the estimated impact point of the weapon.
for id, wpn in pairs(trackedWeapons) do
  local wpnData = {}
  wpnData.pos = wpn:getPosition().p
  wpnData.dir = wpn:getPosition().x
  wpn.ip = land.getIP(wpnData.pos, wpnData.dir, 20)
end
Related Functions: land functions: getHeight, getSurfaceHeightWithSeabed, getSurfaceType, isVisible, getIP, profile, getClosestPointOnRoads, findPathOnRoads
Notes: