Using the cutting tool

Topics: Developer Forum, User Forum
Jun 13, 2011 at 6:54 PM
Edited Jun 13, 2011 at 6:55 PM

Hi i'm very new to farseer and was trying to checkout the cutting tool the thing is i cant understand how to make it work.

I add a polygon rectangle to the view like this  

World.Gravity = new Vector2(0, 9.82f);

_border = new Border(World, this, ScreenManager.GraphicsDevice.Viewport);


Vertices box = PolygonTools.CreateRectangle(0.5f, 0.5f);
PolygonShape shape = new PolygonShape(box, 5);
body = BodyFactory.CreateBody(World);
body.BodyType = BodyType.Dynamic;

body.CreateFixture(shape);


//Being the materials from the examples
Sprite = new Sprite(ScreenManager.Assets.TextureFromShape(body.FixtureList[0].Shape,

MaterialType.Dots, Color.Orange, 1f));

then i draw


ScreenManager.SpriteBatch.Begin(0, null, null, null, null, null, Camera.View);


 ScreenManager.SpriteBatch.Draw(Sprite.Texture, ConvertUnits.ToDisplayUnits( body.Position),null,Color.White, body.Rotation, Sprite.Origin, 1f,SpriteEffects.None, 0f);

ScreenManager.SpriteBatch.End();
_border.Draw();

And i cut at a key press

if (input.IsNewKeyPress(Microsoft.Xna.Framework.Input.Keys.A))
 {
CuttingTools.Cut(World, new Vector2(-10,0), new Vector2(100,0), 0.001f);
}

But all this does is freeze my rectangle in place and nothing else .

  Any help would be great sorry if the question's stupid or anything just very very new