Got rid of frameskipping because it wasn't working, fixed inaccuracies in delta time, added relative time for interpolation
This commit is contained in:
parent
56448eceed
commit
3315491b0f
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -103,7 +103,7 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "loopcore"
|
name = "hypoloop"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "loopcore"
|
name = "hypoloop"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
36
src/main.rs
36
src/main.rs
@ -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)
|
||||||