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

Using the cutting tool

Topics: Developer Forum, User Forum
Jun 13, 2011 at 5:54 PM
Edited Jun 13, 2011 at 5: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;


//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);


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