Hello.
I have a question concerning btCollisionWorld's rayTest functionality. As far as I can understand, one can only have a btCollisionObject as a result. In my case, all world objects are actually btRigidBodies with a btCompoundShape containing several btConvexShapes. Is there a way to get the exact btConvexShape, that was hit by a ray?
Thank you!
Casting a ray to RigidBody with compound shape
-
- Posts: 12
- Joined: Wed Aug 24, 2005 8:54 pm
- Location: uk
Re: Casting a ray to RigidBody with compound shape
I need this for my game too...
Looking at the code I see the required info in btCollisionWorld::LocalShapeInfo, and the comment:
///Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart
Damn. Looks like I didn't do my bullet homework well enough
Looking at the code I see the required info in btCollisionWorld::LocalShapeInfo, and the comment:
///Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart
Damn. Looks like I didn't do my bullet homework well enough

-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Casting a ray to RigidBody with compound shape
The index member of LocalShapeInfo will contain the index of the child shape, also for btCompoundShape.
Thanks,
Erwin
Thanks,
Erwin
-
- Posts: 12
- Joined: Wed Aug 24, 2005 8:54 pm
- Location: uk
Re: Casting a ray to RigidBody with compound shape
Ahh, I was looking at m_shapePart for the shape index (always -1) - So the shape index is in m_triangleIndex eh!
Thanks.

Thanks.