2
\$\begingroup\$

I'm fairly new to Bullet and started using it a week ago. I mainly played with rigid bodies and everything works as expected but now that I also need to add soft bodies into my simulation, things got a bit complicated.

What I want: I have to create a simple but unrealistic scene: the main object is a deformable ball levitating at the center of the world, it does not rest on anything and only "floats" there. Then, I should be able to throw various rigid bodies towards the ball so that it deforms BUT DOES NOT MOVE.

What I tried: My issue is that I don't know how to make my main soft body float in the center of the scene. I tried setting the mass of each of its node to zero but then it does not deform anymore, obviously. I also changed its total mass and it gives the same result (I'm not sure if it's the same as setting all masses to 0). I also tried to give it the STATIC flag but that doesn't change anything.

What I could try (but seems overcomplicated): A possibility would be to hang the ball to a fixed position with a point-to-point constraint but I'm afraid that it will deform the ball and could create an unwanted swinging motion. Another idea I had is to enclose the ball into an invisible box made of planes that would keep it in the air but that would not react with other bodies (notably the rigid ones that I will throw) but I'm afraid that this solution would be cumbersome to implement and that the faces of the box would be discernible when the ball is pressed against it.

In summary: I need to have a spherical soft body that keep the same center. It I throw something towards it, I should see its surface riple but it should not move "globally". Is there any way to cleanly do that?

Thank you for your help!

(I asked the same question on the Bullet forum but had no answers)

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Doesn't bullet physics have a kind of joint with which you can pin it to the background? Add an angle joint so that it doesn't rotate and you should be golden! \$\endgroup\$
    – Roy T.
    Apr 2, 2013 at 8:47
  • \$\begingroup\$ You're right! See below. \$\endgroup\$ Apr 9, 2013 at 10:53

1 Answer 1

1
\$\begingroup\$

I finally found a solution.

As Roy T. mentionned, Bullet have joints that help achieve the desired result (for soft bodies only, rigid bodies rather use constraints). For examples, you can see the soft body demos bundled with the source code, especially ClusterRobot and ClusterCar.

TO solve my problem, I used a linear joint to pin the deformable sphere and an angular joint that cancels speed in order to stop its rotation.

\$\endgroup\$

You must log in to answer this question.

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