GetHeadingDegrees
Appearance
| 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 |
| obj | GameObject 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: | ||