This project has moved and is read-only. For the latest updates, please go here.

Unexpected behavoir during collision

May 24, 2011 at 5:41 AM

I'm seeing some unexpected behavior during collision between two objects, when the collision results in a single, touching, contact point.

With a single contact point, it turns out the normal might be flipped.  It seems abitrary.

Here's an example, assume positive X is to the right, and positive Y is up:

|       |
|       |
  / \
 /   \

Using these two shapes, the single point of contact is at the tip of the triangle.  The normal for this contact point could be (0, 1) OR (0,-1).  Even when I take in to account that the normal is always relative to Fixture A during the collision event.  Sometime when the Fixture A is the triangle, I get a contact normal of (0, -1) when I would have expected (0, 1).

Is it impossible to accurately determine the contact normal when there is only a single point of contact or is this a bug in Farseer?