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?
Soft Body Plasticity
-
- Posts: 16
- Joined: Wed Nov 25, 2015 3:34 pm
Re: Soft Body Plasticity
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?
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?
-
- Posts: 350
- Joined: Sat Jul 04, 2015 10:33 am
- Location: Bern, Switzerland
Re: Soft Body Plasticity
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.
-
- Posts: 42
- Joined: Sun Aug 07, 2011 5:27 am
Re: Soft Body Plasticity
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.
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.
-
- Posts: 16
- Joined: Wed Nov 25, 2015 3:34 pm
Re: Soft Body Plasticity
Did you ever solve the problem? I ran into too many issues with soft bodies so I just dropped them completely
-
- Posts: 42
- Joined: Sun Aug 07, 2011 5:27 am
Re: Soft Body Plasticity
Hi,
The shape preserving does not work very well with softbodies, I haven't really looked into why its doing this.
Thx
The shape preserving does not work very well with softbodies, I haven't really looked into why its doing this.
Thx
-
- Posts: 42
- Joined: Sun Aug 07, 2011 5:27 am
Re: Soft Body Plasticity[SOLVED]
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
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