28 return keepFirst(currentIntersections, currentTmin);
37 return keepAll(currentIntersections, currentTmin);
40 return keepFirst(currentIntersections, currentTmin);
47 if (currentIntersections.empty())
54 std::list<Intersection>::iterator firstInter = currentIntersections.end();
57 for (std::list<Intersection>::iterator it = currentIntersections.begin();
58 it != currentIntersections.end(); it++)
61 if (tmin < 0. || it->t <= tmin)
70 if (firstInter != currentIntersections.end())
73 firstIntersection.
normal = firstInter->normal;
74 firstIntersection.
p = firstInter->p;
75 firstIntersection.
t = firstInter->t;
76 firstIntersection.
forme = firstInter->forme;
77 currentIntersections.clear();
78 currentIntersections.push_back(firstIntersection);
86 if (currentIntersections.empty())
95 for (std::list<Intersection>::iterator it = currentIntersections.begin();
96 it != currentIntersections.end(); it++)
99 if (
triangle && (tmin < 0. || it->t < tmin))
105 std::list<Intersection>::iterator it = currentIntersections.begin();
107 while (it != currentIntersections.end())
109 if (tmin > 0. && it->t > tmin)
110 currentIntersections.erase(it++);
120 if (currentIntersections.empty())
129 for (std::list<Intersection>::iterator it = currentIntersections.begin();
130 it != currentIntersections.end(); it++)
132 if (it->p->isVisible() && (tmin < 0. || it->t < tmin))
138 std::list<Intersection>::iterator it = currentIntersections.begin();
140 while (it != currentIntersections.end())
142 if (tmin > 0. && it->t > tmin)
143 currentIntersections.erase(it++);
153 if (currentIntersections.empty())
162 for (std::list<Intersection>::iterator it = currentIntersections.begin();
163 it != currentIntersections.end(); it++)
165 if (tmin < 0. || it->t <= tmin)
decimal keepAll(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep all intersections before reaching currentTmin and return the tmin of the first one encountered.
@ ALL_BEFORE_TRIANGLE
ALL_BEFORE_TRIANGLE.
@ ALL_BEFORE_VISIBLE
ALL_BEFORE_VISIBLE.
decimal keepAllBeforeVisible(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep all intersections encountered before intersecting a triangle and before reaching currentTmin,...
decimal keepAllBeforeTriangle(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep all intersections encountered before intersecting a visible shape and before reaching currentTmi...
decimal keepFunction(treatment choice, std::list< Intersection > ¤tIntersections, decimal currentTmin)
decimal keepFirst(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep only the first intersection encountered before reaching currentTmin and return its corresponding...