btBvhTriangleMeshShape and gContactAddedCallback

KAJed
Posts: 1
Joined: Thu Oct 02, 2008 1:46 pm

btBvhTriangleMeshShape and gContactAddedCallback

Post by KAJed »

I'm having some issues when dealing with static meshes and custom collision callback.

Basically I need to know what object I'm colliding with in order to decide what I'm going to do. Now, I realize that using HullShape will work for this, but the system I'm working with is just too slow to handle more than 1 or 2 dynamic meshes like that. The problem of course is that when the custom collision callback is called, it's actually called on the TriangleShapes that are part of the Static mesh. The problem then is that there is no indication as to who these triangles belong to. Is there anything that I'm not seeing that is already in place to do what I need? Or do I have to find some hacky way to set a world state that says what object is currently being checked for collision?
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: btBvhTriangleMeshShape and gContactAddedCallback

Post by AlexSilverman »

There is indeed a way to get the parent object. There's a getRootCollisionShape() in the btCollisionShape object that will return what you're looking for. Details are in the following post.

http://bulletphysics.com/Bullet/phpBB3/ ... 9236#p9236

- Alex