favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Soft Body links with 0 length will break simulation #469

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure if that would require a patch
but I think it could be safer to have
a check in the link creation for 0 length,
as it just explodes the simulation...

Original issue reported on code.google.com by majestik...@gmail.com on 6 Jan 2011 at 12:34

GoogleCodeExporter commented 9 years ago
What do you think the right solution would be? Probably rather than doing a 
check we should tweak the equations to apply some sort of force to the vertices 
if they end up on top of each other? I would think that it is a valid 
pre-condition to assume that links are non-zero in length, though, any 
correction we make to that would be arbitrary and reporting an error wouldn't 
really be helpful.

Original comment by xrik...@gmail.com on 7 Jan 2011 at 11:44

GoogleCodeExporter commented 9 years ago
We can add an assert, but when the Bullet soft bodies are used within a 3D 
modeler, this doesn't help much. 

We could automatically discard links with length zero at creation link. If 
there is a cheap run-time fix to avoid breaking the simulation with zero-length 
links, that is an option too. If you have a patch, let us know.

Thanks

Original comment by erwin.coumans on 8 Jan 2011 at 1:32

GoogleCodeExporter commented 9 years ago
yeah i stumbled across it when attaching two ropes together and my nodes were
in the exact same location.
As a temp fix I actually move the points by a small offset if they are and it 
solves
my problem, but I'll take a look to see if I can fix it directly in the solver.

Original comment by majestik...@gmail.com on 8 Jan 2011 at 1:44

GoogleCodeExporter commented 9 years ago
just made a patch in the runtime solver that seems to fix it.
Didn't test it to great depth but my test that was crashing instantly
is now running smoothly :)
The problem I fixed was a division by 0 in the link solver, now 
I just skip the adjustment of the points if the link has 0 length.

Original comment by majestik...@gmail.com on 9 Jan 2011 at 7:14

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch, it has been applied in latest trunk:
http://code.google.com/p/bullet/source/detail?r=2275

Original comment by erwin.coumans on 30 Jan 2011 at 9:18