Function glm::builtin::clamp_s [] [src]

pub fn clamp_s<S: BaseNum, T: GenNumVec<S>>(x: T, min_val: S, max_val: S) -> T

A variant of function clamp that uses scalar values as thresholds.

Note

clamp_s is not a GLSL function name.

Example

use glm::{ clamp_s, dvec2 };

let dv2 = dvec2(-1., 3.14);
assert_eq!(clamp_s(dv2, 0., 1.), dvec2(0., 1.));