--- /dev/null
+#ifndef BOX_HXX
+#define BOX_HXX
+
+#include "Ray.hxx"
+
+class Box
+{
+public:
+ Box();
+ ~Box();
+
+ Box(const Box& b);
+ Box& operator=(const Box& b);
+
+ //! Extend the bounding box to contain point a
+ void Extend(const Vec3f& a);
+ //! Clear the bounding box, i.e. set dimensions to infinity.
+ void Clear();
+ //! Extend the box to contain the given box.
+ void Extend(const Box& box);
+ //! Test for overlap with the given box b.
+ bool Overlaps(const Box& b) const;
+ //! Clip the given ray against the box. tnear and tfar should be filled by this function!
+ void Clip(const Ray& ray, float& tnear,float& tfar) const;
+
+ //! Query the dimension of the bounding box.
+ const Vec3f& min() const;
+ const Vec3f& max() const;
+private:
+ Vec3f m_min, m_max;
+};
+
+#endif