Example #1
0
	REQUIRE(s2.radius() == 3);
	REQUIRE(s2.mp().x == 3);
	REQUIRE(s2.mp().y == 3);
	REQUIRE(s2.mp().z == 3);
	REQUIRE(Approx(s2.volume()) == 113.097);
	REQUIRE(Approx(s2.area()) == 113.097);


	Color red(255 , 0 , 0);
	Material m1("m1", red, red, red, 0);
	glm::vec3 position (0);
	Sphere s3{v, r, "s3", m1};

	REQUIRE(s3.name() == "s3");
	REQUIRE(s3.material().ka() == red);
}

TEST_CASE("Box","[Box]")
{
	Box b1{};

	REQUIRE(b1.min().x == 0);
	REQUIRE(b1.min().y == 0);
	REQUIRE(b1.min().z == 0);

	REQUIRE(b1.max().x == 1.0f);
	REQUIRE(b1.max().y == 1.0f);
	REQUIRE(b1.max().z == 1.0f);

	glm::vec3 max{6};
Example #2
0
Sphere::Sphere(Sphere const& sphere) :
Sphere::Shape( sphere.material(), sphere.name(), sphere.type() ),
m_center{ sphere.center() },
m_radius{ sphere.radius() } {}