Problem with object independent mass values

Topics: Developer Forum
Mar 10, 2011 at 7:05 AM

Hi everyone,

 I am very new to the Farseer Physics Engine, so hopefully this is not a silly question. I created two PhysicsObject and I want to let them fall down the screen at different speeds. The way this should work, as far as I understand is that I just give both of those objects a different mass, and the engine will do all the difficult parts.

For some reason I always get the same result that both objects fall down the screen with the same speed. I was wondering if the density has to be converted to Sim units as well, but that didn't change anything. Any idea what I am doing wrong? My world is defined as world = new Vector(0,20f); and here are the objects:

o1 =

new PhysicsObject(world, new Vector2 (500, 0), 60, 100, 1000f, blackTex);

o2 = new PhysicsObject(world, new Vector2 (600, 0), 60, 100, 0.01f, blueText);

 The PhysicsObjects looks like this:


public PhysicsObject(World world, Vector2 position, float width, float height, float mass, Texture2D texture)
  this.texture = texture;
  this.origin = new Vector2(texture.Width / 2, texture.Height / 2);
  this.width = width;
  this.height = height;

  SetUpPhysics(world, position, width, height, mass);


protected virtual void SetUpPhysics(World world, Vector2 position, float width, float height, float mass)
  fixture =
FixtureFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(width), ConvertUnits.ToSimUnits(height), ConvertUnits.ToSimUnits(mass), ConvertUnits.ToSimUnits(position)); BodyType.Dynamic;
  fixture.Restitution = 0.3f;
  fixture.Friction = 0.5f;

public virtual void Draw(SpriteBatch spriteBatch)
  spriteBatch.Draw(texture, new Rectangle((int)ConvertUnits.ToDisplayUnits(body.Position.X), (int)ConvertUnits.ToDisplayUnits(body.Position.Y), (int)width + 1, (int)height + 1), null, Color.White, body.Rotation, origin, SpriteEffects.None, 0f);



Your help is much appreciated!

  body = fixture.Body;
  fixture.Body.BodyType =

Mar 11, 2011 at 4:00 AM


This post discusses this problem as well and the solution seems to be to change the LinearDamping value.

Captain Tom

Mar 11, 2011 at 6:12 AM

As you said, is the linear damping what you have to set. Take into account that objects will always fall at the same speed no matter their mass is.

Mar 12, 2011 at 4:30 AM

Yes, thanks. My initial thinking was just flawed!