xiangaodielian / bullet

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

Unstable GImpact mesh shape collisions #662

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Collisions between GImpact mesh shapes are unstable.
It seems that especially with parallel triangles contact points have incorrect 
normals and cause objects to move sideways instead of away from each other.
More info and test files in this blender bug report:
http://projects.blender.org/tracker/index.php?func=detail&aid=32105&group_id=9&a
tid=306

Tested with Bullet 2.80 on Arch Linux but older versions and other OSs have the 
same problem.

Original issue reported on code.google.com by sergej.r...@googlemail.com on 20 Oct 2012 at 5:44

GoogleCodeExporter commented 9 years ago
Yes, this is a known limitations of gimpact, it simply finds overlapping 
triangles and performs a local penetration check.

We'll have to come up with a better solution.

Alternatively, it would be great to add convex decomposition in Blender, so you 
can use a btCompoundShape with btConvexHull child shapes. HACD can do this.

Do you know someone who wants to help integrating HACD into Blender?

Original comment by erwin.coumans on 7 Dec 2012 at 7:23

GoogleCodeExporter commented 9 years ago
Adding convex decomposition in blender is on my todo list so I'll get around to 
integrating HACD eventually.

Original comment by sergej.r...@googlemail.com on 7 Dec 2012 at 9:26

GoogleCodeExporter commented 9 years ago

I added a converter from gimpact to btCompoundShape.

Could you try that in Blender?
You basically need to update those 3 files from this commit:
https://code.google.com/p/bullet/source/detail?r=2631

Then 
#include "BulletCollision/Gimpact/btCompoundFromGimpact.h

btCompoundShape*    btCreateCompoundFromGimpactShape(const btGImpactMeshShape* 
gimpactMesh, btScalar depth);

Thanks,
Erwin

Original comment by erwin.coumans on 14 Dec 2012 at 11:16

GoogleCodeExporter commented 9 years ago

I committed the fix to Blender trunk, see
http://www.miikahweb.com/en/blender/svn-logs/commit/53019

Original comment by erwin.coumans on 15 Dec 2012 at 1:12

GoogleCodeExporter commented 9 years ago
Seems to work well, have to test if there are cases where gimpact works better.
Might be worth it to have an option to choose between the two.

Original comment by sergej.r...@googlemail.com on 21 Dec 2012 at 2:46

GoogleCodeExporter commented 9 years ago
The performance of the btCompoundShape can be improved a bit. There are also 
other ways to improve collisions between concave triangle meshes, using 
continuous collision detection. Most that is already in Bullet, a few things 
needs to be hooked up.

Another nice feature to add to Blender is .bullet file export and import. 
Export is only 5 lines of code, once you have a bt*DynamicsWorld. That way, you 
can use Blender to create collision and ragdoll/constraint setup and import it 
into a game. It is also useful to report bugs here.

Original comment by erwin.coumans on 21 Dec 2012 at 5:28

GoogleCodeExporter commented 9 years ago
See https://github.com/bulletphysics/bullet3/issues/106

Original comment by erwin.coumans on 30 Mar 2014 at 6:24