FixtureFactory.AttachPolygon error. Other Attach functions work

Jan 29, 2012 at 8:38 PM

Hey,

I'm able to attach edges and circles just fine, but attaching polygons gets some stack error.

 

Try this in SimpleDemo3

private void LoadObstacles()
        {
            Vertices verts=new Vertices(){Vector2.Zero,Vector2.One*5,new Vector2(5,0)};
            for (int i = 0; i < 5; ++i)
            {
                _obstacles[i] = new Body(World);
                FixtureFactory.AttachPolygon(verts, 1, _obstacles[i]);

Jan 30, 2012 at 5:20 PM

Polygons must be defined in Counter-Clockwise order (CCW) and you're doing it the other way round.