[ODE] Re: Dinamic gravity vector

James Arthur teamonkey at gmail.com
Fri Aug 20 11:00:04 MST 2004


If you're always close to the planet then what Pete says will be true,
but if you're thinking of being able to travel a few miles high or
more then you'll have to factor in the fact that gravitational pull
decreases the further you get from a body.

Having said that, if you _are_ just planning on keeping your game
close to the planet's surface then what Pete suggests will counteract
the problem that Gary mentions (because the force of gravity won't get
any weaker the further you go out, so it'll tug you back in).


If that's no good you should be able to do a mangled version of
Runge-Kutta integration, but it might be a bit of a waste of processor
cycles. For each time step: Save the state of the simulation somehow,
step it forward half a time step, work out the force of gravity using
the Euler method, go back to the saved simulation state, apply the
force you just calculated, do one full time step forward.

James


More information about the ODE mailing list