clamp

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

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

Return

A reference to this vector.

Parameters

min

The minimum x, y and z values.

max

The maximum x, y and z values in the desired range.