(current: f32, target: f32, lambda: f32, delta_time: f32)
| 215 | |
| 216 | #[inline] |
| 217 | pub fn damp(current: f32, target: f32, lambda: f32, delta_time: f32) -> f32 { |
| 218 | if lambda <= 0.0 || delta_time <= 0.0 { |
| 219 | return current; |
| 220 | } |
| 221 | |
| 222 | let k = 1.0 - (-lambda * delta_time).exp(); |
| 223 | lerp_core(current, target, k) |
| 224 | } |
| 225 | |
| 226 | #[inline] |
| 227 | pub fn smooth_damp( |