Soft body clusters acting strange

Vir Novus
Posts: 3
Joined: Wed Dec 02, 2009 5:01 pm

Soft body clusters acting strange

Post by Vir Novus »

Soft body collisions don't seem to be working very well at all for me. If I just keep the regular SDF collision handler, all my rigid objects go right through the soft ones, and just get deflected a little bit at most. Unless they're several times the size of the soft body node spacing anyway, then they work somewhat better. The SDF one isn't really adequate though, so I've been trying to implement clusters:

Code: Select all

sb = new btSoftBody(Phys->getSoftBodyWorldInfo(), tetraVerts.size()/4, 
	(btVector3*)(tetraVerts.const_pointer()), tetraMasses.const_pointer());
sb->setFriction( 0.4f );
sb->m_cfg.kDP = 0.1f;
sb->m_cfg.kAHR = 1.f;
sb->m_cfg.kKHR = 1.f;
sb->m_materials[0]->m_kAST = 0.1f;
sb->m_materials[0]->m_kLST = 0.5f;
sb->m_materials[0]->m_kVST = 0.5f;

sb->generateClusters(30);
sb->m_cfg.collisions = btSoftBody::fCollision::CL_RS;
This works much better, at least the collision part. The major problems occur when stuff hits the soft body and imparts some momentum to it. It deforms, but then doesn't spring back. It's like I'm beating it out of shape with a hammer or something. And yeah, I know it says to use += not = in the manual for the last line, but for me that results in no collisions at all. Anyway, thanks in advance, and let me know if I should post any more code.