I am currently working on a space simulation/game. Gravity is being calculated correctly and everything, I just have one problem…
As an object approaches the center of another object, the gravitational pull between the two approaches infinity (as it should). Since it is impossible to run a game at infinite fps, it is nearly impossible for two objects to meet at exactly at their centers due to their velocities. In other words, if an object is moving at 700km/s towards an object’s center, and it is only 7km away from its center, it passes the center by the next frame, and the gravitational pull has accelerated the object so much from the previous frame that the object shoots off into space.
I provided a .gif (http://www.2imgs.com/76b6d0fa29) to show you guys what is going on in case I did a poor job of describing it.
(The ship starts out as an orbital satellite, but I halt all of its movement to show you what goes on.)
I can’t think of any way I could possible fix this, does anyone have any ideas?