More bounding boxes

This commit is contained in:
Godzil
2020-02-28 18:33:59 +00:00
parent b4ae737b40
commit 307c125eba
19 changed files with 92 additions and 55 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -38,6 +38,7 @@ public:
Shape *operator[](const int p) { return this->objectList[p]; }
Intersect intersect(Ray r);
BoundingBox getLocalBounds();
BoundingBox getBounds();
void updateBoundingBox();

View File

@@ -19,7 +19,7 @@ private:
public:
Plane() : Shape(SHAPE_PLANE) { stats.addPlane(); };
BoundingBox getBounds();
BoundingBox getLocalBounds();
bool haveFiniteBounds() { return false; };
};

View File

@@ -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; };

View File

@@ -24,7 +24,7 @@ public:
public:
Triangle(Point p1, Point p2, Point p3);
BoundingBox getBounds();
BoundingBox getLocalBounds();
void dumpMe(FILE *fp);