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

@@ -108,15 +108,12 @@ Tuple Cylinder::localNormalAt(Tuple point)
return Vector(point.x, 0, point.z);
}
BoundingBox Cylinder::getBounds()
BoundingBox Cylinder::getLocalBounds()
{
BoundingBox ret;
ret.min = this->objectToWorld(Point(-1, this->minCap, -1));
ret.max = this->objectToWorld(Point(1, this->maxCap, 1));
ret.min.fixPoint();
ret.max.fixPoint();
ret | Point(-1, this->minCap, -1);
ret | Point(1, this->maxCap, 1);
return ret;
}