title: Box2d: set mass on a figure
body: <p>Currently, mass on a figure is set using the area of the shape and its density. How can i set the mass if I already know it?</p>
  
  <p>I have tried creating a fixture with a box shape with a certain mass using </p>
  
  <pre><code> public FixtureDef  createfixture()
  {
      PolygonShape ps = new PolygonShape();
  
      ps.setAsBox(w*12.5f, h*12.5f, new Vec2(attachx,attachy), (float) Math.toRadians(atrot));
  
      float area = (w*12.5f)*(h*12.5f);
  
      FixtureDef fd = new FixtureDef();
      fd.density=mass/area;
      fd.shape=ps;
  
      return fd;
  }
  </code></pre>
  
  <p>However, the mass of the body when i call getmass() is not correct.</p>