Probably fixed all the jittering, won't need the jitter guard anymore.

This commit is contained in:
William Moberg
2016-03-09 19:45:26 +01:00
parent 8a3564ad49
commit 8936b3d6c3
5 changed files with 7 additions and 18 deletions
+4 -8
View File
@@ -273,14 +273,10 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
size = glm::vec3(1.f, 1.f, 1.f);
} else {
size = glm::vec3(1.f, 1.6f, 1.f);
if (controller->CrouchingLastFrame() && player.HasComponent("Collidable")) {
// Disable jitter guard so player doesn't get stuck in the ground.
(bool&)player["Collidable"]["JitterGuard"] = false;
if (isOnGround) {
// The collision should resolve this anyway, but
// this is more reliable, since the box gets larger.
((glm::vec3&)cTransform["Position"]).y += 0.3f;
}
if (controller->CrouchingLastFrame() && isOnGround) {
// The collision should resolve this anyway, but
// this is more reliable, since the box gets larger.
((glm::vec3&)cTransform["Position"]).y += 0.3f;
}
}
}