I am trying to use Bullet Engine to calculate the least distances between two objects. I do this using contactPairTest. This seems to work with two convex objects at least. However, when I try to find the minimum distance between a convex object and a compound shape, Bullet produces a segmentation fault. I know that Bullet can't compute the positive distance between a convex and a concave shape but seeing that a compound shape is composed of convex shapes, shouldn't finding the least distance between a compound and a convex shape be possible?
Thanks in advance!
btCollisionWorld world(&dispatcher, &pairCache, &collisionConfiguration);
world.getDispatchInfo().m_convexMaxDistanceUseCPT = true;
result.drawMinDistance = drawMinDistance;
result.collisionWorld = collisionWorld;
cout<<"calculating minimum distance"<<endl;
world.contactPairTest(&obA, &obB, result);