Skip to content

Commit d660e0f

Browse files
committed
Handle dt == 0 when lerping
1 parent 9d12208 commit d660e0f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

orthographic/camera.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ end
104104
-- return vmath.lerp(1 - math.pow(t, dt), v1, v2)
105105
-- https://www.gamasutra.com/blogs/ScottLembcke/20180404/316046/Improved_Lerp_Smoothing.php
106106
local function lerp_with_dt(t, dt, v1, v2)
107+
if dt == 0 then return vmath.lerp(t, v1, v2) end
107108
local rate = UPDATE_FREQUENCY * math.log10(1 - t)
108109
return vmath.lerp(1 - math.pow(10, rate * dt), v1, v2)
109110
--return vmath.lerp(t, v1, v2)

0 commit comments

Comments
 (0)