[ODE] Box - Cylinder collision?

Nate W coding at natew.com
Thu Aug 29 10:43:02 2002


On Thu, 29 Aug 2002, Pierre Terdiman wrote:

> > It's probably easier than box-box
> > collision in fact.  (Capped cylinders are easy to intersect with things.
> > In fact, that's the only reason for spherical caps.)
> 
> Wait, are we speaking about cylinders or LSS (a.k.a. capsules) ? I assume
> you're thinking about a capsule when you say "spherical caps". In that case,
> that's very easy indeed.

ODE's cylinder primitive is indeed a capped cylinder - "capsule" is a good
word for it.  At first I thought that was kind of silly (they make lousy
car tires) but I'm beginning to see why that shape was chosen. :-)

How should one approach box-capsule collision?  I've got no experience in
collision detection, but I'm getting interested. It seems to me that most
cases could be handled by testing against the line segments at the edges
of the box.  The other cases would be covered by testing for intersections
between the box face and the end-cap half-spheres.  Would that cover all
cases, or am I overlooking something - or is there a better approach?

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com