Problem in Sphere Triangle Collision Algorithm

ihar3d
Posts: 25
Joined: Wed Jan 23, 2008 11:28 am

Problem in Sphere Triangle Collision Algorithm

Post by ihar3d »

Hi!

I tried to test collisions between a triangle and sphere and noticed that it does not work properly. When sphere is collided with triangle it starts to twitch near triangle surface. I attached sample demo scene (just modified base demo). Unfortunatelly I can't propose any sollution and this post is just bug report. Should I submit this issue here http://code.google.com/p/bullet/issues/list?

Thanks!
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: Problem in Sphere Triangle Collision Algorithm

Post by Erwin Coumans »

Indee, this is a bug, introduced during some refactoring a while back.

It has been fixed in subversion now. If you want to fix it yourself: please change line 66 of src\BulletCollision\CollisionDispatch\btSphereTriangleCollisionAlgorithm.cpp in

Code: Select all

bool swapResults = m_swapped;
Or disable the btSphereTriangleCollisionAlgorithm, so it uses a working convex-convex fallback, by commenting out line 238 and 232 in btDefaultCollisionConfiguration.cpp, so it will look like:

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 for the report,
Erwin
ihar3d
Posts: 25
Joined: Wed Jan 23, 2008 11:28 am

Re: Problem in Sphere Triangle Collision Algorithm

Post by ihar3d »

Thanks a lot Erwin!!!
peltonen
Posts: 18
Joined: Thu Jan 17, 2008 8:16 pm

Re: Problem in Sphere Triangle Collision Algorithm

Post by peltonen »

Thanks!

I was having this problem, too, but was having a hard time isolating where it was coming from.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Problem in Sphere Triangle Collision Algorithm

Post by Erwin Coumans »

peltonen wrote:Thanks!

I was having this problem, too, but was having a hard time isolating where it was coming from.
In which version? The latest Bullet 2.72 should have this resolved.

Thanks,
Erwin