Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
PEmpty.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <Common/assertion.h>
7
8namespace ph
9{
10
11class PEmpty : public Primitive
12{
13public:
14 PEmpty();
15
16 bool isIntersecting(const Ray& ray, HitProbe& probe) const override;
17
18 bool reintersect(
19 const Ray& ray,
20 HitProbe& probe,
21 const Ray& srcRay,
22 HitProbe& srcProbe) const override;
23
24 void calcHitDetail(
25 const Ray& ray,
26 HitProbe& probe,
27 HitDetail* out_detail) const override;
28
29 bool isOccluding(const Ray& ray) const override;
30
31 bool mayOverlapVolume(const math::AABB3D& volume) const override;
32 math::AABB3D calcAABB() const override;
33};
34
35// In-header Implementation:
36
37inline PEmpty::PEmpty() :
38 Primitive()
39{}
40
41inline bool PEmpty::isIntersecting(const Ray& ray, HitProbe& probe) const
42{
43 return false;
44}
45
46inline bool PEmpty::isOccluding(const Ray& ray) const
47{
48 return false;
49}
50
52 const Ray& /* ray */,
53 HitProbe& /* probe */,
54 const Ray& /* srcRay */,
55 HitProbe& /* srcProbe */) const
56{
57 return false;
58}
59
61 const Ray& ray,
62 HitProbe& probe,
63 HitDetail* const out_detail) const
64{
65 // An empty always returns false for intersection probing, it is therefore
66 // impossible to have this method called with a valid HitProbe instance.
67 PH_ASSERT_UNREACHABLE_SECTION();
68}
69
70inline bool PEmpty::mayOverlapVolume(const math::AABB3D& volume) const
71{
72 return false;
73}
74
76{
78}
79
80}// 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
Definition PEmpty.h:12
bool mayOverlapVolume(const math::AABB3D &volume) const override
Conservatively checks whether this object overlaps a volume.
Definition PEmpty.h:70
bool isOccluding(const Ray &ray) const override
Determines whether this object blocks the ray.
Definition PEmpty.h:46
PEmpty()
Definition PEmpty.h:37
bool reintersect(const Ray &ray, HitProbe &probe, const Ray &srcRay, HitProbe &srcProbe) const override
Intersect the intersected object again with a different ray.
Definition PEmpty.h:51
math::AABB3D calcAABB() const override
Calculates Axis-Aligned Bounding Box (AABB) of itself.
Definition PEmpty.h:75
void calcHitDetail(const Ray &ray, HitProbe &probe, HitDetail *out_detail) const override
Calculates properties of a hit, such as coordinates and normal.
Definition PEmpty.h:60
bool isIntersecting(const Ray &ray, HitProbe &probe) const override
Determine whether a given ray hits the object.
Definition PEmpty.h:41
A physical shape in the scene.
Definition Primitive.h:23
Represents a ray in space.
Definition Ray.h:21
static TAABB3D makeEmpty()
Definition TAABB3D.ipp:15
The root for all renderer implementations.
Definition EEngineProject.h:6