add method to Smoother

This commit is contained in:
Weird Constructor 2022-08-09 05:13:23 +02:00
parent bed9bba375
commit 1d95f8676f

View file

@ -42,6 +42,15 @@ impl Smoother {
self.done = false; self.done = false;
} }
#[inline]
pub fn current(&self) -> f32 {
if self.done {
self.target
} else {
self.value
}
}
#[inline] #[inline]
pub fn next(&mut self) -> f32 { pub fn next(&mut self) -> f32 {
//d// println!("NEXT: count={}, value={:6.3} inc={:6.4}", //d// println!("NEXT: count={}, value={:6.3} inc={:6.4}",