mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
bring back pre-0.30 player controls
This commit is contained in:
parent
0ddd8cff4f
commit
1d2c8cf4b6
4 changed files with 18 additions and 23 deletions
|
|
@ -396,10 +396,11 @@ void PhysicsSolver::step(
|
|||
}
|
||||
|
||||
for (auto hitbox : hitboxes) {
|
||||
float linearDamping = hitbox->linearDamping * hitbox->friction;
|
||||
float linearDamping = hitbox->linearDamping;
|
||||
|
||||
glm::vec3& vel = hitbox->velocity;
|
||||
auto diff = hitbox->groundVelocity / dt - vel;
|
||||
hitbox->actualGroundVelocity = hitbox->groundVelocity / dt;
|
||||
auto diff = hitbox->actualGroundVelocity - vel;
|
||||
vel.x += diff.x * delta * linearDamping;
|
||||
vel.z += diff.z * delta * linearDamping;
|
||||
|
||||
|
|
@ -411,9 +412,6 @@ void PhysicsSolver::step(
|
|||
}
|
||||
|
||||
updateSensors(*hitbox);
|
||||
hitbox->friction = glm::abs(hitbox->gravityScale <= 1e-7f)
|
||||
? 8.0f
|
||||
: (!hitbox->prevGrounded ? 2.0f : 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue