takahiyn / bullet

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

Glue / Fracture rigid bodies (based on btCompoundShape) #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

"For example, I would like to simulate a group of objects together all 
behaving as though they are part of a bigger rigid body, and then break 
them off into individual rigid bodies depending on the impact they 
feel...(ie if the impact each of them felt was greater than a threshold)."

See http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2586 for 
details and discussion.

Original issue reported on code.google.com by erwin.coumans on 9 Sep 2008 at 7:22

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 15 Dec 2008 at 6:18

GoogleCodeExporter commented 9 years ago
See also discussion here:
http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2976

Original comment by erwin.coumans on 15 Dec 2008 at 10:54

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 3 Jun 2009 at 6:23

GoogleCodeExporter commented 9 years ago
See preliminary BasicDemo for pre-fractured objects here (attached 
BasicDemo.zip)

http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=4175

Original comment by erwin.coumans on 9 Oct 2009 at 11:10

GoogleCodeExporter commented 9 years ago
See http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=17&t=4498

And attached files.

Original comment by erwin.coumans on 24 Dec 2009 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago

We need some way of calculating connectivity, so you don't have floating or 
disconnectd 
compounds. A method that precalculates contact points between all child shapes 
can do 
this automatically.

Original comment by erwin.coumans on 24 Dec 2009 at 5:30

GoogleCodeExporter commented 9 years ago
Some voronoi based fracture links:

Maya (David Greenwood, see attached): http://bit.ly/9MYcS6 and 
http://bit.ly/dggZ28
Houdini: http://bit.ly/dy7wRi
Blender:  http://bit.ly/aOpYIT

Original comment by erwin.coumans on 18 May 2010 at 8:59

Attachments:

GoogleCodeExporter commented 9 years ago
If you use a procedural voronoi fracture then calculating the connectivity is 
trivial since the connectivity is simply the dual of the voronoi diagram, i.e., 
the delaunay triangulation. While this might be quite cool for performing 
runtime fractures one should just keep in mind to allow for artists to create 
prefractured geometry which may, or may not, have been created by a voronoi 
fracture.

The trick would be to somehow automatically calculate neighbours. I have worked 
on a project to do exactly this from within Houdini. We naively constructed a 
'connectivity graph' by performing a 3D deluanay triangulation on the centroids 
of all the "chunks". We would then perform shock / impact propagation along 
those edges and break them when they exceeded certain 'strength' thresholds and 
so forth. 

Maybe this helps a bit?

Original comment by nanoc...@gmail.com on 28 Jul 2010 at 7:39

GoogleCodeExporter commented 9 years ago
I started a discussion thread specifically for this issue: 
http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=4&t=5456

Original comment by nanoc...@gmail.com on 28 Jul 2010 at 3:35

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 26 Aug 2010 at 3:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attached is an updated demo that can glue and fracture. Press 'f' to toggle 
between glue and fracture.

The demo introduces a new class btFractureBody : public btRigidBody that 
maintains  connections between child shapes in the compound, as well as 
individual masses.

In glue mode, when a rigid body collides with a btFractureBody, they will merge 
together.

In fracture mode, if a rigid body collides with a btFractureBody and it exceeds 
some threshold, it will try to break connections. Then it will recompute 
connectivity, and if there are 2 or more parts it will spawn new btFractureBody 
for each, and remove the original.

It needs a bit more work before it can go in the SDK as a demo, but it can 
serve as a starting point.

The demo requires Bullet 2.77 SDK or later.

Original comment by erwin.coumans on 10 Sep 2010 at 12:10

Attachments:

GoogleCodeExporter commented 9 years ago
in your demo is a small bug: when large object is breaking, then speed of all 
small cracked pieces is zero (stopping), even if on previous step compound 
object has a big speed.

Original comment by almatea2...@gmail.com on 30 Oct 2010 at 7:33

GoogleCodeExporter commented 9 years ago
Indeed, the velocity is not copied/transfered after breaking. This should be 
fixed.

I copied the demo in the latest trunk:
http://code.google.com/p/bullet/source/detail?r=2311

Original comment by erwin.coumans on 27 Feb 2011 at 9:47

GoogleCodeExporter commented 9 years ago
"This should be fixed." - sorry my language, but you mean this trouble already 
fixed or will be fixed in future? In lastest svn trouble is exist, velosities 
is zero at moment of break.

Original comment by almatea2...@gmail.com on 9 Mar 2011 at 1:09

GoogleCodeExporter commented 9 years ago
It will be fixed before the next Bullet release.

Thanks,
Erwin

Original comment by erwin.coumans on 9 Mar 2011 at 1:36

GoogleCodeExporter commented 9 years ago
You may use this tweak of btManifoldResult.cpp at line 132:

        if( (*gContactAddedCallback)(m_manifoldPtr->getContactPoint(insertIndex),obj0,newPt.m_partId0,newPt.m_index0,obj1,newPt.m_partId1,newPt.m_index1) )
        {
          m_manifoldPtr->removeContactPoint(insertIndex);
        }

So if your gContactAddedCallback return 0 (in case for example compound body) 
then contact point is remove.

Also it would be WONDERFUL to have evaluate applied impulse at 
gContactAddedCallback stage.

Original comment by almatea2...@gmail.com on 12 Mar 2011 at 1:48

GoogleCodeExporter commented 9 years ago
We could modify the contact callback, but I'm concerned about backwards 
compatibility, so better to keep it for Bullet 3.x. gContactAddedCallback is at 
the collision stage, no constraint solver has run yet.

The FractureDemo is now ready for first release, it keeps the velocity now. A 
better method for initializing the velocity after fracture could be developed 
later.
See http://code.google.com/p/bullet/source/detail?r=2349

It will be part of Bullet 2.78 release, soon now.

Original comment by erwin.coumans on 18 Mar 2011 at 12:23

GoogleCodeExporter commented 9 years ago
It will be possible to blend a softbody dynamic and this solution (you use a 
new separate btFracture solver)?

Original comment by almatea2...@gmail.com on 20 Mar 2011 at 4:45

GoogleCodeExporter commented 9 years ago
Also you do recompute connections for each new compound - it take long time for 
large simulation. I do just erase unused connections of unbreaked compound 
(check that children of each connection is part of this compound) - so 
connection reducing for breaked compound.

Original comment by almatea2...@gmail.com on 20 Mar 2011 at 5:02

GoogleCodeExporter commented 9 years ago
The current demo is a basic starting point. It hasn't been optimized yet. 
Extending it with softbody is possible.

If you have improvements, can you share it?
Thanks!

Original comment by erwin.coumans on 20 Mar 2011 at 6:12

GoogleCodeExporter commented 9 years ago
I can not share whole code, it is property of my company but I think I can some 
places of my code

Original comment by almatea2...@gmail.com on 24 Mar 2011 at 10:44