Trying to understand the soft body contact response

Post Reply
roguecodemonkey
Posts: 6
Joined: Thu Mar 12, 2015 1:11 pm
Location: Dundee, Scotland, UK

Trying to understand the soft body contact response

Post by roguecodemonkey »

Hi All,

I'm trying to understand the calculation used to resolve collisions between rigid and soft bodies. Specifically the following line in the function PSolve_RContacts in btSoftBody.cpp.

const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst );

I understand c.m_c0 is the impulse matrix and the part I've highlighted in blue is the distance the soft body node should move to resolve the collision.
What I don't quite get is the use of vr in the equation. vr is the distance moved by the soft body node relative to the distance moved by the rigid body this time step.

My understanding is that the movement represented by vr has already been applied to node and I'm not sure why it's present in this calculation to calculate the additional impulse needed to resolve the collision.

I'm hoping my understanding is incorrect :-)

Can anyone shed any light on this?
Post Reply