11 lines
248 B
Odin
11 lines
248 B
Odin
// "Engine" math, to avoid aliasing with core:math
|
|
package emath
|
|
|
|
import "core:math"
|
|
|
|
_ :: math
|
|
|
|
exp_smooth :: proc "contextless" (target: $T, pos: T, speed: f32, dt: f32) -> T {
|
|
return pos + ((target - pos) * (1.0 - math.exp_f32(-speed * dt)))
|
|
}
|