Cylinder caps
A finite cylinder with caps can be constructed as the intersection of an infinite cylinder with a slab between two parallel planes, which are perpendicular to the axis.
To intersect a ray with a cylinder with caps:
- intersect with the infinite cylidner;
- check if the intersection is between the planes;
- intersect with each plane;
- determine if the intersections are inside caps;
- out of all intersections choose the on with minimal t
-