MIST polyInCircle

From DCS World Wiki - Hoggitworld.com
Revision as of 22:09, 11 February 2022 by Grimes (talk | contribs) (Created page with "{{Mission Scripting |fName= mist.shape.polyInCircle| |vNum = Mist 4.5 |desc= Determines whether or not the passed polygon is inside of the passed circle. Optional full ent...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.shape.polyInCircle

Added with: Mist 4.5
Description
Determines whether or not the passed polygon is inside of the passed circle.

Optional full entry requires the entire shape to be inside of the other shape to return true.

Syntax
boolean mist.shape.polyInCircle(table circle ,table polygon , boolean full )
Valid Input Values:
Circle: table with point and radius entries

Poly: table of 3 points or more.

Return value:
boolean
Return example:
true or false
Usage Examples:
The following returns true if the passed polygon representing a village is completely inside the radius of the circle defined by artillery range.
   local arty= Unit.getByName('arty'):getPoint()
   arty.radius = 30000
   local zone = mist.getGroupPoints('village')
   if mist.shape.polyInCircle(zone, circle, true) == true then
     trigger.action.outText("Oh no! Any part of the town can be targeted by artillery.", 20)
   end
Notes:
Related Functions
insideShape, circleInCircle, circleInPoly, polyInPoly, polyInCircle, getPointOnSegment, segmentIntersect

Scripting Engine

MIST Root Page