Soft bodies won't collide with Rigid Bodies

Mako_energy02
Posts: 171
Joined: Sun Jan 17, 2010 4:47 am

Soft bodies won't collide with Rigid Bodies

Post by Mako_energy02 »

I've been trying to get soft bodies up and running in my engine, and I've gotten pretty far but I can't seem to get them to collide. I've gone through the soft body demo numerous times, added the necessary soft body world info, and the SoftRigid collision configuration. But still no dice. When initially researching the issue I ran across this thread:

http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=2359

I think I have the same issue as there. In my engine the rigid body (terrain) is created with an empty shape, and the default origin (0,0,0), both of which get modified later. We're still making a proof of concept and hope to optimize later, at which point we'll probably use the bullet file format to store/load the physics shapes we want, but that is a step for later. In the mean time, we don't set the shape and actual location of the rigid body until after it has been created. This is also not really something I can work around readily given the design.

I've tried going through the constructor for both rigid bodies and collision objects to see if there is some step, and the only thing I found that I wasn't doing after updating the start location was calling updateInertiaTensor(), which I added but didn't change anything. My soft bodies just fall right through.

Does anyone have any ideas or solutions to this issue?
Mako_energy02
Posts: 171
Joined: Sun Jan 17, 2010 4:47 am

Re: Soft bodies won't collide with Rigid Bodies

Post by Mako_energy02 »

I've done a little more research on your forums about the issue, and it seems more common then I originally thought.

http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=4653
http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=5315
This post may even be related to the issue:
http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=3019

For the most part my issue is the same as what all these people are having, which in short is that any static rigid body or collision object that has it's initial location set at any point after it's constructor has completed will not be able to collide with soft bodies. This has no impact at all on Dynamic Rigid bodies. They can collide with static bodies and soft bodies alike regardless. It also seems the only way to get an initial location set in the constructor is to use a motionstate, which seems like a waste since it won't get used at all after creation, cause it's terrain, nothing to update. This also restricts usable terrain to just rigid bodies.

I've tried using just a basic CollisionObject for my terrain and it falls right through. The simulation lags once it touches the Collision Object (terrain), but only for about 5-7 seconds and then I can see the soft body after zooming way out that it wasn't deformed at all. I was hoping to use Collision objects for my terrain to try and reduce the overhead for the simulation.

I've gone through the constructor for both Collision Object and Rigid Body to see if anything is set that would explain why I can't update the position after the constructor and I couldn't find anything other then the one thing I mentioned in my previous post, which I have added and didn't change anything. I realize the "intended" way to use rigid bodies works with soft bodies, but this still strikes me as a bug, as you have to use a component that is supposed to be optional.

Once again, any help in the matter would be greatly appreciated.