Odd Triangle Collision

Topics: Developer Forum
Mar 16, 2008 at 8: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: http://www.andrewthayer.com/files/Curator.zip

Anyone have any idea why this is happening? Any help would be great. Thanks!
Mar 17, 2008 at 10:06 AM
Hi,
I have problems to run the .exe. It crashes right away.
Mar 17, 2008 at 1: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 6:10 PM
It can't find the Effects\Polygon effect. when it runs - it's not included in the zip file.
Coordinator
Mar 25, 2008 at 11:29 AM
Edited Mar 25, 2008 at 11:32 AM
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.

http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=FarseerPhysics&DownloadId=24894