When I create soft body assemblies in Bullet Physics they will fall under gravity and then float about 0.25 units above a ground plane rigid body, and other rigid bodies all appear to push and interact with them from that same distance (all the rigid bodies correctly interact with each other only when they appear to touch).

Does one of the many soft body parameters cause this?

I can run more experiments to see if this effect is confined to nodes or shared by links/faces/tetras.

The soft body demo is worth another look- perhaps it has the same problem but all objects are so much larger than what I'm working with that it isn't obvious- I was hoping to do 1 unit = 1 meter but then have cm scale objects.

The code is here https://github.com/lucasw/simple_sim_ros/blob/master/bullet_server/src/soft_body.cpp and elsewhere in that same repository.

Update enter image description here The soft body demo does appear to be floating just like my own project, the picture above shows a gap between the bottom of the ellipsoid and the ground.


1 Answer 1


Look at btCollisionShape.h

All shapes have a setMargin() method.

virtual void setMargin(btScalar margin);

Don't set it to zero though, the manual warns against this! The default value is 0.04 by the way.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .