added missing code changes
started working on refactoring of sensors new test-cases
This commit is contained in:
11
geo/BBox3.h
11
geo/BBox3.h
@@ -60,6 +60,17 @@ public:
|
||||
p2 -= p; // decrease maximum
|
||||
}
|
||||
|
||||
/** grow the bbox by the amount given for each dimension */
|
||||
void grow(const float v) {
|
||||
grow(Point3(v,v,v));
|
||||
}
|
||||
|
||||
/** grow the bbox by the amount given for each dimension */
|
||||
void grow(const Point3& p) {
|
||||
p1 -= p; // decrease minimum
|
||||
p2 += p; // increase maximum
|
||||
}
|
||||
|
||||
/** does the bbox contain the given point? */
|
||||
bool contains(const Point3& p) const {
|
||||
if (p.x < p1.x) {return false;}
|
||||
|
||||
@@ -26,6 +26,8 @@ struct Point3 {
|
||||
|
||||
Point3 operator - (const Point3& o) const {return Point3(x-o.x, y-o.y, z-o.z);}
|
||||
|
||||
Point3 operator * (const Point3& o) const {return Point3(x*o.x, y*o.y, z*o.z);}
|
||||
|
||||
Point3 operator * (const float v) const {return Point3(v*x, v*y, v*z);}
|
||||
|
||||
Point3 operator / (const float v) const {return Point3(x/v, y/v, z/v);}
|
||||
@@ -40,6 +42,8 @@ struct Point3 {
|
||||
Point3& operator -= (const Point3& o) {x-=o.x; y-=o.y; z-=o.z; return *this;}
|
||||
|
||||
|
||||
bool operator < (const Point3& o) const {return x<o.x && y<o.y && z<o.z;}
|
||||
|
||||
bool operator == (const Point3& o) const {return x==o.x && y==o.y && z==o.z;}
|
||||
|
||||
Point2 xy() const {return Point2(x,y);}
|
||||
|
||||
Reference in New Issue
Block a user