How can I detect collisions between soft and rigid bodies?

Post Reply
wj98
Posts: 2
Joined: Wed Jan 20, 2010 3:39 am

How can I detect collisions between soft and rigid bodies?

Post by wj98 »

Hi,

I'm trying to detect collisions between soft and rigid bodies. But found checking contact manifolds in dynamics world's internal tick callback only works for collisions between rigid bodies, I can not get any notice from it when a soft body collided with a rigid body.

So now I have to check the distance from the rigid body to every node in the soft body manually, to see whether it is less than a threshould value. It works but a bit time-consuming, especially when the soft body has lots of nodes.

Is there any other better solutions? How can I get notice of collision between soft and rigid bodies efficiently?

Thanks.
wj98
Posts: 2
Joined: Wed Jan 20, 2010 3:39 am

Re: How can I detect collisions between soft and rigid bodies?

Post by wj98 »

I found the issue 141 is reported and accepted about this.
Maybe we can have it in the near future.
Sven
Posts: 1
Joined: Wed Dec 30, 2009 10:09 am

Re: How can I detect collisions between soft and rigid bodies?

Post by Sven »

Hi,

I take care of two Master students. One is interested to allow cutting
with tetrahedral soft-bodies in bullet. The other is willing to use
bullet and HAPI to allow haptical interaction with deformable objects.

It seems that Issue 141 (soft body contact callbacks and contact
manifolds) is not yet solved. Confirmed by discussion in bullet forum.

The students want to implement this feature. So they are able to use
bullet in their Master Thesis.

I would appreciate if someone could explain me what functions in bullet code
are affected and what needed to be added by this issue. Furthermore I
was wondering if someone has already an idea of how to solve this issue. We
can implement it then.


Greetings,
Sven
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: How can I detect collisions between soft and rigid bodie

Post by pico »

Hi,

you can iterate over the softbody/rigidbody contacts like this (for instance from the Tick callback)

auto &array=btSoftRigidDynamicsWorld->getSoftBodyArray();
for (int j=0,size=array.size();j<size;j++)
{
auto &b=array[j];
for(int i=0,ni=b->m_rcontacts.size();i<ni;++i)
{
const btSoftBody::RContact& c = b->m_rcontacts;
const btSoftBody::sCti& cti = c.m_cti;
//do your stuff here
}
}
Post Reply