Least Distance Calculation Between Compound Shapes

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
hintse
Posts: 1
Joined: Tue Oct 18, 2011 3:18 am

Least Distance Calculation Between Compound Shapes

Post by hintse »

Hi all,

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!

Code: Select all

	btDefaultCollisionConfiguration collisionConfiguration;
	btCollisionDispatcher dispatcher(&collisionConfiguration);
	btDbvtBroadphase pairCache;
	btCollisionWorld world(&dispatcher, &pairCache, &collisionConfiguration);
	world.getDispatchInfo().m_convexMaxDistanceUseCPT = true;
 	MyContactResultCallback result;
 	result.drawMinDistance = drawMinDistance;
	btCollisionObject obA;
	obA.setCollisionShape(bds[nodeID0]->shape);
	obA.setWorldTransform(*(bds[nodeID0]->transShapeAbsolute));
	btCollisionObject obB;
	obB.setCollisionShape(bds[nodeID1]->shape);
	obB.setWorldTransform(*(bds[nodeID1]->transShapeAbsolute));
	result.collisionWorld = collisionWorld;
	cout<<"calculating minimum distance"<<endl;
	world.contactPairTest(&obA, &obB, result);
Post Reply