Page 1 of 1

btGImpactMeshShape bouncing for first collision?

Posted: Wed Jun 10, 2009 3:08 am
by thloh85
Hello,

I used btGImpactMeshShape to make a couple of mesh, and found out that the first time the meshes touches each other, they bounce with a high force (feels like something exploded between them when they've touched each other). This only happens on the first time they touch each other, after which the collision will be normal.
Any idea why this problem occurs? If more information is needed, please let me know.

Thanks a lot.

Re: btGImpactMeshShape bouncing for first collision?

Posted: Fri Jun 12, 2009 4:55 pm
by projectileman
Hi, I've found what is causing that problem.

For solving this, just uncomment the line 301 at file btGImpactCollisionAlgorithm.h. That enables the GJK algorithm for triangle collision. It was set for using SAT by default, which in some cases has bugs.

Re: btGImpactMeshShape bouncing for first collision?

Posted: Sun Jun 14, 2009 2:36 pm
by thloh85
It helped for the non-bouncing stuffs, but the created shape became extremely unstable(ie. it shakes indefinitely on the ground), any idea?

Re: btGImpactMeshShape bouncing for first collision?

Posted: Sun Jun 14, 2009 3:11 pm
by thloh85
The problem is with the margin of the shape, set it to 0.05, everything works.
Bullet rocks, GImpact rocks as well!!!

Thanks Erwin, projectileman, and the whole bullet team!!!

Re: btGImpactMeshShape bouncing for first collision?

Posted: Mon Jun 22, 2009 3:34 am
by thloh85
Hello projectileman,

I'm wondering when can we use SAT instead of GJK in GImpact? Looking forward to this :)

Thanks

Re: btGImpactMeshShape bouncing for first collision?

Posted: Mon Jul 13, 2009 7:47 pm
by pfortin
Hi,

I also got this problem and the fix indeed worked. I was wondering if the fix is going to be part of the next release ? Also, are there any side effects to this ?

Thank you.
Pierre

Re: btGImpactMeshShape bouncing for first collision?

Posted: Mon Jul 13, 2009 9:57 pm
by Erwin Coumans
I'm happy to enable this setting by default

Code: Select all

#define BULLET_TRIANGLE_COLLISION 1
Any objections, projectileman?
Thanks,
Erwin

Re: btGImpactMeshShape bouncing for first collision?

Posted: Mon Sep 19, 2011 2:01 am
by stephen.austin
This setting actually took me quite some time to debug, I agree that it should be enabled by default. Furthermore, I found that the problem is fixed by placing the btGImpactMeshShape inside a btCompoundShape (I know you aren't supposed to).

Thanks,
Steve