4 #include <DetailedVoxel.h>
5 #include <maths/RayUtils.h>
40 if(it.empty())
return false;
41 if(it[0] < 0.0 && it[1] < 0.0)
return false;
50 std::vector<int>({0, 49}),
52 0, 89.7859174, 0.0222306, 0, 0.1843913,
53 0.1244739, 0.0644808, 3.1595603, 1, 0,
57 dv1.
part = std::make_shared<ScenePart>();
58 dv1.
part->onRayIntersectionMode =
"TRANSMITTIVE";
61 std::vector<int>({0, 120}),
63 0, 89.9096456, 0.061645, 0, 0.1772976,
64 0.3734215, 0.124348, 14.9217589, 1, 0,
68 dv2.
part = std::make_shared<ScenePart>();
69 dv2.
part->onRayIntersectionMode =
"TRANSMITTIVE";
73 glm::dvec3 o1(6, 6, 9);
74 glm::dvec3 v1(0, 0, -1);
75 glm::dvec3 o2(-6, 6, 6);
76 glm::dvec3 v2(1, 0, 0);
77 glm::dvec3 o3(-6, 4, -5.5);
78 glm::dvec3 v3(0.968, 0.061, 0.242);
79 glm::dvec3 o4(2, 4, -10);
80 glm::dvec3 v4(0.371, 0.019, 0.928);
81 glm::dvec3 o5(9, 4, -10);
82 glm::dvec3 v5(0.707, 0.035, 0.707);
83 glm::dvec3 o6(6, 6, 9);
84 glm::dvec3 v6(0, 0, 1);
85 glm::dvec3 o7(7, 6, 3);
86 glm::dvec3 v7(0.40824829, 0.81649658, 0.40824829);
127 glm::dvec3 so(0, 0, 0);
133 glm::dvec3 iip(so+it[0]*v1);
141 so = oip + 0.00001 * v1;
143 iip = glm::dvec3(so+it[0]*v1);
151 iip = glm::dvec3(so+it[0]*v2);
159 iip = glm::dvec3(so+it[0]*v3);
167 iip = glm::dvec3(so+it[0]*v4);
172 so = oip + 0.00001 * v4;
174 iip = glm::dvec3(so+it[0]*v4);
182 iip = glm::dvec3(so+it[0]*v7);
Class which extends Voxel to support AMAPVox format with extra features.
Definition: DetailedVoxel.h:15
IntersectionHandlingResult onRayIntersection(NoiseSource< double > &uniformNoiseSource, glm::dvec3 &rayDirection, glm::dvec3 const &insideIntersectionPoint, glm::dvec3 const &outsideIntersectionPoint, double rayIntensity) override
Define ray intersection handling for DetailedVoxel primitive.
Definition: DetailedVoxel.cpp:25
BaseTest class.
Definition: BaseTest.h:20
Test for ray intersection and corresponding handling (if any)
Definition: RayIntersectionTest.h:14
bool run() override
Definition: RayIntersectionTest.h:46
bool checkIntersection(std::vector< double > it)
Check if the intersection returned by the getIntersection method is valid or not.
Definition: RayIntersectionTest.h:39
RayIntersectionTest()
Ray intersection test constructor.
Definition: RayIntersectionTest.h:21
Output class for intersection handling methods.
Definition: IntersectionHandlingResult.h:14
bool canRayContinue()
Check whether the ray can continue after intersection or not.
Definition: IntersectionHandlingResult.h:64
std::shared_ptr< ScenePart > part
Shared pointer to the scene part the primitive belongs to.
Definition: Primitive.h:57
static glm::dvec3 obtainPointAfterTraversing(AABB const &aabb, glm::dvec3 const &origin, glm::dvec3 const &direction, double eps=0.00001)
Obtain the point immediately after finishing traversing given bounding box, with an offset specified ...
Definition: RayUtils.cpp:5
AABB * getAABB() override
Definition: Voxel.cpp:37
std::vector< double > getRayIntersection(const glm::dvec3 &rayOrigin, const glm::dvec3 &rayDir) override
Definition: Voxel.cpp:108