List of utility methods to do Float Number Clamp
float | clamp(float value, float min, float max) clamp return value < min ? min : value > max ? max : value;
|
float | clamp(float value, float min, float max) Restricts a value to be within a specified range. value = (value > max) ? max : value;
value = (value < min) ? min : value;
return value;
|
float | clamp(float value, float minimum, float maximum) Assure that a value is between two other values. return Math.max(Math.min(value, maximum), minimum);
|
float | clamp(float value, float minimum, float maximum) Clamps the value to the specified range. return (value < minimum ? minimum : (value > maximum ? maximum : value));
|
float | clamp(float x, float a, float b) Clamp a value to an interval. return (x < a) ? a : (x > b) ? b : x;
|
float | clamp(float x, float y, float z) Returns middle value from all three if (x > y) { float tmp = x; x = y; y = tmp; return Math.max(x, Math.min(y, z)); |
float | clamp180(float r1, float r2) clamp return clamp180(r1, r2, 0);
|
float | clamp1f(float f) clampf if (f > 1f) return 1f; if (f < -1f) return -1f; return f; |
float | clamp360(float dir) clamp float outDirAbs = Math.abs(dir); float outDir; if (outDirAbs > 360.0f) { if (outDirAbs > 720.0f) { outDir = dir % 360.0f; } else { outDir = (dir > 0.0f) ? dir - 360.0f : dir + 360.0f; outDirAbs = Math.abs(outDir); } else { if (dir < 0.0f) outDir = dir + 360.0f; else outDir = dir; return outDir; |
float | clamp_float(float p_76131_0_, float p_76131_1_, float p_76131_2_) Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters return p_76131_0_ < p_76131_1_ ? p_76131_1_ : (p_76131_0_ > p_76131_2_ ? p_76131_2_ : p_76131_0_);
|