clamp

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

Clamps each component into the range [min, max] (assumed component-wise min <= max).

Return

A reference to this vector.

Parameters

min

The minimum x and y values.

max

The maximum x and y values in the desired range.