   Intersection test between cone and capsule
  Hello everybody,For my physics engine, I'm looking for an algorithm to test for an intersection between a finite cone and a capsule.  I found a thread on these forums about a test between a cone and sphere(thought it is for an infinite cone), but I haven't been able to figure out how to extend that to handle a capsule instead.Does anyone have any suggestions?Thank you,Simon   
  It might be worth taking a look at Bullet to see how they do it.   ;  Hmmmmm..... For an infinite cone, find the closest point on the cone's axis to the capsule's segment. If the distance is less than the radius of the cone around that point, you have an early "true". Otherwise, find the ray from the cone's apex along its surface which is between the cone's axis and the closest point on the capsule's segment. If the distance between that ray and the capsule's segment is less than the capsule radius, you have an intersection.To extend to finite cones, instead of the above test, if the early test is "true" then take segment A to be a segment from the cone's apex through the cone's base which also passes through (possibly with t>1) the closest point on the capsule's segment. Otherwise, take segment A to be the line segment along the cone's surface which is between the cone's axis and the closest point. If the distance between the capsule's segment and segment A is less than the capsule radius, you have an intersection.That's just off the cuff.... any edge cases I haven't considered?   ;  I checked out Bullet and it uses GJK to handle cone/capsule checks, which seems like a bit overkill for such simple shapes.  Sneftel, that sounds like a good plan.  I put your idea together for an infinite cone and it appears to work well.  I haven't tried to limit it to a finite cone yet, which I'm still a little worried about.  If I understand you correctly, I'm not sure if the segment from the apex to the closest point on the base of the cone will work in all cases.  It seems like in some cases the closest point will be a perpendicular from the base of the cone to that closest point, but in other cases it will be a point on the edge of the cone's base.   ;  Unfortunately I've found an edge case that doesn't work for a finite cone.For a cone its apex at 0,0,1 and the center of its base at 0,0,0.  The base lies in the X/Y plane and has a radius of 1.  The segment of the capsule goes from 0,.5,-.5 to 1,0,0(which is actually touching the base of the cone).The closest point on the capsule's segment to the cone's segment is 0,.5,-.5, and the segment through the cone to that point will not identify 1,0,0 as the closest point.   