Fracturing btConvexHullShape problem

Bird
Posts: 2
Joined: Mon Apr 18, 2011 12:40 am

Fracturing btConvexHullShape problem

Post by Bird »

Howdy,

I'm trying to use the new fracturing abilities found in the FractureDemo in 2.78 I can get primitive shapes like btBoxShape to work as expected but when using btConvexHullShape I'm getting a slight separation of the btFractureBody's upon activation.

Here's a brief video that shows the problem http://www.hurleyworks.com/media/flash/ ... leCow.html

Can anyone tell me how to keep this separation from happening?

-Steve
User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Re: Fracturing btConvexHullShape problem

Post by dphil »

I'm really not familiar with the fracturing, but perhaps once separated each part gets its own collision margin which pushes each other out a little bit? If I recall, normally collision shapes have a small buffer zone around them (the collision margin) where collisions occur but technically the objects are not quite overlapping.

Just a guess...I could be wrong.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Fracturing btConvexHullShape problem

Post by Erwin Coumans »

The parts of the cow are concave, so turning them into a convex hull will cause gaps.
You should use proper convex decomposition, so that the pieces fit together snug. Have you tried the convex decomposition demo, as a starting point to decompose your cow into convex pieces?

Also, indeed as dphil mentioned, you need to make sure that the margin is compensated. When using the new convex hull utility you can specify a 'shrink' value for this.

Thanks,
Erwin
Bird
Posts: 2
Joined: Mon Apr 18, 2011 12:40 am

Re: Fracturing btConvexHullShape problem

Post by Bird »

Thank you both for your help. I managed to create a tight pack of pieces using ConvexBuilder and they stay together nicely until impact in my btFractureDynamicsWorld. http://www.hurleyworks.com/media/flash/ ... eCow2.html

But one important thing that's still unclear to me is where do I get the geometry data that ConvexBuilder used to create the the individual hull pieces? I want the user to see original cow mesh in one piece ... is that possible?

Thanks!

-Steve
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Fracturing btConvexHullShape problem

Post by Erwin Coumans »

Bird wrote: But one important thing that's still unclear to me is where do I get the geometry data that ConvexBuilder used to create the the individual hull pieces? I want the user to see original cow mesh in one piece ... is that possible?
Good question. I haven't digged in the ConvexBuilder to see if and where this information is available. You might have to manually try mapping the triangles to the convex pieces, and 'invent' some interior triangles.

If you come up with a solution, please share it here.
Thanks,
Erwin