openfl / box2d

Haxe port of Box2D, a popular rigid-body 2D physics engine
Other
95 stars 28 forks source link

Mass / density changes, doesn't change the way gravity interacts with a body #14

Closed fritzvd closed 5 years ago

fritzvd commented 8 years ago

I tried several ways of changing the mass of an object.

fixtureddef.density body.setMassData

I'd like to have a custom mass. Alas, to no avail. Am I missing something, or is it not working correctly?

JoeCreates commented 5 years ago

I see this is 2 years old so not sure if it's still relevant, but I changed mass with setMassData and it behaved as expected (i.e. impulse applied caused slower acceleration).

Gravity shouldn't be affected by mass as it accelerates everything at the same rate regardless of mass.

jgranick commented 5 years ago

@JoeCreates Thanks for the feedback, here :smile:

Let me know if you guys think we have a bug in the port, or there are ways we can improve it :smile: