Got rid of frameskipping because it wasn't working, fixed inaccuracies in delta time, added relative time for interpolation

This commit is contained in:
skyeshroom 2021-08-09 13:24:06 -07:00
parent 56448eceed
commit 3315491b0f
3 changed files with 20 additions and 22 deletions

2
Cargo.lock generated
View File

@ -103,7 +103,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "loopcore" name = "hypoloop"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"futures", "futures",

View File

@ -1,5 +1,5 @@
[package] [package]
name = "loopcore" name = "hypoloop"
version = "0.1.0" version = "0.1.0"
edition = "2018" edition = "2018"

View File

@ -1,6 +1,5 @@
use std::time::Instant; use std::time::Instant;
const UPDATE_INTERVAL: u32 = 40; const UPDATE_INTERVAL: u32 = 80;
const MAX_FRAMESKIP: u32 = 5;
fn main() { fn main() {
// track the delta time (the duration of the previous loop in milliseconds) // track the delta time (the duration of the previous loop in milliseconds)