add method to Smoother
This commit is contained in:
parent
bed9bba375
commit
1d95f8676f
1 changed files with 9 additions and 0 deletions
|
@ -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}",
|
||||||
|
|
Loading…
Reference in a new issue