btGImpactMeshShapes explode

cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

btGImpactMeshShapes explode

Post by cybermax »

Hi,
I have trouble with setting of btGImpactMeshShape, which I use for moving concave objects.
Problem is that sometimes When Two btGImpactMeshShapes collide, they are push away from each other with high force.
I discover, that setting higher collision margin creating more explosion than lower col. margin.

Another question: If I reverse normal(order of vertexes) to inside object, everything is better, but still sometimes it explodes :(
Last edited by cybermax on Tue Dec 04, 2012 11:49 am, edited 2 times in total.
cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

Re: btGImpactMeshShape-btGImpactMeshShape sometimes explode

Post by cybermax »

I still can not find problem and I am more and more crazy :( please help!

In attachment is problem situation. I did few changes in MovingConcaveDemo. I delete bunny and replace him with my simple model. Other change is copying(translate,rotate) my model to chain. If you run it, when Objects start colliding, you can see how unstable it is :(
You do not have the required permissions to view the files attached to this post.
cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

Re: btGImpactMeshShapes explode

Post by cybermax »

nobody knows :(

I think its not a bug, but i still can not find where is problem.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btGImpactMeshShapes explode

Post by Erwin Coumans »

btGImpactMeshShape is not very reliable when you have sharp angles between triangles, for example a cube.

This needs fixing indeed.

In the meanwhile, try bevelling the shape (adding some additional triangles to create 'rounded' corners.
cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

Re: btGImpactMeshShapes explode

Post by cybermax »

thx for reply :)

I add bevel which round all corners, but It has same problem.
Interesting is, that If I set revers normal(to object), its better, but still exploding.
You do not have the required permissions to view the files attached to this post.
RBD
Posts: 141
Joined: Tue Sep 16, 2008 11:31 am

Re: btGImpactMeshShapes explode

Post by RBD »

Use convex decomposition instead, that'll be so much more stable. Try Khaled's HACD or V-HACD automatic convex decomposition: see http://www.bulletphysics.org/Bullet/php ... f=4&t=6619

Also!... for low poly models last month Erwin added a new method to Bullet that creates a btCompoundShape of (convex) tetrahedra from the triangles of a btGimpactMeshShape for improved collisions: btCreateCompoundFromGimpactShape(): see r2631

(of course for the example above, four compound btBoxShapes would work best)
cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

Re: btGImpactMeshShapes explode

Post by cybermax »

thx for reply :)
this is problem in my plugin: http://bulletphysics.org/Bullet/phpBB3/ ... =17&t=8745

Important is, that in first version of plugin(aprox. before year), btGImpactMeshShapes worked stable so I still think that I made some mistake(s) - collision margin, reverse normal, ...

HACD and V-HACD are both approximate so If I use voronoi fracture for eg. breaking box and pieces will be close together, It explodes because of intersection, so I dont want to use this :(

Tetrahedra+btCompoundShape sounds great and If we dont solve this(btGImpactMeshShapes), I will use it!
RBD
Posts: 141
Joined: Tue Sep 16, 2008 11:31 am

Re: btGImpactMeshShapes explode

Post by RBD »

cybermax wrote:HACD and V-HACD are both approximate so If I use voronoi fracture for eg. breaking box and pieces will be close together, It explodes because of intersection, so I dont want to use this :(
Hmmm, Are you sure this is a problem? Did you actually try it? HACD and V-HACD do approximate convex decomposition within (inside) the convex hull space of the source mesh; I don't think I've come across it producing pieces that extrude outside of the original mesh's convex hull space. Because voronoi fracture naturally only ever produces convex hulls shards, so this should not prevent you from using HACD on the shards (if that is what you are saying is a problem)… there should be no intersection (or explosion)? There is also a significant benefit to using it for rigid bodies prior to (or non) voronoi fracture(d), you're going to get much better performance and reliable collisions than GImpact (even if it was working better for you)… the first (V-)HACD step is not fast, but ideal for use in non real-time critical applications like Houdini.
cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

Re: btGImpactMeshShapes explode

Post by cybermax »

when you look at this picture you can see that new convex bodies are outside, for eg. there is no fingers!
http://bulletphysics.org/wordpress/wp-c ... hacd32.jpg

but maybe I am wrong :)
RBD
Posts: 141
Joined: Tue Sep 16, 2008 11:31 am

Re: btGImpactMeshShapes explode

Post by RBD »

To be clear, the convex hull space for that polygirl mesh looks something like this:
Image
As I mentionned, voronoi fracture shard pieces are always convex hulls and HACD's convex decomposition should take place within this convex hull space, not outside. Or perhaps I misunderstood your issue with voronoi fracture and HACD.

No matter, good luck with your project.
cybermax
Posts: 21
Joined: Tue Sep 07, 2010 12:38 am

Re: btGImpactMeshShapes explode

Post by cybermax »

thx,
at this moment, I am releasing beta version: http://forums.odforce.net/index.php?/to ... for-win64/

Finally, I used btGImpactMeshShapes, but its better to have higher resolution and smooth edge like Erwin has written, already.
I will implement(try) some tetrahedra stuff and we will see :)