More bounding boxes
This commit is contained in:
@@ -30,7 +30,7 @@ public:
|
||||
double maxCap;
|
||||
|
||||
Cone() : minCap(-INFINITY), maxCap(INFINITY), isClosed(false), Shape(SHAPE_CONE) { stats.addCone(); };
|
||||
BoundingBox getBounds();
|
||||
BoundingBox getLocalBounds();
|
||||
bool haveFiniteBounds() { return !(isinf(this->minCap) || isinf(this->maxCap)); };
|
||||
|
||||
void dumpMe(FILE *fp);
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
|
||||
Cylinder() : minCap(-INFINITY), maxCap(INFINITY), isClosed(false), Shape(SHAPE_CYLINDER) { stats.addCylinder(); };
|
||||
|
||||
BoundingBox getBounds();
|
||||
BoundingBox getLocalBounds();
|
||||
bool haveFiniteBounds() { return !(isinf(this->minCap) || isinf(this->maxCap)); };
|
||||
|
||||
void dumpMe(FILE *fp);
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
Shape *operator[](const int p) { return this->objectList[p]; }
|
||||
|
||||
Intersect intersect(Ray r);
|
||||
BoundingBox getLocalBounds();
|
||||
BoundingBox getBounds();
|
||||
|
||||
void updateBoundingBox();
|
||||
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
|
||||
public:
|
||||
Plane() : Shape(SHAPE_PLANE) { stats.addPlane(); };
|
||||
BoundingBox getBounds();
|
||||
BoundingBox getLocalBounds();
|
||||
bool haveFiniteBounds() { return false; };
|
||||
};
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
Tuple normalAt(Tuple point);
|
||||
|
||||
/* Bounding box points are always world value */
|
||||
virtual BoundingBox getLocalBounds();
|
||||
virtual BoundingBox getBounds();
|
||||
virtual bool haveFiniteBounds() { return true; };
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
public:
|
||||
Triangle(Point p1, Point p2, Point p3);
|
||||
BoundingBox getBounds();
|
||||
BoundingBox getLocalBounds();
|
||||
|
||||
void dumpMe(FILE *fp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user