Mesh as collision detector but not physical object

zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: Mesh as collision detector but not physical object

Post by zarlox »

pwr wrote:I've created a ghostobject and tried that but didn't have any success. This is could be caused by me doing something wrong. So I was trying the other solution described above. I'm thinking that it would be more easier to simply check if an body is inside the water body. Then I don't have to care if the contact points is from the object traveling into the water or out from the water. Is this doable with a GhostObject? Do anyone have any sample code that I can use?
One thing you could do is use the dynamic body AABB (or better, OBB) and see if it intersect with the water volume AABB/OBB. You would have to do that test on your frame update.

As far as i know, this is basically what the broadphase is doing so you might be able to query the broadphase just to know if the volumes intersect.

Using one of these solution will always tell you if a object is inside another one
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: Mesh as collision detector but not physical object

Post by Dr.Shepherd »

zarlox wrote: One thing you could do is use the dynamic body AABB (or better, OBB) and see if it intersect with the water volume AABB/OBB. You would have to do that test on your frame update.
Hi, dude, I would like to know more about this point, could you tell me some more or is it convenient to paste some code here ?

Cheers !
zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: Mesh as collision detector but not physical object

Post by zarlox »

Dr.Shepherd wrote:
zarlox wrote: One thing you could do is use the dynamic body AABB (or better, OBB) and see if it intersect with the water volume AABB/OBB. You would have to do that test on your frame update.
Hi, dude, I would like to know more about this point, could you tell me some more or is it convenient to paste some code here ?

Cheers !
Hi,

Sorry, i do not have code for doing this but operation on AABB and OBB are standard geometry operation. I am just not sure if we can extract the OBB (Oriented Bounding Box) easily for any object or if we can only have AABB (Axis Aligned Bounding Box).

However, on another older thread, Erwin seems to say that the Ghost object overlapping pair list will always tell you when a body is inside another one even when not crossing surfaces.

http://bulletphysics.org/Bullet/phpBB3/ ... air#p14776

And Flix tested it and said it works. It provides the code here:

http://bulletphysics.org/Bullet/phpBB3/ ... air#p14872

I will try to find more information and i'll post back
pwr
Posts: 12
Joined: Sat Sep 24, 2011 4:58 pm

Re: Mesh as collision detector but not physical object

Post by pwr »

Hi again, thank you for a great explanation! I forgott to ask about testing if a body is completely inside another body. I'm now able to find contact points between two ghost objects having convex bodies. The problem is that I would like to know if body A is completely inside body B without the sides of the bodies touching. Is this possible? I can't figure out any way by using the contact information I get from the manifolds.