So using std::vector in radialHit() to calculate multiple values for times_gt_t was causing a bit of a slowdown. Calling clear() is expensive, and similar for iterating through.
I saw that we only used times_gt_t[0] ever to calculate the intersection_time, or tMaxR.
Then, it is sufficient to find the first time greater than t.
The one issue would be in the tangential hit case, where intersection_times[0] and intersection_times[1] are equal, but there are not two times greater than t.
In other words, ray.timeOfIntersectionAt(v - d_a) == ray.timeOfIntersectionAt(v + d_a), one of them is greater than t, but the other isn't. This contradicts itself; therefore, we can lessen the logic a bit.
In other news,
Remove the use of a REL_EPSILON. Now, all FP equality is determined by an ABS_EPSILON.
I've used the NonZeroDirectionIndex() in the ray segment portion. This ensures we don't need to calculate P1 + ray_segment * b for x,y,z with each GeneralizedPlaneHit() call.
Vec3 is now backed by a std::array. This means the Vec3[] operator is random-access.
So using std::vector in radialHit() to calculate multiple values for times_gt_t was causing a bit of a slowdown. Calling clear() is expensive, and similar for iterating through.
I saw that we only used times_gt_t[0] ever to calculate the intersection_time, or tMaxR. Then, it is sufficient to find the first time greater than t.
The one issue would be in the tangential hit case, where intersection_times[0] and intersection_times[1] are equal, but there are not two times greater than t.
In other words,
ray.timeOfIntersectionAt(v - d_a) == ray.timeOfIntersectionAt(v + d_a)
, one of them is greater than t, but the other isn't. This contradicts itself; therefore, we can lessen the logic a bit.In other news,