Function glm::builtin::mix [] [src]

pub fn mix<F: BaseFloat, T: GenFloat<F>>(x: T, y: T, a: T) -> T

Returns the linear blend of x and y, i.e., x⋅(1−a)+y⋅a.

Example

use glm::{ mix, vec2 };

assert_eq!(mix(0_f32, 1_f32, 0.5), 0.5);
let x = vec2(1., 2.);
let y = vec2(3., 4.);
let a = vec2(0.5, 2.);
let r = vec2(2., 6.);
assert_eq!(mix(x, y, a), r);