clamp

fun clamp(    value: Double,     min: Double,     max: Double): Double
fun clamp(    value: Int,     min: Int,     max: Int): Int

Returns number whose value is limited between min and max.


@JvmName(name = "doubleClamp")
fun Double.clamp(min: Double, max: Double): Double
@JvmName(name = "intClamp")
fun Int.clamp(min: Int, max: Int): Int


fun Vector2.clamp(min: Vector2, max: Vector2): Vector2

Returns Vector2 whose value is limited between min and max per vector component.


fun Vector3.clamp(min: Vector3, max: Vector3): Vector3

Returns Vector3 whose value is limited between min and max per vector component.


fun Vector4.clamp(min: Vector4, max: Vector4): Vector4

Returns Vector4 whose value is limited between min and max per vector component.


fun IntVector2.clamp(min: IntVector2, max: IntVector2): IntVector2

Returns IntVector2 whose value is limited between min and max per vector component.


fun IntVector3.clamp(min: IntVector3, max: IntVector3): IntVector3

Returns IntVector3 whose value is limited between min and max per vector component.


fun IntVector4.clamp(min: IntVector4, max: IntVector4): IntVector4

Returns IntVector4 whose value is limited between min and max per vector component.

Sources

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard