Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jun 11, 2012 1:35 pm 
Offline

Joined: Mon Nov 02, 2009 11:55 am
Posts: 11
Hi there.
I have a thorny problem.
I have a wall(triangle mesh) and I need to figure out which parts of the wall have been colliding with a cone. Is there a way to retrieve a list of the triangles that are colliding with the Cone?
Is there another way to do this?


Top
 Profile  
 
PostPosted: Fri Oct 19, 2012 3:48 am 
Offline

Joined: Fri Oct 19, 2012 3:37 am
Posts: 2
Hi, I have the same problem. Does Bullet support this or not?
I found in the manual, a callback function

virtual btScalar btCollisionWorld::ContactResultCallback::addSingleResult ( btManifoldPoint & cp,
const btCollisionObject * colObj0,
int partId0,
int index0,
const btCollisionObject * colObj1,
int partId1,
int index1
)

In this function, the index0 and index1 is the index of colliding triangles, or not?


Top
 Profile  
 
PostPosted: Sun Oct 21, 2012 7:03 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Yes you can use a callback to find the actual triangle (and part) index.

The index and partId points to the triangle index and (optional) part of a triangle mesh, in case you are using btBvhTriangleMeshShape.

Note that it is best to use Bullet-2.81, the interface changed slightly:
Code:
static bool ContactAddedCallback(btManifoldPoint& cp,   const btCollisionObjectWrapper* colObj0Wrap,int partId0,int index0,const btCollisionObjectWrapper* colObj1Wrap,int partId1,int index1);


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

All times are UTC


Who is online

Users browsing this forum: Majestic-12 [Bot] and 0 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group