LinearSinkForce doesn't correctly sim gravity.

Hi Issac, in the demo posted above you can find the following method which shows my gravity solution:

# method called by panda 'task'.
def _apply_gravity_well_(self, planets, task, clock=ClockObject()):  
        new_dt = clock.getRealTime()
        dt = new_dt - self._prev_dt
        for planet in planets:
            dist = planet.NP.getDistance(render)
            pos = planet.NP.getPos(render)
            planet.c_vec -= pos / (dist**3) * dt * 1000
            pos += planet.c_vec
            planet.NP.setPos(render, pos)
        self._prev_dt = new_dt
        return task.cont

If you want to see it working just copy and paste the demo into a file and run it (make sure you set the variable ‘G_MODE’ to “well” and not “sink”). This code is just an approximation of gravity and will not produce exact results (small errors creep in over time) so you can’t use it for a completely real simulator though it’s fine for games.