I'm trying to define a polygon to be updated by a body bounded by a physical world. Here it goes my attempt:
public Body _body;
public Shape _shape;
_primitiveBatch = new PrimitiveBatch(_game.GraphicsDevice);
_shape = new PolygonShape(_vertices, 1);
Vector2 _position = FarseerPolygon.getCenter(((PolygonShape)_shape).Vertices);
_body = new Body(_world);
_body.Position = _position;
_body.CreateFixture(_shape);
_body.BodyType = BodyType.Dynamic;
_body.Restitution = 0.9f;
_body.Friction = 1f;
The body changes its position but not the shape. Body.CreatePolygon also doesn't work. Any help would really be appreciated because I'm stucked in here... Thank you,