]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Ray.hh
simplified win32 installer build script
[chaz/yoink] / src / Moof / Ray.hh
index 15e1d9dbec71d726a9aa0e54034c4114cf9e3bd4..5a693d29be996da95d2065b3e617ad971971a6cc 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
@@ -65,6 +70,7 @@ struct Ray : public Drawable
        void draw(Scalar alpha = 0.0) const
        {
                Vector end = point + 1000.0 * direction;
+               // TODO this is kinda cheesy
 
                Mf::Texture::resetBind();
                glBegin(GL_LINES);
@@ -77,7 +83,6 @@ struct Ray : public Drawable
        {
                direction.normalize();
        }
-
 };
 
 
This page took 0.017047 seconds and 4 git commands to generate.