-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Within the WorldStep function, there is a while loop which repeats until (among other conditions) the total amount of time spent simulating the world during this call exceeds the fixed time step allowance. However, the totalTime variable (which is key to this condition) is reset upon each iteration of the loop, and so only represents the amount of time simulating the most recent step, rather than all the steps during this call.
The return value of totalTime is also therefore inaccurate, as it only returns the time spent performing a single iteration of the loop, rather than the total time spent "stepping".
I think a fix for this just requires changing this line:
totalTime = (end - start) / 1000;
to:
totalTime += (end - start) / 1000;
Metadata
Metadata
Assignees
Labels
No labels