SoftBody parameters

ricardo_arango
Posts: 3
Joined: Tue Oct 28, 2008 7:04 pm

SoftBody parameters

Post by ricardo_arango »

Hi,

I am working with softbodies, and I'm trying to understand the different parameters. So far I have succesfully created a softbody from a triMesh. It fall to a ground plane, but when it hits it, it 'deflates', as if it were a punctured ball. So I want to know how I can make it more solid but still rubber like so it bounces?
This is my code, but I don't understand the parameters as there is really no documentation.

Code: Select all

	btSoftBody::Material* pm = mOgreBullet->ptrSoftBody->appendMaterial();
	mOgreBullet->ptrSoftBody->m_materials[0]->m_kLST = 1.0;  // what is this?
	mOgreBullet->ptrSoftBody->m_materials[0]->m_kAST = 1.0;  // what is this?
	mOgreBullet->ptrSoftBody->m_materials[0]->m_kVST = 1.0;  // what is this?

	mOgreBullet->ptrSoftBody->m_cfg.kDF = 0.5; // what is this?

	mOgreBullet->ptrSoftBody->scale(btVector3(0.1,0.1,0.1));

	mOgreBullet->ptrSoftBody->setTotalMass(10,true);

	mOgreBullet->ptrSoftBody->setPose(true,true);   // what is this?
	//mOgreBullet->ptrSoftBody->setPose(false,true);// what is this?

	//mOgreBullet->ptrSoftBody->generateBendingConstraints(1, pm); // what is this?
	mOgreBullet->ptrSoftBody->m_cfg.piterations	=	2;   // what is this?

	mOgreBullet->ptrSoftBody->randomizeConstraints();   // what is this?

	mOgreBullet->getDynamicsWorld()->addSoftBody(mOgreBullet->ptrSoftBody);
Also, is there anywhere a tutorial or some commented code explaining what the different parts of the soft body are, and what we can use them for? Because there are nodes, links, faces, joints, anchors, rigid cotacts, soft contacts, materials, pose, etc, and is not really obvious what they all mean.

Thanks.
mi076
Posts: 144
Joined: Fri Aug 01, 2008 6:36 am
Location: Bonn, Germany

Re: SoftBody parameters

Post by mi076 »

> mOgreBullet->ptrSoftBody->m_materials[0]->m_kLST = 1.0; // what is this?

Hello,
Look into btSoftBody.h.

btScalar m_kLST; // Linear stiffness coefficient [0,1]
btScalar m_kAST; // Area/Angular stiffness coefficient [0,1]
btScalar m_kVST; // Volume stiffness coefficient [0,1]
ricardo_arango
Posts: 3
Joined: Tue Oct 28, 2008 7:04 pm

Re: SoftBody parameters

Post by ricardo_arango »

Hi,

Thanks for the reply.

Actually I meant something more verbose than that. I have read the comments in the code. But I was hoping for something that explained what it meant. The effects of each one of those variables in the simulation. But i have seen that it's a common problem with bullet at the moment, there isn't a lot of documentation. I hope they can do it soon, because it really increases the numbers of users/testers.

Thanks