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

Edge & CollisionCategory not working?

Sep 23, 2010 at 10:55 PM

I created the following:

Fixture fix = FixtureFactory.CreateEdge(Globals.World, start, finish, 1);
fix.CollisionCategories = CollisionCategory.Cat10;        
fix.CollidesWith = CollisionCategory.All & ~CollisionCategory.Cat10;

and then above it I create this:

fixSheepBody = FixtureFactory.CreateRectangle(Globals.World, 3, 1.8f, 1, pos);      
fixSheepBody.Body.BodyType = BodyType.Dynamic;      
fixSheepBody.CollisionCategories = CollisionCategory.Cat10;      
fixSheepBody.CollidesWith = CollisionCategory.All & ~CollisionCategory.Cat10;

But it still collides with the edge? If I create 2 fixSheepBody's they don't collide with each other.

Sep 23, 2010 at 11:23 PM

I cannot replicate your bug. I created a static edge with the same properties as yours. Then I created a dynamic rectangle with the same properties as yours. The rectangle does not collide with the edge. And it still does not collide if I change the edge shape to a polygon (rectangle).

Try debugging your fixtures after everything has been created and you are about to run World.Step().