This commit is contained in:
Minecon724 2024-07-04 20:49:24 +02:00
parent d17b004e7e
commit 810240a80d
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -19,10 +19,10 @@ public class Physics {
public void applyPhysics(double delta) { public void applyPhysics(double delta) {
velocity = velocity.sub(0, gravity * delta, 0); velocity = velocity.sub(0, gravity * delta, 0);
VisibleSweepResult result = Collision.willCollideWithGround(5, entity, velocity.mul(delta)); VisibleSweepResult result = Collision.willCollideWithGround(5, entity, velocity);
System.out.println(entity.hasCollision()); System.out.println(result);
if (result != null) { if (entity.isOnGround()) {
System.out.println(result.res); //System.out.println(result.res);
velocity = velocity.mul(0, -bounciness, 0); velocity = velocity.mul(0, -bounciness, 0);
} }