This project has moved and is read-only. For the latest updates, please go here.

Mass in Farseer 3.0

Aug 13, 2010 at 2:18 AM

Why I couldn't set the mass property on body anymore? 

I found out that my object's mass is huge, I need to lower it down but when I do this:

box.Mass = 5;

I got an error says that the Mass property is read-only.

So how should I set my own mass?

Aug 13, 2010 at 6:45 PM

If im correct the mass is being calculated automatically.You can also adjust the mass using the function SetMassData of the body. Best way to adjust the mass is through the fixture creation, you can give the density of the fixture with it. Give a higher number to up the mass of the body.


Sorry if im not really correct here, been using it only for a week now so :P. 

Aug 13, 2010 at 10:51 PM
That is correct. You can use SetMassData() on the Body object to change the mass. I do have plans of making Mass, Center and Inertia RW properties on Body. Actually, I will have a look at it now that it is relevant.
Aug 13, 2010 at 11:41 PM
Changeset 75499 have read/write properties. Mass, Inertia and LocalCenter are all read/write. But beware, if you set mass manually, it will override the mass calculated from the density of shapes. Call ResetMassData() on the body to recalculate the mass from the densities of the shapes attached.
Aug 16, 2010 at 2:10 AM

Thank You :D