Difference between revisions of "MIST getPointOnSegment"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.shape.getPointOnSegment| |vNum = Mist 4.5 |desc= Returns the closet point on a line segment to the passed point value. By default assumes a...")
 
 
Line 9: Line 9:
 
Optional isSegment value can be used to specify that the line segment is fixed between the two points.  
 
Optional isSegment value can be used to specify that the line segment is fixed between the two points.  
  
|rtnType= boolean
+
|rtnType= vec2
  
 
|reqType1= table
 
|reqType1= table

Latest revision as of 04:09, 23 May 2022


mist.shape.getPointOnSegment

Added with: Mist 4.5
Description
Returns the closet point on a line segment to the passed point value. By default assumes an infinite line segment.

Optional isSegment value can be used to specify that the line segment is fixed between the two points.

Syntax
vec2 mist.shape.getPointOnSegment(table point ,table segment , boolean isSegment )
Valid Input Values:
Point: Vec2/Vec3

Segment: Table of two points in vec2/vec3

Return value:
vec2
Return example:
point
Usage Examples:
Creates the value pushPoint based on the location of the target unit relative to the line defined by pushLine.
   local target= Unit.getByName('sa15'):getPoint()
   local pushLine= {trigger.misc.getZone('plStart').point,trigger.misc.getZone('plEnd').point }
   local pushPoint = mist.shape.getPointOnSegment(target, pushLine)
Notes:
Related Functions
insideShape, circleInCircle, circleInPoly, polyInPoly, polyInCircle, getPointOnSegment, segmentIntersect

Scripting Engine

MIST Root Page