Jump to content

GetHeadingDegrees

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (getHeadingDegrees – created via PowerShell script (2025-11-11T21:12:35Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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: