Uneven OnCollision and OnSeparation calls?

Topics: Developer Forum, User Forum
Apr 27, 2012 at 4:03 AM

So I've seen a bunch of threads regarding OnCollision and OnSeparation.  Specifically about how to make a sensor that accurately checks if it's colliding with something, but I tried using that method and it didn't work.


The solution I'm using is similar to Quintinon's in this post: http://farseerphysics.codeplex.com/discussions/216690


And I implemented my sensor similar to Zazery in this post: http://farseerphysics.codeplex.com/discussions/273558


However, apparently there are times where FOR SOME REASON, I get a total collision count with my sensor > 0 even though my character's body is FAR FAR away from any floors.  It's like there's a de-sync that happens between the number of OnCollision calls and OnSeparation calls...


Is this expected behavior?  Is this a bug?  Please help clarify for me somebody.. :(

Apr 29, 2012 at 5:19 AM

Guys I seriously am starting to think this is a bug of some sort.  I read this article about Collision Callbacks in Box2D here: http://www.iforce2d.net/b2dtut/collision-callbacks and it says nothing to suggest that an uneven number of onCollision and onSeparation callbacks should happen: they should be even.  Is this correct?

Apr 29, 2012 at 8:35 AM

Sigh... I fixed my issue.  It WAS a bug in Farseer.  A VERY SERIOUS BUG THAT NEEDS TO BE FIXED!  Why hasn't anybody noticed this yet?  Does nobody use this engine?  This bug completely destroys the ability to detect if bodies are colliding with certain types of bodies using Delegates.  I just spent like the last half week trying to figure this out.


I posted my fix here: http://farseerphysics.codeplex.com/workitem/31331