Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Intersector.h
Go to the documentation of this file.
1#pragma once
2
4#include "Utility/TSpan.h"
5
6namespace ph
7{
8
9class Ray;
10class HitProbe;
11class Intersectable;
12
14{
15public:
16 virtual void update(TSpanView<const Intersectable*> intersectables) = 0;
17
18 bool isIntersecting(const Ray& ray, HitProbe& probe) const override = 0;
19
20 math::AABB3D calcAABB() const override = 0;
21
22 bool reintersect(
23 const Ray& ray,
24 HitProbe& probe,
25 const Ray& srcRay,
26 HitProbe& srcProbe) const override;
27
28 void calcHitDetail(
29 const Ray& ray,
30 HitProbe& probe,
31 HitDetail* out_detail) const override;
32};
33
34}// end namespace ph
Detailed information regarding a ray-primitive intersection.
Definition HitDetail.h:26
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
virtual void update(TSpanView< const Intersectable * > intersectables)=0
void calcHitDetail(const Ray &ray, HitProbe &probe, HitDetail *out_detail) const override
Calculates properties of a hit, such as coordinates and normal.
Definition Intersector.cpp:16
bool isIntersecting(const Ray &ray, HitProbe &probe) const override=0
Determine whether a given ray hits the object.
math::AABB3D calcAABB() const override=0
Calculates Axis-Aligned Bounding Box (AABB) of itself.
bool reintersect(const Ray &ray, HitProbe &probe, const Ray &srcRay, HitProbe &srcProbe) const override
Intersect the intersected object again with a different ray.
Definition Intersector.cpp:7
Represents a ray in space.
Definition Ray.h:21
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