Reordered physics engine code.