#include "Box.hxx"
-Box::Box()
+Box::Box() : m_min(-Infinity), m_max(Infinity)
{
}
Box::Box(const Box& b)
{
+ m_min = b.m_min;
+ m_max = b.m_max;
}
Box&
Box::operator=(const Box& b)
{
+ m_min = b.m_min;
+ m_max = b.m_max;
return *this;
}
void
Box::Extend(const Vec3f& a)
{
+ // for all three coordinates, move m_max or m_min to the point
+ for(size_t i = 0; i < 3; i++) {
+ if(a[i] > m_max[i]) {
+ m_max[i] = a[i];
+ } else if(a[i] < m_min[i]) {
+ m_min[i] = a[i];
+ } // else: do nothing, coordinate is inside the box
+ }
}
-void
+void
Box::Extend(const Box& box)
{
}