Soft vs. Rigid Body Collision Detection

Mr.Orange
Posts: 11
Joined: Mon Apr 18, 2011 10:03 am

Soft vs. Rigid Body Collision Detection

Post by Mr.Orange »

Hi there!

I've got a problem with soft vs. rigid body collision detection. My world is set up like this:

A rigid body (represented by a simple cube, zero mass) acts like a sensor with following collision flag:

Code: Select all

sensor->setCollisionFlags(sensor->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
Every body colliding with my sensor shall just pass through, and the sensor shall call its collision callback function. With rigid bodies passing through my sensor it works perfectly fine. The collision is detected and the callback functions are called. The rigid bodies are configured like this:

Code: Select all

rigidBodyBullet->setCollisionFlags(rigidBodyBullet->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
But when I try to do the same thing with soft bodies, the soft body just collides with my sensor (and does NOT pass through), and no collision callback is called. The soft body is set up like this:

Code: Select all

softBody->m_cfg.collisions = btSoftBody::fCollision::CL_RS + btSoftBody::fCollision::CL_SS;
this->softBody->generateClusters(0);
softBody->setCollisionFlags(softBody->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
I've already tried several different combinations of btSoftBody::fCollision::SDF_RS and btSoftBody::fCollision::VF_SS on softBody->m_cfg.collisions, but the only effect was (with btSoftBody::fCollision::SDF_RS), that the soft body passes through the sensor, but still no collision detection.

Anyone done something similar and got an idea what's my mistake here?
Thanks a lot for your help!

Greets,
Mr.Orange