Hi, 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 againt 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!
How to make a soft body "static" (kind of)?
-
- Posts: 5
- Joined: Sun Mar 31, 2013 5:08 pm
Re: How to make a soft body "static" (kind of)?
I finally found a solution. If anybody has a similar request:
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.
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.