Page 1 of 1

How can I detect collisions between soft and rigid bodies?

Posted: Wed Jan 20, 2010 6:02 am
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.

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

Posted: Fri Jan 22, 2010 7:17 am
by wj98
I found the issue 141 is reported and accepted about this.
Maybe we can have it in the near future.

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

Posted: Fri Mar 26, 2010 12:29 pm
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

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

Posted: Tue Oct 24, 2017 2:04 pm
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
}
}