# Useless Snippet #5: Ray/Capsule intersection test

January 28th, 2012 by JDGoal: Check if a ray intersects a capsule.

Restrictions:

1. Ray is defined by a point and a unit vector (Origin, Direction)

2. Capsule is defined by two points and a radius (A, B, r)

3. If there is an intersection, we must calculate the actual points of impact as well as the normals at those points

Read the rest of this entry »