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

Odd Triangle Collision

Topics: Developer Forum
Mar 16, 2008 at 9:59 PM
I am doing some initial integration of the Farseer Engine into one of my XNA game projects. So far, I am simply taking a quad and splitting it into four collideable bodies and geometries. The problem is that the collisions are not responding with the vertices are right on top of one another. They just seem to slip right through.

To see exactly what i'm talking about, you can check the current version to see what i mean. If you move the pieces (picking them up with the right mouse button) so that they slide along the ground, they will interpenetrate when both edges are along the ground and their vertices are incident. You can enable physics debug view with F1. The project as it is now is located here:

Anyone have any idea why this is happening? Any help would be great. Thanks!
Mar 17, 2008 at 11:06 AM
I have problems to run the .exe. It crashes right away.
Mar 17, 2008 at 2:51 PM
Do you have XNA 2.0 Runtime installed? It is an XNA project so it is required to run. If not, you should be able to find the redist online. If you need me to post it, let me know.
Mar 24, 2008 at 7:10 PM
It can't find the Effects\Polygon effect. when it runs - it's not included in the zip file.
Mar 25, 2008 at 12:29 PM
Edited Mar 25, 2008 at 12:32 PM
Farseer's collsion requires polygon objects to have a fairly uniform spread of vertices even along straight edges.

There is a new function in vertices called. Vertices.SubDivideEdges that takes a max edge length. This will add the vertices you need. Call it before creating the polygon.

Here is an old document on Farseer collision that may help.