Initial port from Steer2d.net.