Objects with their own gravity

Hi,

I want to create a physics world with 0 gravity and then have objects in the world have their own gravitational force.
Is there anyway in the current implementation to do this? If not does anyone have any suggestions on how to implement
something like this?
Just apply the more general gravity force equation for each object.

F = -G * M * m / (r*r)

For each physical object (with its own gravity as you describe)
Set its force to zero to start off with
For each object except the one you're currently examining
Add the evaluation of the above equation (multiply their masses, multiply that by big G, divide by the squared distance between them)

Just make sure these are vector quantities. Test it with only two objects to make sure they move towards each other and not apart.
Yeah I was thinking about doing something like that if there was no automated way to do it.
Seems a physics engine might include functions for doing this already. I just wanted to check
if it already existed.
Sorry, I don't know too much about Box2D. From what I've looked at it seems to be more a framework for all the geometry and dynamics and whatnot than the logic for that.
yes acarlston you are correct. I tried the method you suggested recently for local gravity and it works great.
I wrote my own logic to do the gravity and it is working nicely. Thanks.

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