Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit 10265b4

Browse files
committed
Use a fixed timestep for the graph's simulation
1 parent 4267c8a commit 10265b4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/screens/MainScreen.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ local cameraW;
4545

4646
local MainScreen = {};
4747

48+
-- ------------------------------------------------
49+
-- Constants
50+
-- ------------------------------------------------
51+
52+
local FIXED_TIMESTEP = 0.016;
53+
4854
-- ------------------------------------------------
4955
-- Constructor
5056
-- ------------------------------------------------
@@ -187,9 +193,9 @@ function MainScreen.new()
187193
function self:update( dt )
188194
LogReader.update( dt );
189195

190-
graph:update( dt );
196+
graph:update( FIXED_TIMESTEP );
191197

192-
AuthorManager.update( dt, camera:getRotation() );
198+
AuthorManager.update( FIXED_TIMESTEP, camera:getRotation() );
193199

194200
filePanel:setTotalFiles( FileManager.getTotalFiles() );
195201
filePanel:setSortedList( FileManager.getSortedList() );

0 commit comments

Comments
 (0)