12template<
typename Index>
20 IndexedIntersectables(),
21 IntersectableAABBCalculator(),
26template<
typename Index>
30 IndexedIntersectables indexedIntersectables;
33 indexedIntersectables.vec.push_back(intersectable);
36 const std::size_t numIntersectables = indexedIntersectables.vec.size();
39 std::move(indexedIntersectables),
40 IntersectableAABBCalculator(),
44template<
typename Index>
49 return m_tree.nearestTraversal(
51 [ray, &probe, originalProbe = probe](
54 -> std::optional<real>
56 PH_ASSERT(intersectable);
58 const Ray raySegment(segment, ray.getTime());
60 HitProbe trialProbe = originalProbe;
61 if(intersectable->isIntersecting(raySegment, trialProbe))
64 return trialProbe.getHitRayT();
73template<
typename Index>
78 return m_tree.getAABB();
Lightweight ray intersection testing and reporting object. If an intersection is found,...
Definition HitProbe.h:27
An object in the scene that a ray can intersect with.
Definition Intersectable.h:31
Definition Intersector.h:14
Represents a ray in space.
Definition Ray.h:21
Definition TIndexedKdtreeIntersector.h:16
TIndexedKdtreeIntersector(math::IndexedKdtreeParams params=math::IndexedKdtreeParams())
Definition TIndexedKdtreeIntersector.ipp:14
void update(TSpanView< const Intersectable * > intersectables) override
Definition TIndexedKdtreeIntersector.ipp:28
bool isIntersecting(const Ray &ray, HitProbe &probe) const override
Determine whether a given ray hits the object.
Definition TIndexedKdtreeIntersector.ipp:46
Definition IndexedKdtreeParams.h:9
Definition TIndexedKdtree.h:28
Represents a line segment in space.
Definition TLineSegment.h:25
The root for all renderer implementations.
Definition EEngineProject.h:6
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19