MCPcopy Create free account
hub / github.com/PerroEngine/Perro / damp

Function damp

perro_source/api_modules/perro_modules/src/math.rs:217–224  ·  view source on GitHub ↗
(current: f32, target: f32, lambda: f32, delta_time: f32)

Source from the content-addressed store, hash-verified

215
216#[inline]
217pub 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]
227pub fn smooth_damp(

Callers 2

damp_moves_toward_targetFunction · 0.85

Calls 1

lerp_coreFunction · 0.85

Tested by 2

damp_moves_toward_targetFunction · 0.68