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
void draw(Scalar alpha = 0.0) const
{
Vector end = point + 1000.0 * direction;
+ // TODO this is kinda cheesy
Mf::Texture::resetBind();
glBegin(GL_LINES);
{
direction.normalize();
}
-
};