src/types/boundingbox.cpp

changeset 20
cef43609a374
parent 19
ed9685f44ab3
child 22
6da867fa5429
equal deleted inserted replaced
19:ed9685f44ab3 20:cef43609a374
24 return *this; 24 return *this;
25 } 25 }
26 26
27 void BoundingBox::consider(const Point3D& vertex) 27 void BoundingBox::consider(const Point3D& vertex)
28 { 28 {
29 this->minimum.x = std::min(vertex.x, this->minimum.x); 29 this->minimum.x = math::min(vertex.x, this->minimum.x);
30 this->minimum.y = std::min(vertex.y, this->minimum.y); 30 this->minimum.y = math::min(vertex.y, this->minimum.y);
31 this->minimum.z = std::min(vertex.z, this->minimum.z); 31 this->minimum.z = math::min(vertex.z, this->minimum.z);
32 this->maximum.x = std::max(vertex.x, this->maximum.x); 32 this->maximum.x = math::max(vertex.x, this->maximum.x);
33 this->maximum.y = std::max(vertex.y, this->maximum.y); 33 this->maximum.y = math::max(vertex.y, this->maximum.y);
34 this->maximum.z = std::max(vertex.z, this->maximum.z); 34 this->maximum.z = math::max(vertex.z, this->maximum.z);
35 } 35 }
36 36
37 /* 37 /*
38 * Returns the length of the bounding box on the longest measure. 38 * Returns the length of the bounding box on the longest measure.
39 */ 39 */
62 /* 62 /*
63 * Returns the length of the bounding box's space diagonal. 63 * Returns the length of the bounding box's space diagonal.
64 */ 64 */
65 double spaceDiagonal(const BoundingBox& box) 65 double spaceDiagonal(const BoundingBox& box)
66 { 66 {
67 return distance(box.minimum, box.maximum); 67 return math::distance(box.minimum, box.maximum);
68 } 68 }

mercurial