Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Oct 18, 2011 3:25 am 
Offline

Joined: Tue Oct 18, 2011 3:18 am
Posts: 1
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:
   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);


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: RandyGaul and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group