Skip to main content
1 of 2
Sierox
  • 265
  • 2
  • 3
  • 8

3D Box Collision Detection on Java-OpenGL Method/Library

I am using Java with OpenGL to make a small 3D game.

I basically 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.

Also, any physics library recommendations are appreciated. (Except jBullet).

Sierox
  • 265
  • 2
  • 3
  • 8