Jump to content

ValidateDir

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (ValidateDir – created via PowerShell script (2025-11-11T21:12:34Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: ValidateDir
Function Description: Validates a direction value in degrees by normalizing it to the range [0, 360), adjusting negative values by adding 360 and values above 360 by subtracting 360.
File Location: cmm.positionFunctions.lua
Syntax: CMM.ValidateDir( number Dir )
Return Value: number
Parameters: Name Description
DirDirection in degrees; if negative, is adjusted to positive; if greater than or equal to 360, is reduced to within [0, 360).
Example: CMM.ValidateDir(-45)
Example Description: Returns 315, demonstrating normalization of a negative direction value to its equivalent positive form.
Related Functions:
Notes: