Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Intersectable.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace ph
6{
7
8class Ray;
9class HitProbe;
10class HitDetail;
11
31{
32public:
33 virtual ~Intersectable() = default;
34
45 virtual bool isIntersecting(const Ray& ray, HitProbe& probe) const = 0;
46
66 virtual bool reintersect(
67 const Ray& ray,
68 HitProbe& probe,
69 const Ray& srcRay,
70 HitProbe& srcProbe) const = 0;
71
91 virtual void calcHitDetail(
92 const Ray& ray,
93 HitProbe& probe,
94 HitDetail* out_detail) const = 0;
95
98 virtual math::AABB3D calcAABB() const = 0;
99
110 virtual bool isOccluding(const Ray& ray) const;
111
121 virtual bool mayOverlapVolume(const math::AABB3D& volume) const;
122};
123
124}// 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
virtual bool reintersect(const Ray &ray, HitProbe &probe, const Ray &srcRay, HitProbe &srcProbe) const =0
Intersect the intersected object again with a different ray.
virtual math::AABB3D calcAABB() const =0
Calculates Axis-Aligned Bounding Box (AABB) of itself.
virtual bool mayOverlapVolume(const math::AABB3D &volume) const
Conservatively checks whether this object overlaps a volume.
Definition Intersectable.cpp:14
virtual ~Intersectable()=default
virtual bool isOccluding(const Ray &ray) const
Determines whether this object blocks the ray.
Definition Intersectable.cpp:8
virtual void calcHitDetail(const Ray &ray, HitProbe &probe, HitDetail *out_detail) const =0
Calculates properties of a hit, such as coordinates and normal.
virtual bool isIntersecting(const Ray &ray, HitProbe &probe) const =0
Determine whether a given ray hits the object.
Represents a ray in space.
Definition Ray.h:21
The root for all renderer implementations.
Definition EEngineProject.h:6