Bug in GIMPACT-Bullet integration

Andrey Tuganov
Posts: 10
Joined: Mon Jan 01, 2007 9:04 pm
Location: Munich

Bug in GIMPACT-Bullet integration

Post by Andrey Tuganov »

Hi! I've noticed that the collision algorithm between GIMPACT-mesh and sphere ceases to work if I swap the geometries.

version: Bullet 2.67
function:
void btSphereTriangleCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)

There is a parameter m_swapped there, which works like this:
btCollisionObject* sphereObj = m_swapped? col1 : col0;
btCollisionObject* triObj = m_swapped? col0 : col1;

Probably the transformations and the outputs should be swapped just as well.
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Bug in GIMPACT-Bullet integration

Post by AlexSilverman »

Can you recreate this in a Bullet demo? That will give us a good jumping off point to clear up what's happening.

Thanks

- Alex
Andrey Tuganov
Posts: 10
Joined: Mon Jan 01, 2007 9:04 pm
Location: Munich

Re: Bug in GIMPACT-Bullet integration

Post by Andrey Tuganov »

Sorry, it's an ugly demo, but it works. Use the file attached as the test demo for Gimpact.

There is a variable called bSwap. Changing it will bring different effects: either correct collision or not.
You do not have the required permissions to view the files attached to this post.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Bug in GIMPACT-Bullet integration

Post by Erwin Coumans »

Finally got to look at this issue, thanks a lot for a reproducing case.

This is indeed a bug in the GIMPACT integration, and it is exposed due to assymmetric sphere-triangle collision algorithm.

We will fix it for upcoming Bullet 2.70 release. For now, you can remove/comment out those lines in btDefaultCollisionConfiguration.cpp:

Code: Select all

	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE ) && (proxyType1==TRIANGLE_SHAPE_PROXYTYPE))
	{
		return	m_sphereTriangleCF;
	}

	if ((proxyType0 == TRIANGLE_SHAPE_PROXYTYPE  ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
	{
		return	m_triangleSphereCF;
	}
Thanks a lot for the feedback,
Erwin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Bug in GIMPACT-Bullet integration

Post by Erwin Coumans »

This issue has finally been fixed. Please check upcoming Bullet 2.70 release, or current SVN repo:

http://code.google.com/p/bullet/source/detail?r=1202

Thanks a lot for the reproduction case,
Erwin