7 #ifndef __geometry_RaySphereIntersect_h__ 8 #define __geometry_RaySphereIntersect_h__ 24 static T solve(
const Vector<3,T>& center,
const T radius,
27 static void resolveContact(
const Vector<3,T>& center,
const T radius,
45 const T b=T(2)*dot(direction,to_origin);
46 const T c=dot(to_origin,to_origin)-radius*radius;
62 T range=T(0.5)*((t1<t2)? t1: t2);
64 T range=T(-0.5)*(b+sqrtf(i));
67 range=T(-0.5)*(b-sqrtf(i));
85 intersection=origin+direction*range;
86 normal=(intersection-center)/radius;
kernel
Definition: namespace.dox:3
Find intersection between ray and sphere.
Definition: RaySphereIntersect.h:21