Some code for sphere and capsule vs. triangle intersections in 3D. Also contains some miscellaneous distance formulas used through them. Take it without credit it's about time there was an easy way to obtain these.