   Torus/Ball intersection
  Hi,Here is my problem:I'm working on a physical simulation (some sort of billiard) and I'd like to add cylinder object to my simulation. Finding out if the ball intersect an infinite cylinder is really easy but I'd like put at least one end to each cylinder which means I need to handle the collisions on the end of each cylinder. The top part is created by a plane that's also ok but the collisions on the edge are my problem. I was dealing with the same problem when I was trying to handle the edge/ball collisions but I added and infinite cylinder on each edge (It was usually possible). I'd like to do the same thing by adding a torus on the top of the cylinder.But I don't now how to find out if the  ball intersect the torus. So I would appreciate any help.PS: If there is a better way how to deal with this problem please enlight me.   