deki_lerp/lib.rs
1use deki_core::*;
2use std::ops::{Add, Mul, Sub};
3mod relative; pub use relative::*;
4mod absolute; pub use absolute::*;
5
6// Goodies \\
7
8 #[ext(pub trait DekiExtF32)]
9 impl f32 {
10 /// quick easing (smooth-step): has to be within 0..=1, consider using .clamp_unit() if not sure
11 #[inline]
12 fn smooth(self) -> f32 {
13 self * self * (3. - 2. * self)
14 }
15 /// same as `clamp(0.,1.)`
16 #[inline]
17 fn clamp_unit(self) -> f32 {self.clamp(0.,1.)}
18 }
19
20// EOF \\