Realtime rigid body simulation