diff -r 4d192e13ee84 -r f4fcabf05785 src/scene.h --- a/src/scene.h Fri Nov 23 16:14:38 2007 +0100 +++ b/src/scene.h Sat Nov 24 21:55:41 2007 +0100 @@ -16,6 +16,14 @@ using namespace std; +class Ray +{ +public: + Vector3 a, dir; + Ray(const Vector3 &aa, const Vector3 &adir): + a(aa), dir(adir) {}; +}; + /* axis-aligned bounding box */ class BBox { @@ -26,14 +34,7 @@ float w() { return R.x-L.x; }; float h() { return R.y-L.y; }; float d() { return R.z-L.z; }; -}; - -class Ray -{ -public: - Vector3 a, dir; - Ray(const Vector3 &aa, const Vector3 &adir): - a(aa), dir(adir) {}; + bool intersect(const Ray &ray, float &a, float &b); }; class Light