diff --git a/src/main/java/cactusServer/models/CollisionManager.java b/src/main/java/cactusServer/models/CollisionManager.java index 2bad65d..790b036 100644 --- a/src/main/java/cactusServer/models/CollisionManager.java +++ b/src/main/java/cactusServer/models/CollisionManager.java @@ -67,7 +67,15 @@ Vector3d vec1 = object1.getVelocity().getVector3d(); Vector3d vec2 = object2.getVelocity().getVector3d(); if (vec1.length() > vec2.length()) { - + result.normal.scale(-1); + Vector3d vec = object1.getPosition().getVector3d(); + vec.add(result.normal); + object1.setPosition(new Position3D(vec)); + }else { + result.normal.scale(-1); + Vector3d vec = object2.getPosition().getVector3d(); + vec.add(result.normal); + object2.setPosition(new Position3D(vec)); } } }