worked on 2D/3D raytracing
adjusted BVH improved 2D/3D BVH new bounding volumes new test cases renamed some test-cases for grouping reasons made GPC header-only using slight adjustments
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "../../geo/Sphere3.h"
|
||||
|
||||
TEST(Sphere3, contains) {
|
||||
TEST(Geo_Sphere3, contains) {
|
||||
|
||||
Sphere3 a(Point3(0,0,0), 10);
|
||||
|
||||
@@ -30,31 +30,31 @@ TEST(Sphere3, contains) {
|
||||
|
||||
}
|
||||
|
||||
TEST(Sphere3, join) {
|
||||
TEST(Geo_Sphere3, join) {
|
||||
|
||||
// no overlap
|
||||
Sphere3 a1(Point3(-1,0,0), 1);
|
||||
Sphere3 a2(Point3(+1,0,0), 1);
|
||||
Sphere3 a3 = Sphere3::join(a1, a2);
|
||||
ASSERT_EQ(Point3(0,0,0), a3.center);
|
||||
ASSERT_EQ(2, a3.radius);
|
||||
ASSERT_NEAR(2, a3.radius, 0.001);
|
||||
|
||||
// overlap
|
||||
Sphere3 b1(Point3(-1,0,0), 1.5);
|
||||
Sphere3 b2(Point3(+1,0,0), 1.5);
|
||||
Sphere3 b3 = Sphere3::join(b1, b2);
|
||||
ASSERT_EQ(Point3(0,0,0), b3.center);
|
||||
ASSERT_EQ(2.5, b3.radius);
|
||||
ASSERT_NEAR(2.5, b3.radius, 0.001);
|
||||
|
||||
// fully within
|
||||
Sphere3 c1(Point3(-1,0,0), 3.6);
|
||||
Sphere3 c2(Point3(+1,0,0), 1.5);
|
||||
Sphere3 c3 = Sphere3::join(c1, c2);
|
||||
ASSERT_EQ(c1.center, c3.center);
|
||||
ASSERT_EQ(c1.radius, c3.radius);
|
||||
ASSERT_NEAR(c1.radius, c3.radius, 0.001);
|
||||
Sphere3 c4 = Sphere3::join(c2, c1);
|
||||
ASSERT_EQ(c1.center, c4.center);
|
||||
ASSERT_EQ(c1.radius, c4.radius);
|
||||
ASSERT_NEAR(c1.radius, c4.radius, 0.001);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user