Jump to content

GetHeading

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: getHeading
Function Description: Calculates the heading of a GameObject in radians by computing the arctangent of its position components and normalizing the result to the range [0, 2pi).
File Location: cmm.positionFunctions.lua
Syntax: CMM.getHeading( table obj )
Return Value: number
Parameters: Name Description
objGameObject table containing a getPosition method that returns a position object with x and z fields.
Example: CMM.getHeading(GameObject1)
Example Description: Returns the heading in radians of GameObject1, computed from its position and normalized to ensure it is within the valid range.
Related Functions:
Notes: