Fixed block snapping ground clip

This commit is contained in:
Joshua Barretto 2019-10-08 11:38:48 +01:00
parent 9bc2a99557
commit 2171e77fe5

View File

@ -302,6 +302,13 @@ impl<'a> System<'a> for Sys {
) && vel.0.z < 0.0 ) && vel.0.z < 0.0
&& vel.0.z > -1.5 && vel.0.z > -1.5
&& was_on_ground && was_on_ground
&& !terrain
.get(
Vec3::new(pos.0.x, pos.0.y, (pos.0.z - 0.05).floor())
.map(|e| e.floor() as i32),
)
.map(|vox| vox.is_solid())
.unwrap_or(false)
{ {
pos.0.z = (pos.0.z - 0.05).floor(); pos.0.z = (pos.0.z - 0.05).floor();
physics_state.on_ground = true; physics_state.on_ground = true;