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?
I have tried creating a fixture with a box shape with a certain mass using
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;
}
However, the mass of the body when i call getmass() is not correct.