Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/366030345012912129
deleted 170 characters in body; edited title
Source Link
House
  • 73.5k
  • 17
  • 188
  • 276

3D Box Collision Detection on Java-OpenGL Method/Library How to check for cube collisions?

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

I basically want a methoda 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'treturn 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).

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).

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.

Source Link
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).