Sphere and mesh collision

Jul 24, 2010 at 9:43 PM

Hi all,

Sometimes, I did not get exactly when, collisions with sphere and a mesh does not happen, or happen in a strange way: ie the sphere seems to penetrate the mesh and then stay in place...

Things seems to chnge by decreasing the tolerace, but problem does not disappear. Any Idea ?

Jul 26, 2010 at 10:49 AM

  Thing changes ( seems to work  ) if we uncomment the distanceToPlane <= 0.0f  in SphereMeshCollisionDetector.cs line 66

 

// Determine if the sphere is close enough to the plane of triangle for a collision.  Early out test.
                    if (/*distanceToPlane <= 0.0f || */distanceToPlane >= radiusTotal)
                    {
                        continue;
                   }

 

====>

// Determine if the sphere is close enough to the plane of triangle for a collision.  Early out test.
                    if (distanceToPlane <= 0.0f || distanceToPlane >= radiusTotal)
                    {
                        continue;
                    }

Coordinator
Jul 27, 2010 at 11:05 PM

Thanks for the info.  I'll include the fix in the next release.

Jul 28, 2010 at 6:54 AM

Well,

I really don't know if it is correct, it worked for me, and actually was code written and then commented by you. I don't know if the change is potentially breaking some other stuff.Maybe creating some unit test will help to me bore confident in suche scenarios.