Identifying which mesh from a collision callback

DanForever
Posts: 2
Joined: Mon Jun 15, 2009 3:53 pm

Identifying which mesh from a collision callback

Post by DanForever »

If there are multiple btBvhTriangleMeshShapes in a btCompoundShape, and a simple shape (such as a sphere) collides with one of them, is there currently any way of identifying which mesh was involved in the collision from inside a ContactAddedCallback?

I've been staring at this for a while now, but as far as I can tell you're given a btTriangleShape which has no knowledge of which mesh it was created from.

We're currently using version 2.69, but if it's possible in a later revision, I can look to upgrade if need be.

The closest I could find to a solution are these threads, which seem to imply that it's possible, but don't necessarily explain how:
http://www.bulletphysics.com/Bullet/php ... 23&start=0
http://www.bulletphysics.com/Bullet/php ... 27&p=10073

Thanks in advance
- Dan
DanForever
Posts: 2
Joined: Mon Jun 15, 2009 3:53 pm

Re: Identifying which mesh from a collision callback

Post by DanForever »

Also, according to http://www.bulletphysics.com/Bullet/php ... 27&p=10073, when performing a ray cast, calling rayResult.m_collisionObject->getCollisionShape() from inside RayResultCallback::addSingleResult should return give me the child shape the ray cast was against, but it actually seems to return the btCompoundShape which doesn't give me the information I need.

Am I missing something? Or is this an issue that has been fixed in a later version?