From 82f5a75ecdf0e8a0a92f6477c609024a791da94e Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Tue, 23 Jan 2024 23:54:30 -0500 Subject: [PATCH] scale animation delta to seconds --- lib/tick.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tick.ts b/lib/tick.ts index 9a2161a..a4b8c2b 100644 --- a/lib/tick.ts +++ b/lib/tick.ts @@ -19,7 +19,7 @@ export function tick(fps: number): Source { let animationFrame = requestAnimationFrame(function animationTick() { const now = new Date().getTime(); - callback(["render", now - lastPhysicsTick]); + callback(["render", (now - lastPhysicsTick) / 1000]); animationFrame = requestAnimationFrame(animationTick); });