i create a btCapsuleShape and then i use addCollisionObject add it to world.
then, i create a cloth,
i find the capsule drill throuth when the cloth collision with the capsule.
if i use psb->m_cfg.collisions += btSoftBody::fCollision::CL_RS
i found the cloth will not collision with the capsule.
any one know how to do?
thanks!
why RigidBody could drill through the Cloth ï¼
-
- Posts: 12
- Joined: Thu Oct 26, 2006 8:36 am
-
- Posts: 12
- Joined: Thu Oct 26, 2006 8:36 am
Re: why RigidBody could drill through the Cloth ?
i found the problem,
i set the Positions solver iterations=1,
the largeer the Positions solver iterations is, the drill through is less unconspicuous.
but if i want to slove this problem, i must set the Positions solver iterations to a large number.
i set the Positions solver iterations=1,
the largeer the Positions solver iterations is, the drill through is less unconspicuous.
but if i want to slove this problem, i must set the Positions solver iterations to a large number.
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: why RigidBody could drill through the Cloth ?
Funny enough, I've just had this same problem recently, and fixed it in the same way (in my case: sb->m_cfg.piterations=12).
I've also added this code:
sb->getCollisionShape()->setMargin(0.35);// default is 0.25
but I don't know if it works, because I've seen that internally in the btSoftBody ctr the topology is created with a margin of 0.25: so I don't know if this "late" change behaves correctly.
Maybe adding more nodes to the mesh can improve stability too (just because this way it's more unlikely that parts of rigid bodies come out), or using clusters (but in my case I used an empty cylinder made of cloth (like a tunnel) and if I enable clusters the program crashes).
I've also added this code:
sb->getCollisionShape()->setMargin(0.35);// default is 0.25
but I don't know if it works, because I've seen that internally in the btSoftBody ctr the topology is created with a margin of 0.25: so I don't know if this "late" change behaves correctly.
Maybe adding more nodes to the mesh can improve stability too (just because this way it's more unlikely that parts of rigid bodies come out), or using clusters (but in my case I used an empty cylinder made of cloth (like a tunnel) and if I enable clusters the program crashes).