You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of the product are you using? On what operating system?
r17, I don't think this has changed since.
Please provide any additional information below.
Would like a `SetDensity` or `SetMassFromDensity` function on either b2Body
or b2Fixture. Setting the mass manually with `SetMassData` is okay, but it
requires us to know how to compute the mass and inertia from only a density
value, which can be confusing.
A case where it would be nice to be able to do this is when a body changes
from one material into another, like in Kirby Super Star, where Kirby
changes into stone, or perhaps when water turns into ice; a user may want
to change its density during run-time.
A code example:
b2BodyDef bd;
b2Body *kirby = world->CreateBody(&bd);
// ... add some fixture data, set density to 0.3 so that kirby is nice and
fluffy
body->SetMassFromDensity(10); // omg, kirby just turned to stone and
suddenly got really heavy so now he can crush his opponents!
Original issue reported on code.google.com by mnbaya...@gmail.com on 22 Sep 2009 at 12:28
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
mnbaya...@gmail.com
on 22 Sep 2009 at 12:28The text was updated successfully, but these errors were encountered: