Soft Body Plasticity

Post Reply
inzombiak
Posts: 16
Joined: Wed Nov 25, 2015 3:34 pm

Soft Body Plasticity

Post by inzombiak » Mon Jun 27, 2016 4:29 pm

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?

inzombiak
Posts: 16
Joined: Wed Nov 25, 2015 3:34 pm

Re: Soft Body Plasticity

Post by inzombiak » Thu Jun 30, 2016 5:21 pm

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?

benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Soft Body Plasticity

Post by benelot » Mon Jul 11, 2016 7:06 am

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.

Xcoder79
Posts: 42
Joined: Sun Aug 07, 2011 5:27 am

Re: Soft Body Plasticity

Post by Xcoder79 » Tue Jul 12, 2016 1:08 am

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.

inzombiak
Posts: 16
Joined: Wed Nov 25, 2015 3:34 pm

Re: Soft Body Plasticity

Post by inzombiak » Fri Jul 15, 2016 12:59 pm

Did you ever solve the problem? I ran into too many issues with soft bodies so I just dropped them completely

Xcoder79
Posts: 42
Joined: Sun Aug 07, 2011 5:27 am

Re: Soft Body Plasticity

Post by Xcoder79 » Fri Jul 15, 2016 11:16 pm

Hi,


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

Thx

Xcoder79
Posts: 42
Joined: Sun Aug 07, 2011 5:27 am

Re: Soft Body Plasticity[SOLVED]

Post by Xcoder79 » Mon Jul 18, 2016 11:03 pm

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

Post Reply