b1951e422d53d6cb055c9a11ebbc754b59ab883e
[MicroTrace.git] / Box.cxx
1 #include "Box.hxx"
2
3 Box::Box() : m_min(-Infinity), m_max(Infinity)
4 {
5 }
6
7 Box::~Box()
8 {
9 }
10
11 Box::Box(const Box& b)
12 {
13 m_min = b.m_min;
14 m_max = b.m_max;
15 }
16
17 Box&
18 Box::operator=(const Box& b)
19 {
20 m_min = b.m_min;
21 m_max = b.m_max;
22 return *this;
23 }
24
25 void
26 Box::Clear()
27 {
28 }
29
30 void
31 Box::Extend(const Vec3f& a)
32 {
33 // for all three coordinates, move m_max or m_min to the point
34 for(size_t i = 0; i < 3; i++) {
35 if(a[i] > m_max[i]) {
36 m_max[i] = a[i];
37 } else if(a[i] < m_min[i]) {
38 m_min[i] = a[i];
39 } // else: do nothing, coordinate is inside the box
40 }
41 }
42
43 void
44 Box::Extend(const Box& box)
45 {
46 }
47
48 bool
49 Box::Overlaps(const Box& b) const
50 {
51 return false;
52 }
53
54 void
55 Box::Clip(const Ray& ray, float& tnear, float& tfar) const
56 {
57 }
58
59 const Vec3f&
60 Box::min() const
61 {
62 return m_min;
63 }
64
65 const Vec3f&
66 Box::max() const
67 {
68 return m_max;
69 }
This page took 0.048617 seconds and 3 git commands to generate.