From fbf017786eb50bcc2b7e4bd82d3979c935aff3e0 Mon Sep 17 00:00:00 2001 From: YellowTide Date: Fri, 19 May 2017 07:01:07 -0500 Subject: [PATCH] fixed functionality of utils.lerp() ((a - b) + b)*t = a*t switched to (1-t)*b + a*t visualization of change: https://www.desmos.com/calculator/91ge9obdoi --- modules/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/utils.lua b/modules/utils.lua index b1e1fe8..cf516d1 100644 --- a/modules/utils.lua +++ b/modules/utils.lua @@ -74,7 +74,7 @@ end -- @param progress (0-1) -- @return number function utils.lerp(low, high, progress) - return ((high - low) + low) * progress + return (1 - progress) * low + progress * high end --- Exponential decay