linearly v0.32.0Docs


linearly v0.32.0 / vec3 / clamp

Function: clamp()

clamp(v, min, max): vec3

Constrain a value to lie between two further values

Parameters

v: vec3

the value to constrain

min: number | vec3

the lower end of the range into which to constrain v

max: number | vec3

the upper end of the range into which to constrain v

Returns

vec3

See

https://thebookofshaders.com/glossary/?search=clampopen in new window

Defined in

src/vec3.ts:305open in new window