Custom raytest callback not giving proper results

Post Reply
Yess
Posts: 2
Joined: Mon Jun 22, 2020 12:41 pm

Custom raytest callback not giving proper results

Post by Yess »

Hello,

In my code im using a bullet physics system, and have stumbled upon a problem and currently i came to dead end with its investigation. I have rigid bodies and raytests with custom broadphase and raytest callbacks to provide collision filtering with outside code (lets say, for simplicity those are int groups and masks). Now, broadphase checks and raytests work nicely with an exception of a single case:

I have a custom convex shape - a heightfield with non-uniform vertex distribution. When i perform raytests, however, the hits are not registered. I have overridden needsCollision() function in raytest callback, and it correctly returns true, saying, pretty much, that the triangles should be checked for hits. However, when i put breakpoint it my shape's processAllTriangles() function, it is not triggered at all.

So my question is - what am i missing? Or what dont I understand? I thought that if needsCollision is true, it means that raytest should go into narrow phase and ask for triangles to check them against ray. What else could be disabling the raytest checking?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Custom raytest callback not giving proper results

Post by drleviathan »

When I look at btCollisionWorld::rayTestSingleInternal() I see: for many shapes it goes into triangleMesh->performRaycast() rather than concaveShape->processAllTriangles(). Maybe set your breakpoint there?
Yess
Posts: 2
Joined: Mon Jun 22, 2020 12:41 pm

Re: Custom raytest callback not giving proper results

Post by Yess »

Alright, i've had bullet version updated recently. So i guess that could have been changed, since I remember the processAllTriangles() triggering during raytests before. Thanks! Thats really helpful!
Post Reply