MIST circleInPoly

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


mist.shape.circleInPoly

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

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

Syntax
boolean mist.shape.circleInPoly(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 would return true if an artillery unit with a range of 30km is able to fire on a point within a polygon defined by the group "village"
   local arty= Unit.getByName('arty'):getPoint()
   arty.radius = 30000
   local zone = mist.getGroupPoints('village')
   if mist.shape.circleInPoly(arty, zone ) == true then
     trigger.action.outText("The enemy artillery is now in range of that town we need to protect", 20)
   end
Notes:
Related Functions
insideShape, circleInCircle, circleInPoly, polyInPoly, polyInCircle, getPointOnSegment, segmentIntersect

Scripting Engine

MIST Root Page