CLAMP_ANGLE(AngleDegrees, MinAngleDegrees, MaxAngleDegrees)
Clamps an arbitrary angle to be between the given angles. Will clamp to nearest boundary.
Float CLAMP_ANGLE(Float AngleDegrees, Float MinAngleDegrees, Float MaxAngleDegrees)
AngleDegrees - Angle to clamp. If it is not of type float, it is implicitly converted to type float.
MinAngleDegrees - 'from' angle that defines the beginning of the range of valid angles (sweeping clockwise). If it is not of type float, it is implicitly converted to type float.
MaxAngleDegrees - 'to' angle that defines the end of the range of valid angles. If it is not of type float, it is implicitly converted to type float.
Clamped angle in the range -180..180.
> PRINT CLAMP_ANGLE(30, 40, 50)
40.000000
> PRINT CLAMP_ANGLE(0, 40, 330)
-30.000000