a
This commit is contained in:
parent
d17b004e7e
commit
810240a80d
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue