Updated the physics engine and added some helper functionality.