public static float clamp(float input, float min, float max) {
        return (input < min) ? min : (input > max) ? max : input;
    }
Take a float input and clamp it between min and max.

@param input the value to be clamped
@param min the minimum output value
@param max the maximum output value
@return clamped input
jme3-core/src/main/java/com/jme3/math/FastMath.java