Raycast on Compound Shape in 2.82

Post Reply
romulox_x
Posts: 2
Joined: Fri Oct 05, 2007 8:19 pm

Raycast on Compound Shape in 2.82

Post by romulox_x »

I've seen this topic before, but my code isn't producing the result that those discussions indicate. I've got a compound shape with several children, each of which is a btBvhTriangleMeshShape. I've implemented addSingleResult within my own class inherited from AllHitsRayResultCallback. Everything I've read indicates that the child index should be in m_localShapeInfo->m_triangleIndex in the LocalRayResult parameter of addSingleResult, but I'm getting numbers much too large (they seem to make sense as actual triangle indices, but I haven't verified this).

I've dug around in the source code a bit, and it seems that the shapeInfo parameter in reportHit on line 366 of btCollisionWorld.cpp is passed in, creating a non-NULL pointer that fails the check in addSingleResult on line 486, meaning that the shapeInfo constructed in that function is never passed to my callback. When I change 486 to always use the locally constructed shapeInfo, I find that this shapeInfo contains the data I want and my callback functions perfectly.

Might I be doing something wrong, or is this a bug?
Post Reply