gKit2 light
bbox.cpp
1 
2 #include <algorithm>
3 #include <cfloat>
4 
5 #include "bbox.h"
6 
7 
8 BBox::BBox( const BBox& a, const BBox& b )
9 {
10  min.x= std::min(a.min.x, b.min.x);
11  min.y= std::min(a.min.y, b.min.y);
12  min.z= std::min(a.min.z, b.min.z);
13  max.x= std::max(a.max.x, b.max.x);
14  max.y= std::max(a.max.y, b.max.y);
15  max.z= std::max(a.max.z, b.max.z);
16 }
17 
18 BBox& bbox_insert( BBox& box, const Point& p )
19 {
20  box.min.x= std::min(box.min.x, p.x);
21  box.min.y= std::min(box.min.y, p.y);
22  box.min.z= std::min(box.min.z, p.z);
23  box.max.x= std::max(box.max.x, p.x);
24  box.max.y= std::max(box.max.y, p.y);
25  box.max.z= std::max(box.max.z, p.z);
26  return box;
27 }
Definition: bbox.h:10
representation d'un point 3d.
Definition: vec.h:19