Different masses/densities or simulating air resistance?

Hi there!

First off, loads of kudos to skatehead for the AS3 port of Box2D. Yay! \o/

Now, I'm quite fluent in AS3 and I've been dabbling around with box2d a bit and it works wonders. 🙂 However, in my current project I need for my objects to have different weights. For instance a really light balloon and a really heavy stone.

If I remember correctly, in a space with no air all objects fall at the same speed. And this is what box2d seems to do as well, with densities only controlling the collision response.

What I would like to have is the balloon object accelerating a lot slower than the heavy stone. How can I achieve this? I tried using ApplyImpulse on the balloon with a small negative impulse, and it kind of worked but the balloon started to spin as well. Also, it seems like a rather clumsy way to do it.

So, in short: How do I get bodies to react to gravity relative to their density (and, or) mass?

Thank you in advance,
johan
I don't think there's built-in support in Box2D for this kind of feature, so basically the way you're doing it sounds about right. The balloon shouldn't be spinning though if you are applying the impulse at its' center of gravity. How are you getting the point to apply the impulse at? I'm also not sure if ApplyImpulse or ApplyForce would work better in this situation.
Using a lower density (somewhere between 0 and 1) might work. I think this will also make your "balloons" respond to collisions weird though.
Thanks for the heads up.

I'm putting the negative force on the balloon like this:
Code:
balloon.ApplyImpulse(new b2Vec2(0, -1000), new b2Vec2(0, 0));

The ballon is a circle so I guess this means I'm pushing it from the middle? Or am I doing something wrong here?
I think the second parameter needs to be in world coordinates, so you'd need something like:

Code:
balloon.ApplyImpulse(new b2Vec2(0, -1000), balloon.GetCenterPosition());
Wohoo! That seems to do trick. Thanks a bunch for the help guys!

Original thread: https://box2d.org/forum/viewtopic.php?t=521