Obi Official Forum
Bouncy Soft Body - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: Bouncy Soft Body (/thread-2334.html)



Bouncy Soft Body - iliakot - 23-06-2020

Is there a way to make soft body bounce from the floor? Similar to what can be achieved with Physic Material and Colliders in standard Unity's PhysX. Bounciness is missing from Obi Collusion Material. Thanks in advance for any reply or suggestion how it can be implemented.


RE: Bouncy Soft Body - josemendez - 24-06-2020

(23-06-2020, 07:17 PM)iliakot Wrote: Is there a way to make soft body bounce from the floor? Similar to what can be achieved with Physic Material and Colliders in standard Unity's PhysX. Bounciness is missing from Obi Collusion Material. Thanks in advance for any reply or suggestion how it can be implemented.

Hi,

The degree of bounciness of any object depends on its ability to store potential energy upon collision, and release it afterwards. When you drop a rubber ball to the floor, it compresses after touching the floor (storing potential energy), and then releases this energy by bouncing (de-compressing). A metal ball compresses a lot less, so it bounces less as it stores less energy. Though in games we approximate many objects as rigidbodies, in nature there are no pure rigidbodies: all materials can deform under enough stress, so in real life, everything's a softbody.

Obi Softbodies will bounce off the floor depending on how elastic they are, just like in real life. So there's no explicit "bounciness" in the collision material, as it's a kinda hackish way to allow rigidbodies (which can't compress) to bounce. Cloth, ropes, and fluids do not bounce either, so we saw no need for a bounciness parameter.

You can adjust your simulation parameters to make it a bit more "springy" (cranking up the amount of substeps / shape matching iterations is usually a good idea). Let me know you exact use case though, as if we see a real need for a restitution coefficient (actual name for bounciness) we might add it in the future.


RE: Bouncy Soft Body - iliakot - 07-07-2020

Hi!
In this test - https://www.dropbox.com/s/b0vv7uoq20kcdq5/softbody_vs_bounciness.mov?dl=0 - bottle is an Obi Softbody and the bouncy cube is just PhysX Rigidbody + bouncy materials on the floor colliders. So, I like how the softbody wobbles and how the cube bounces, the goal is to combine these two behaviours somehow. Since it's game development probably some sort of faking would also work, but after couple of quick tests it looks like there is no trivial way to do so (will be happy to be wrong here - any suggestions are very welcome).


RE: Bouncy Soft Body - josemendez - 08-07-2020

(07-07-2020, 05:23 PM)iliakot Wrote: Hi!
In this test - https://www.dropbox.com/s/b0vv7uoq20kcdq5/softbody_vs_bounciness.mov?dl=0 - bottle is an Obi Softbody and the bouncy cube is just PhysX Rigidbody + bouncy materials on the floor colliders. So, I like how the softbody wobbles and how the cube bounces, the goal is to combine these two behaviours somehow. Since it's game development probably some sort of faking would also work, but after couple of quick tests it looks like there is no trivial way to do so (will be happy to be wrong here - any suggestions are very welcome).

Hi there!

I see, unfortunately there's not an easy way to add extra bouncing to a softbody. The closest you can get is:

- Subscribe to the solver's OnCollision event.
- Iterate over all contacts in the frame.
- For each "bouncy "contact, and get its normal impulse magnitude/direction and apply an extra percentage of this impulse as a velocity delta to the involved particle.

This is of course a hack: won't work correctly for collisions against rigidbodies (since only the particle is affected by restitution), and does not work properly with collision materials.