Bounding Box Collisions

My programming team has finished and turned in (we got extra credit  8)) our Java project that I talked about here once before. However, there is still one problem that we haven’t actually solved yet.



The problem is that when our boat model turns, the bounding box expands - causing incorrect collisions. Ignore the bigger bounding sphere, but note the bounding box highlighted in red. The model isn’t even near the sphere, but the box will trigger the collision.









As a workaround, we attached this box, and used its bounding sphere to trigger collisions. ( It was a Java 101 class so our instructor didn’t mind)







Here is another image I made to illustrate what is happening.







We have done our best throughout the whole development time to use the resources already here to solve our problems, but I figured I would post this one because I am sure other new jME users have similar questions. I am sure the solution is a one line answer, but thats fine with me. Thanks in advance for any advice!

BoundingBox is AABB (Axis-Aligned Bounding Box)  The solution is to use an OBB or Oriented Bounding Box.

Awesome, I figured it would be easy, I just didn't know what to look for. Thanks for the speedy answer.

You could use a capsule also, to me it seems the boat would fit in a capsule better than a oriented box 

Agreed…  Too bad capsule has a lot of unimplemented methods. :frowning:

i would sugguest break down the model into several meshes and assign each mesh a bounding box. and yes of couse the bounding is better to be OBB

why not use per triangle collision checking? as long as you don't have dozens of boats touching hundreds of obstacles, performance should be fine and the collision will be as accurate as possible.

I'll check out the per triangle collision, thanks for the info.

I tried the triangle collision checking as in the thread: http://www.jmonkeyengine.com/jmeforum/index.php?topic=4036.15

but i experienced very slow fps, so that i applied back the bounding box collision, but since i used a quite complicated model e.g. spider, the bounding box will trigger collision even before the actual spider body touch other objects



so, my question is



i would sugguest break down the model into several meshes and assign each mesh a bounding box


how to do this?

in ur 3d editing tool, there should be a seperate function where u can seperate one mesh into 2 or more meshes. thats how u seperate meshes. then if u r using collada or MD5, the bounding box will be assigned automatically to each mesh when u load it. if u r using 3ds, u need to assign bounding volumes urself since the loader doenst seem to assign boundings.



dont use obj coz obj merges all meshes into one mesh if i recall correctly. but if its a spider so i assume theres skeletal animation on it, ur only choice is md5 anyways if u dont have the ncsoft inhouse exporter

ok, i already broke it into several meshes, then i use:



modelNode.setModelBound(new BoundingBox());



to assign each mesh a bounding box including the root node (node that contains all the meshes), but then when i use this in the collision check, how do i make the hasCollision method check only the childs bounding box?

look for names after the collision detection. since u have different meshes now they should all have different names and the u can set the collision to be bounding collision for performance.