Skip to main content
2 of 2
deleted 170 characters in body; edited title
House
  • 73.5k
  • 17
  • 188
  • 276

How to check for cube collisions?

I want a method, which takes two "ObjectBox" objects (A "ObjectBox" has .getX() .getY() .getZ() .getSizeX() .getSizeY() .getSizeZ() methods) as a parameter and return true if the two Boxes are colliding and false if they aren't.

So it should be something like this:

public static boolean checkCollision(ObjectBox box1, ObjectBox box2){
return //TRUE IF COLLIDING - FALSE IF NOT COLLIDING
}

I tried figuring it out but it seemed pretty hard to me.

Sierox
  • 265
  • 2
  • 3
  • 8