MIST getPointOnSegment

From DCS World Wiki - Hoggitworld.com


Added with: Mist 4.5
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.

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:
Return example:
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)
Related Functions
insideShape, circleInCircle, circleInPoly, polyInPoly, polyInCircle, getPointOnSegment, segmentIntersect

Scripting Engine

MIST Root Page