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

@@ -35,15 +35,12 @@ Tuple Plane::localNormalAt(Tuple point)
return Vector(0, 1, 0);
}
BoundingBox Plane::getBounds()
BoundingBox Plane::getLocalBounds()
{
BoundingBox ret;
ret.min = this->objectToWorld(Point(-INFINITY, 0-getEpsilon(), -INFINITY));
ret.max = this->objectToWorld(Point(INFINITY, 0+getEpsilon(), INFINITY));
ret.min.fixPoint();
ret.max.fixPoint();
ret | Point(-INFINITY, 0-getEpsilon(), -INFINITY);
ret | Point(INFINITY, 0+getEpsilon(), INFINITY);
return ret;
}