I've been working with Bullet for a while now, and apart from rigid body simulations, I'm interested in using ray casting also.
Right now, I've got basic ray casting using btCollisionWorld and both the rayTest and rayTestSingle methods, and I understand the use of the callback classes. I'm able to get some nice speeds using this.
Now, here's where I'm stuck: I need to figure out whether the hit came from "inside" or "outside" the object - assuming of course, that all objects in this world are closed mesh surfaces (they could be either convex or concave though). Basically, I need this information because I need to calculate a refracted path for the ray, and the launch position could be anywhere in the world.
In my earlier (pre-Bullet) experiments, I used VTK's vtkOBBTree
, which has a nice InsideOrOutside method, which I used to figure out which object the source point is inside, by testing the OBB-trees of each mesh object. I can still use this, because I'm using VTK for visualization in any case, but is there a way to do this purely from Bullet?