I always get many error messages when I want to create polygons in Farseer.
'FarseerPhysics.Common.Vertices' does not contain a definition for 'CreatePolygon' 'FarseerPhysics.Factories.BodyFactory' does not contain a definition for 'Instance' The name 'physicsSimulator' does not exist in the current context The name 'triangleGeomtry' does not exist in the current context The name 'GeomFactory' does not exist in the current context The name 'physicsSimulator' does not exist in the current context
What is wrong? How can I create polygons in Farseer?
triangleSprite = Content.Load<Texture2D>("triangle"); // Load the Sprite
data = new uint[triangleSprite.Width * triangleSprite.Height];
triangleSprite.GetData(data);
verts = Vertices.CreatePolygon(data, triangleSprite.Width, triangleSprite.Height);
polygonOrigin = verts.GetCentroid();
triangleBody = BodyFactory.Instance.CreatePolygonBody(physicsSimulator, verts, 3);
triangleBody.Position = new Vector2(400, 600);
triangleGeomtry = GeomFactory.Instance.CreatePolygonGeom(physicsSimulator, triangleBody, verts, 0);