Quote:
Originally Posted by ujax
I have an idea...the formula for gravity between two bodies is (someConstant * mass1 * mass2) / radius^2. Radius being the distance from body1 to body2. Which means that as the radius approaches zero, the gravity becomes infinite. Because I'm not dealing with solid bodies, but points, the radius is able to approach zero.
Now I limit the effects of that by limiting the velocity of the ball; right now it can't exceed 2 pixels per frame. What it really comes down to is tweaking the masses, velocity limits, etc for a "fun" gravity. If you would like to take a look inside the source code and try to find a sweet spot, please do! In the mean time I'll be doing the same.
|
The some constant your referring to is 6.67 times 10^-11
Just in case you add support for this.