An example, including subclassing RigidBody and using Runge-Kutta integration to calculate the updates, is given here