This project has moved. For the latest updates, please go here.

Polygons and Circles: No Collision

Topics: User Forum
Dec 14, 2011 at 1:36 PM


I am currently programming a pool-game using Farseer. The Ball-Physics are all fine as well as Collisions, e.g. the bounce of the borders of the pool-table if I use ractangles. Now i am redefining the 6 borders as Polygons so I can have the balls fall into the holes. The polygons show up in the DebugView but when a ball approaches it passes through and does NOT collide.

This is how I generate them:

_border_polygons = new Body[6];
Vertices v = new Vertices( new Vector2[] { 
        ConvertUnits.ToSimUnits(new Vector2(56f, 70f)), 
        ConvertUnits.ToSimUnits(new Vector2(102f, 104f)), 
        ConvertUnits.ToSimUnits(new Vector2(604f, 104f)), 
        ConvertUnits.ToSimUnits(new Vector2(610f, 85f))
_border_polygons[0] = BodyFactory.CreatePolygon(_world, v, 1f);
_border_polygons[0].BodyType = BodyType.Static;
_border_polygons[0].Friction = friction;
_border_polygons[0].Restitution = restitution;
_border_polygons[0].OnCollision += OnCollision;

// and so on
What am I doing wrong?