Line collision for rectangular hitboxes.