added constructor with center and radius

This commit is contained in:
Nico Pietroni 2014-08-01 00:15:51 +00:00
parent 433d070691
commit 2c2b5b1319
1 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,12 @@ public:
inline Box2( const Box2 & b ) { min=b.min; max=b.max; }
/// Min Max constructor
inline Box2( const Point2<BoxScalarType> & mi, const Point2<BoxScalarType> & ma ) { min = mi; max = ma; }
inline Box2(const Point2<BoxScalarType> & center, const BoxScalarType & radius) {
min = center-Point2<BoxScalarType>(radius,radius);
max = center+Point2<BoxScalarType>(radius,radius);
}
/// Distructor
inline ~Box2() { }
/// Operator to compare two bounding box