struct Intersection
{
- Vector point; // nearest point of intersection
+ Scalar distance; // distance from the origin to the nearest point
Vector normal; // surface normal at intersection point
+
+ bool operator < (const Intersection& rhs)
+ {
+ return distance < rhs.distance;
+ }
};
void solve(Vector& p, Scalar t) const
{
direction.normalize();
}
-
};