forked from: elastic collisions

