btGImpactMeshShape bouncing for first collision?

Post Reply
thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

btGImpactMeshShape bouncing for first collision?

Post by thloh85 » Wed Jun 10, 2009 3:08 am

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.

User avatar
projectileman
Posts: 109
Joined: Thu Dec 14, 2006 4:27 pm
Location: Colombia
Contact:

Re: btGImpactMeshShape bouncing for first collision?

Post by projectileman » Fri Jun 12, 2009 4:55 pm

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.

thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

Re: btGImpactMeshShape bouncing for first collision?

Post by thloh85 » Sun Jun 14, 2009 2:36 pm

It helped for the non-bouncing stuffs, but the created shape became extremely unstable(ie. it shakes indefinitely on the ground), any idea?

thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

Re: btGImpactMeshShape bouncing for first collision?

Post by thloh85 » Sun Jun 14, 2009 3:11 pm

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!!!

thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

Re: btGImpactMeshShape bouncing for first collision?

Post by thloh85 » Mon Jun 22, 2009 3:34 am

Hello projectileman,

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

Thanks

pfortin
Posts: 1
Joined: Fri Jul 10, 2009 1:05 pm

Re: btGImpactMeshShape bouncing for first collision?

Post by pfortin » Mon Jul 13, 2009 7:47 pm

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

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

Re: btGImpactMeshShape bouncing for first collision?

Post by Erwin Coumans » Mon Jul 13, 2009 9:57 pm

I'm happy to enable this setting by default

Code: Select all

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

stephen.austin
Posts: 5
Joined: Fri Sep 16, 2011 11:05 pm

Re: btGImpactMeshShape bouncing for first collision?

Post by stephen.austin » Mon Sep 19, 2011 2:01 am

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

Post Reply