Page 1 of 1

Setting custom mass

Posted: Wed Apr 11, 2018 2:28 pm
by vanush
Box2d supports body mass that is not coupled with the density of its fixtures, so that you can set the mass data manually.
In RUBE when I set the mass of a body it changes the density of body's fixtures. Is there a way to set it without affecting fixtures?

Re: Setting custom mass

Posted: Sat Apr 14, 2018 2:44 pm
by iforce2d
No. What you can do is make all the fixtures on the body zero density, and have a single fixture that has the desired mass. Then you can move that single fixture wherever you want to set the center of mass. Of course if you don't want that single fixture to interfere with collision behavior you can make it a sensor fixture or zero out all the collision mask bits.

Re: Setting custom mass

Posted: Sun Apr 15, 2018 7:18 pm
by vanush
Thanks! This should be an acceptable workaround.