Page 1 of 1

Soft Body Plasticity

Posted: Mon Jun 27, 2016 4:29 pm
by inzombiak
Hello,

I'm currently working on a game and I want to make certain surfaces of the game world deformable by the user. I've already implemented soft bodies and mouse picking but I cant get the surfaces to stop returning to their original shape.
I should note that I use joints to keep the soft bodies stationary.

Does anyone know which settings I need to play with to get the desired effect? I'm very new to soft bodies so I don't understand a lot of the terms in the source code.

If bullet does not have the capabilities I need, does anyone know where I can read up on the topic?

Re: Soft Body Plasticity

Posted: Thu Jun 30, 2016 5:21 pm
by inzombiak
I managed to "lock" the mesh by calling setPose. This solves the issue somewhat, but its not a fix since I still can't get my terrain to behave like clay.

As an alternative I wanted to try using a btTriangleMesh instead, but I can figure out how to edit vertex position/how to access them with a raycast. Is this even possible with bullet or do I need to implement it myself?

Re: Soft Body Plasticity

Posted: Mon Jul 11, 2016 7:06 am
by benelot
I am not very knowledgable about softbodies, but you could go to the github repsitory and ask your question under issues. This is not the general way of asking questions, but this might be something only Erwin Coumans and some few others can answer. Apart from that, you could look into the source code. You basically want to get a shape preserving object. If you know how it is done, tell me and I will create an example browser demo for it.

Re: Soft Body Plasticity

Posted: Tue Jul 12, 2016 1:08 am
by Xcoder79
Hi,

I had the same problem awhile ago, trying to simulate plasticity when using setPose, It doesn't really lock the mesh it rather slows it down but it still tries returning the softbody to its original shape
I should of mentioned that this happens on collison with another object and this was using btTriangleMesh.

Re: Soft Body Plasticity

Posted: Fri Jul 15, 2016 12:59 pm
by inzombiak
Did you ever solve the problem? I ran into too many issues with soft bodies so I just dropped them completely

Re: Soft Body Plasticity

Posted: Fri Jul 15, 2016 11:16 pm
by Xcoder79
Hi,


The shape preserving does not work very well with softbodies, I haven't really looked into why its doing this.

Thx

Re: Soft Body Plasticity[SOLVED]

Posted: Mon Jul 18, 2016 11:03 pm
by Xcoder79
Hi,

Below is a short video showing plasticity.

https://www.youtube.com/watch?v=LdFudRri5WY

And the following Modifications to setup the SoftBody.

btSoftBody* psb=btSoftBodyHelpers::CreateEllipsoid(pdemo->m_softBodyWorldInfo,btVector3(0,-6,0),
btVector3(1,1,1)*3,
512);
//psb->m_materials[0]->m_kLST = 0.45;
//psb->m_cfg.kVC = 20;
//psb->setTotalMass(50,true);
psb->setPose(false,true);
pdemo->getSoftDynamicsWorld()->addSoftBody(psb);

Ctor_BigPlate(pdemo);
//Ctor_LinearStair(pdemo,btVector3(0,0,0),btVector3(2,1,5),0,10);

Also, I disabled gravity for this demo.

m_softBodyWorldInfo.m.gravity.setValue(0,0,0);

Hope this helps.

Thx