MIST getRandPointInCircle

From DCS World Wiki - Hoggitworld.com
Revision as of 22:59, 13 April 2018 by Grimes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.getRandPointInCircle

Added with: Mist 2.0
Description
Returns a randomly generated vec2 coordinate within the specified radius around the center of vec 2 or vec3 point given. If the optional variable innerRadius is given the random point will be generated that has a minimum distance of innerRadius and a maximum distance of radius from the point.
Syntax
vec2 mist.getRandPointInCircle(table vec2/vec3 ,number radius , number innerRadius )
Valid Input Values:
vec2/vec3 = valid vec2/3 table
radius = any positive number
innerRadius = any positive number less than radius
Return value:
vec2
Return example:
Template:Vec2
Usage Examples:
The following code will deploy a smoke marker randomly inside a zone.

do

local zone = trigger.misc.getZone('myZone')
local newPoint = mist.getRandPointInCircle(zone.point, zone.radius)

end

Notes:
Used within: groupToRandomZone, groupRandomDistSelf, groupToRandomPoint
Related Functions
makeUnitTable, getRandPointInCircle, getRandomPointInZone, getRandomPointInPoly, isTerrainValid, terrainHeightDiff, getUnitsInZones, getUnitsInMovingZones, pointInPolygon, getUnitsInPolygon, getDeadMapObjsInZones, getDeadMapObjsInPolygonZone, getUnitsLOS, random, randomizeNumTable, getAvgPoint, getQFE, getWindBearingAndVel, getPathLength, getPathInSegments, getPointAtDistanceOnPath, projectPoint, getGroupsByAttribute, , getUnitsByAttribute, mapValue,

Scripting Engine

MIST Root Page