MIST getDir

From DCS World Wiki - Hoggitworld.com
Revision as of 22:56, 13 April 2018 by Grimes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.utils.getDir

Added with: Mist 2.0
Description
gets heading-error corrected direction from point along line vector vec in radians. Value will always be between 0 and 2Pi (360 degrees)
Syntax
number mist.utils.getDir(vec3 vec , vec3 point )
Valid Input Values:
mist.utils.getDir(mist.vec.sub(point1, point2))
Return value:
number
Return example:
Angle in radians
Usage Examples:
If given two points and using mist.vec.sub to get the line vector, the line "drawn" from p2 to p1.
 local p1 = mist.utils.makeVec3GL(trigger.misc.getZone('z1').point)
 local p2 = mist.utils.makeVec3GL(trigger.misc.getZone('z2').point)
 local dir = mist.utils.getDir(mist.vec.sub(p1, p2))
Notes:
mist.getNorthCorrection is part of this function only if the optional variable is passed.

With mist 4.0.59 the point variable is optional to allow for returning a "raw" heading between two points.

Related Functions
getHeading, getNorthCorrection, getAttitude, getPitch, getRoll, getYaw, getAoA, getClimbAngle, getDir

Scripting Engine

MIST Root Page