]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Ray.hh
stream-based logging classes
[chaz/yoink] / src / Moof / Ray.hh
index 15e1d9dbec71d726a9aa0e54034c4114cf9e3bd4..23ebd7655924ea9a6819fecd1ca3354f51e56c33 100644 (file)
@@ -53,8 +53,13 @@ struct Ray : public Drawable
 
        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
@@ -77,7 +82,6 @@ struct Ray : public Drawable
        {
                direction.normalize();
        }
-
 };
 
 
This page took 0.017032 seconds and 4 git commands to generate.