Softbody-softbody collision - penetration handling

Naruto
Posts: 13
Joined: Sun Mar 13, 2011 2:11 am

Softbody-softbody collision - penetration handling

Post by Naruto »

Hi,

I have seen that in case of softdoby (bunny) softbody (mesh cube) collision there is complete penetration. That is bunny penetrates through mesh cube.
I set piterations upto 100 but then total environment became unstable due to this and still penetration is seen.
Can anybody tell me how to handle such situation?
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Softbody-softbody collision - penetration handling

Post by dphil »

Hm, I am aware of issues with rigid bodies passing right through soft body faces, but not the other way around. The former is due to the particular collision algorithm chosen (the default one, to be specific). You could try modifying the algorithm(s) used via the collisions flag in btSoftBody::m_cfg. Note that some of the flags require the use of clusters (softBody->generateClusters(...)), which can give more robust collision detection by breaking the soft body down into convex hulls. You could also make sure the m_cfg.kCHR value is set to 1 (though this is the default anyway, I believe). This maximizes the attempt to correct penetration of a soft body into a rigid (kinematic) body.

Does it look like it "catches" a bit on the cube before penetrating? Or does it seem to pass right through like there's no collision detection at all?
Naruto
Posts: 13
Joined: Sun Mar 13, 2011 2:11 am

Re: Softbody-softbody collision - penetration handling

Post by Naruto »

Hi,

sorry for late reply.
There isn't any collision detection.
Also I tried setting m_cfg.kCHR = 1 but there isn't any change.
I will let you know if changing algorithm helps.
Thanks for the reply.
Naruto
Posts: 13
Joined: Sun Mar 13, 2011 2:11 am

Re: Softbody-softbody collision - penetration handling

Post by Naruto »

Hi,

I tried with other algorithms like

psb->generateClusters(16);

psb->getCollisionShape()->setMargin(0.01);
psb->m_cfg.collisions = btSoftBody::fCollision::CL_SS+ btSoftBody::fCollision::CL_RS
+ btSoftBody::fCollision::CL_SELF+ btSoftBody::fCollision::VF_SS + btSoftBody::fCollision::RVSmask
;

but still getting same result......
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Softbody-softbody collision - penetration handling

Post by dphil »

Are you using the soft/rigid collision configuration when you create your world?

Code: Select all

config = new btSoftBodyRigidBodyCollisionConfiguration();

dynamicsWorld = new btSoftRigidDynamicsWorld(dispatcher, broadphase, solver, config);
Naruto
Posts: 13
Joined: Sun Mar 13, 2011 2:11 am

Re: Softbody-softbody collision - penetration handling

Post by Naruto »

I am using

btDefaultCollisionConfiguration* m_collisionConfiguration;

sorry I am using SoftBodyRegidBodyCollision...
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Softbody-softbody collision - penetration handling

Post by dphil »

Well, the only other thing I can suggest is to make absolutely sure that what you are seeing (the graphics) matches the physics. Maybe your physics and graphics soft body are out of sync, so that you see it one place, while the physics thinks it is somewhere else.
Naruto
Posts: 13
Joined: Sun Mar 13, 2011 2:11 am

Re: Softbody-softbody collision - penetration handling

Post by Naruto »

How can I check that? Is there any function for checking synchro?
Naruto
Posts: 13
Joined: Sun Mar 13, 2011 2:11 am

Re: Softbody-softbody collision - penetration handling

Post by Naruto »

Hey if I attach my program here can you please go through it?
You do not have the required permissions to view the files attached to this post.