Say I have one main gravitational body and its applying a gravitational force (in my case, a negative explosive force). I have a rigid body that I want to orbit around the main body so I apply an impulse on startup to the cross vector. This all works fine in my test, but it was all guess work getting it to work and as soon as I change the mass then the orbit is no longer perfect.
So my question is: if I know the mass of the orbiting body, the distance from the main gravity source and the power of the gravity, how would I calculate how much force to impulse on the orbiting body at startup to put it into a perfectly sustained orbit?
I have learned a lot over the last few months by just browsing the net, and even though I have serious doubts about Wikipedia, it proves to be usefull enough. If you can’t find the answer there about stuff like this you’ll probably see some interesting links at the bottom of the page.
Unfortunately you won’t be able to use traditional equations that describe orbits for what you have - Mass doesn’t come in to play when calculating an orbit (at least not at this level of detail). Otherwise an astronaut orbiting the planet couldn’t step outside of the space shuttle without falling to earth or flying out into space (because he has less mass than the shuttle orbiting right next to them).
If you change the centripetal force you are applying to your orbiting object to be a function of it’s distance from the object it’s orbiting you’ll be on the right track. This more realistic approach will mean that objects further from the planet will orbit slower though so… that could cause a problem for your game play.
…And although using a negative explosive force is clever, it will mean that all of your orbiting objects need to have the same mass to orbit at a particular altitude. This isn’t how gravity works so you won’t be able to make a realistic physics simulation using explosive force.