Method Clamp
Clamp(Int32, Int32, Int32)
Clamps the given value between the min and the max range. If the value is between min and max, value is returned
Declaration
public static int Clamp(int value, int min, int max)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value to clamp |
System.Int32 | min | The minimum value returned |
System.Int32 | max | The maximum value returned |
Returns
Type | Description |
---|---|
System.Int32 | If the value is between min and max, value is returned. If value is larger than max, max is returned. If value is smaller than min, min is returned. |
Clamp(Single, Single, Single)
Clamps the given value between the min and the max range. If the value is between min and max, value is returned
Declaration
public static float Clamp(float value, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | The value to clamp |
System.Single | min | The minimum value returned |
System.Single | max | The maximum value returned |
Returns
Type | Description |
---|---|
System.Single | If the value is between min and max, value is returned. If value is larger than max, max is returned. If value is smaller than min, min is returned. |