Jump to content

GetHeadingDegrees

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: getHeadingDegrees
Function Description: Calculates the heading of a GameObject in degrees by computing the arctangent of its position components, normalizing the result to the range [0, 360), and converting radians to degrees.
File Location: cmm.positionFunctions.lua
Syntax: CMM.getHeadingDegrees( 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.getHeadingDegrees(GameObject1)
Example Description: Returns the heading in degrees of GameObject1, computed from its position and normalized to ensure it is within the valid range.
Related Functions:
Notes: