The dCollideRayCylinder() routine (ray.cpp at line 500) handles only a very special kind of contacts with cylinder's flat caps, namely those generated by a ray whose origin lies inside the infinite cylinder (C <= 0) and such that the infinite ray line does not cross the dEpsilon-thick infinite cylinder (k < dEpsilon). Indeed, caps are only considered in the scope of the boolean test "if ( k < dEpsilon && C <= 0 )" (see line 589 of ray.cpp).
As a result, most of the collisions of a ray against cylinder's caps fail.
Could you suggest a patch for this?
This patch fixes the issue. I've tested visually with demo_collision and it works for all cases I saw. I'm not sure about origin-on-edge or end-on-edge cases.
Tested the patch: works well for me.
Applied it and committed revision 1929.