Clamp Angle

Pure
ClampAngle

Clamps an angle in degrees, correctly handling the 360/0 wraparound boundary.

Type: Pure (no side effects)
Category: Fortuna|Math & Numeric
Keywords: math & numeric

Inputs

NameTypeDefaultDescription
AnglefloatAngle parameter
MinAnglefloatMinAngle parameter
MaxAnglefloatMaxAngle parameter

Outputs

NameTypeDescription
ReturnValuefloatReturnValue output

Example Use Cases

Example 1

Limit a turret's rotation range.

Example 2

Restrict camera pitch to prevent flipping.