Easy questions about soft bodies

Post Reply
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Easy questions about soft bodies

Post by Flix »

Hello everybody,

I've implemented soft bodies in my own Ogre - Bullet "wrapper", and I just need some basic information to improve the way they can be used. These are mainly clarifications, not feature requests or bugs. I didn't find the answer in the Bullet docs.

MAIN QUESTIONS:
1) Do soft bodies ever go to sleep ? (otherwise I have to implement some strategy to replace them with static or dynamic rigid bodies when they're outside of the camera view).
2) Can the btCollisionObjects that can be retrieved when iterating over the contact manifolds be soft bodies, or they're just all rigid bodies ? (otherwise I can't set up collision events for them).

WEIRD BEHAVIOR:
3) [Weird behavior] When rolling spheres fall on a soft body they keep rolling standing still (without moving). This happens with sphere shapes only and I guess it can be easily reproduced in the Blender game engine too.
4) [Weird behavior] When I "hang" a soft body in the air (setting its top node mass to zero), and then I throw rigid bodies at it, sometimes it keeps moving horizontally with linear velocity and it never stops.
5) When a soft body with clusters falls on the ground, it frequently "slides" away (but maybe this is just a friction problem).

Anyway the soft body implementation is a really good extension to the Bullet library, so I'd like to thank its developers.

P.S. I would like to underline that learning to use the Blender game engine can be an efficient approach to know more about the important concepts of the Bullet soft bodies, and to experiment with their properties "almost" at runtime. I found it very useful myself.
theyesfish
Posts: 10
Joined: Sat Apr 11, 2009 7:12 pm

Re: Easy questions about soft bodies

Post by theyesfish »

1) Running the demos, it looks like the soft bodies never sleep. Do they actually need to be replaced with rigid bodies though or can you get away with just removing them from the world altogether? (but keeping tabs on where they should be to restore them)

4) If 0 mass isn't working out for you you could try this method

softbody->appendAnchor(int node,btRigidBody* rigidbody, bool disableCollisionBetweenLinkedBodies=false);
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Easy questions about soft bodies

Post by Flix »

Thank you for your hints.
1) Running the demos, it looks like the soft bodies never sleep. Do they actually need to be replaced with rigid bodies though or can you get away with just removing them from the world altogether? (but keeping tabs on where they should be to restore them)
Well, yes, when soft bodies are outside the camera view (after some seconds maybe) I could just remove them and readd them to the world later (their transform could probably be modified "outside the simulation" , to mimic their movement, if that is really needed).
The problem of this approach is that other bodies can't collide with them anymore (outside of the camera view). That's why I was thinking about temporary replacing them with (coarse shaped) static bodies if they're constrained to stay still or rigid bodies otherwise to save frame rate.
4) If 0 mass isn't working out for you you could try this method
softbody->appendAnchor(int node,btRigidBody* rigidbody, bool disableCollisionBetweenLinkedBodies=false);
This hint can be very useful. I will try it. I suppose I need to use a static rigid body, or maybe this method can accept a NULL rigid body. I will check it soon. Either way it can be a good way to solve my problem. Thank you.
Post Reply