Rewind a physics simulation

Topics: User Forum
Sep 1, 2012 at 5:39 PM

Can a Farseer physics simulation be "backed up" for a given number of updates?

Sep 2, 2012 at 12:14 PM

You can't go back on the simulation. There is no exact solution to that  - i.e. there is an infinite number of solutions. In some special cases like inverse kinematics it could be done but cannot be generalized.

You can, however, use some workarounds depending on your needs (Occam's Razor applies - simplest thing would probably work best). For example:

Keep a ring buffer of previous positions and velocities. If you need to rewind pull the values from the buffer, reset the world to that state and resimulate several steps at once until you get to current.