Skip to content

Posts tagged ‘timestep’

Simple Dynamics framework: verlet

January 6, 2009

Charles

The basic verlet algorithm im using is,

x_{1+1} = x_{1} +(x_{1} - x_{1-1}) + a dt^2

where x is the current and previous position a the accumulated forces, and dt, the timestep or period over frequency. This is great if the simulation is un-fluctuating i.e baked; if it was realtime i’d introduce the TCV (time corrected verlet) version,

x_{1+1} = x_{1} + (x_{1} - x_{1-1}) (frac{dt_{1}}{dt_{1-1}}) + a dt_{1}^2

The nice thing about verlet is that velocity is calculated from the current and old positions, and because of this you can keep throwing collsion and constraint methods at it. It handles the rest. My current approach is to fire the integrator ( verlet) then collisions and constraints – the latter two iterated several times.