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...")
(No difference)

Revision as of 22:20, 11 February 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
boolean 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:
boolean
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