Click or drag to resize
MathUtilsClampT Method
Clamps the passed value to the passed bounds (i.e. if value is smaller than min bound it's set to min bound, if bigger than max bound it's set to max bound).

Namespace: Slash.Math.Utils
Assembly: Slash.Math (in Slash.Math.dll) Version: 1.0.6018.40177
Syntax
public static T Clamp<T>(
	T value,
	T min,
	T max
)
where T : Object, IComparable<T>

Parameters

value
Type: T
Value to clamp.
min
Type: T
Minimum bound.
max
Type: T
Maximum bound (inclusive).

Type Parameters

T
Type of the value to clamp.

Return Value

Type: T
Clamped value.
See Also