drand() needs <cstdlib>
[MicroTrace.git] / Box.hxx
1 #ifndef BOX_HXX
2 #define BOX_HXX
3
4 #include "Ray.hxx"
5
6 class Box
7 {
8 public:
9 Box();
10 ~Box();
11
12 Box(const Box& b);
13 Box& operator=(const Box& b);
14
15 //! Extend the bounding box to contain point a
16 void Extend(const Vec3f& a);
17 //! Clear the bounding box, i.e. set dimensions to infinity.
18 void Clear();
19 //! Extend the box to contain the given box.
20 void Extend(const Box& box);
21 //! Test for overlap with the given box b.
22 bool Overlaps(const Box& b) const;
23 //! Clip the given ray against the box. tnear and tfar should be filled by this function!
24 void Clip(const Ray& ray, float& tnear,float& tfar) const;
25
26 //! Query the dimension of the bounding box.
27 const Vec3f& min() const;
28 const Vec3f& max() const;
29 private:
30 Vec3f m_min, m_max;
31 };
32
33 #endif
This page took 0.042339 seconds and 5 git commands to generate.