28 float t0 = B - sqrtf(D);
29 float t1 = B + sqrtf(D);
30 if ((t0 > 0.1f) && (t0 < ray.
getMaxt()))
37 if ((t1 > 0.1f) && (t1 < ray.
getMaxt()))
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
decimal getMaxt() const
Return maxt.
vec3 getPosition() const
Return starting point ray.
vec3 getDirection() const
Return direction of the ray.
virtual bool getIntersection(Ray &ray, Intersection &inter)
Check if a ray intersect this sphere.
decimal radius
Radius of the sphere.
vec3 position
Center of the sphere.
base_vec3< decimal > vec3