MIST getPointOnSegment

From DCS World Wiki - Hoggitworld.com


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