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

Need help with documentation

Jun 11, 2011 at 12:39 AM
Edited Jun 11, 2011 at 11:57 AM


I am trying make polygon of my characters shape by following Documentation's "Texture to Polygon" sub-chapter, however I am stumbling on this part:



Vertices verts = PolygonTools.CreatePolygon(data, polygonTexture.Width, polygonTexture.Height, true);



Atleast in my version of Farseer there is no overload of CreatePolygon with 4 overloads and if I just try insert something so the statement wouldnt give an error CreatePolygon method returns me List<Vertices> instead of just one Vertices. I know that documentation is a bit outdated but I got no clue how to fix this :)




E: I have been reading this forum about this issue but people here are suggesting that I wouldn't use that in game to detect and make polygons because it isnt accurate. Can you then recommend any other way to do this?

Jun 27, 2011 at 7:12 AM


Vertices verts = PolygonTools.CreatePolygon(data, polygonTexture.WidthOrHeight, true);
where polygonTexture.WidthOrHeight is the greater of the width or height.

Use one of the SimplifyTools on that and you can create a Body with BodyFactory.CreateCompoundPolygon