Line-line intersection based collision detection