Continue working on bounding boxes.

This commit is contained in:
Godzil
2020-02-25 09:20:38 +00:00
parent 3011544e8f
commit 831a096281
6 changed files with 71 additions and 7 deletions

View File

@@ -207,4 +207,15 @@ TEST(SphereTest, A_helper_for_producing_a_sphere_with_a_glassy_material)
ASSERT_EQ(s.transformMatrix, Matrix4().identity());
ASSERT_EQ(s.material.transparency, 1.0);
ASSERT_EQ(s.material.refractiveIndex, 1.5);
}
TEST(SphereTest, The_bounding_box_of_a_sphere)
{
Sphere t = Sphere();
BoundingBox b = BoundingBox(Point(-1, -1, -1), Point(1, 1, 1));
BoundingBox res = t.getBounds();
ASSERT_EQ(res.min, b.min);
ASSERT_EQ(res.max, b.max);
}