Attempted fix of deltatime bug

Former-commit-id: d287bbf541dd318a7034f1e3ad4d9a167ac3c344
This commit is contained in:
Joshua Barretto
2019-05-17 23:42:44 +01:00
parent 5b2da36fd0
commit b48b9f0141

View File

@ -36,16 +36,16 @@ impl<'a> System<'a> for Sys {
} }
// Basic collision with terrain // Basic collision with terrain
let mut i = 0; let mut i = 0.0;
while terrain while terrain
.get(pos.0.map(|e| e.floor() as i32)) .get(pos.0.map(|e| e.floor() as i32))
.map(|vox| !vox.is_empty()) .map(|vox| !vox.is_empty())
.unwrap_or(false) .unwrap_or(false)
&& i < 100 && i < 6000.0 * dt.0
{ {
pos.0.z += 0.0025; pos.0.z += 0.0025;
vel.0.z = 0.0; vel.0.z = 0.0;
i += 1; i += 1.0;
} }
} }
} }