Difference between revisions of "MIST getHeadingPoints"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.utils.getHeadingPoints| |vNum = Mist 4.5 |desc= Returns the heading from the first point to the second point. If the optional corrected val...")
 
 
Line 5: Line 5:
 
|vNum = Mist 4.5
 
|vNum = Mist 4.5
  
|desc= Returns the heading from the first point to the second point. If the optional corrected value is passed then the heading will be corrected for any north offset. Use this optional value if you are giving a heading direction for a player to follow with their avionics. Do not pass it if you are using this function to get the orientation for AI.  
+
|desc= Returns the heading from the first point to the second point in radians. If the optional corrected value is passed then the heading will be corrected for any north offset. Use this optional value if you are giving a heading direction for a player to follow with their avionics. Do not pass it if you are using this function to get the orientation for AI.  
  
 
|rtnType= number
 
|rtnType= number

Latest revision as of 22:33, 13 October 2024


mist.utils.getHeadingPoints

Added with: Mist 4.5
Description
Returns the heading from the first point to the second point in radians. If the optional corrected value is passed then the heading will be corrected for any north offset. Use this optional value if you are giving a heading direction for a player to follow with their avionics. Do not pass it if you are using this function to get the orientation for AI.
Syntax
number mist.utils.getHeadingPoints(table point1 ,table point2 , boolean corrected )
Valid Input Values:
point1 = vec2 or vec3

point2 = vec2 or vec3

Return value:
number
Return example:
1.34674373
Usage Examples:
The following example could be used when spawning a JTAC so that it is facing toward the group it is setup to designate.
      heading = mist.utils.getHeadingPoints(jtacPoint, targetPoint)
Notes:
Related Functions
add, sub, scalar_mult, dp, cp, mag, getUnitVec, rotateVec2, get2DDist, get3DDist, getHeadingPoints

Scripting Engine

MIST Root Page