Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
EnergyEmissionSampleQuery.h
Go to the documentation of this file.
1#pragma once
2
3#include "Math/TVector3.h"
4#include "Core/Ray.h"
6#include "Core/LTA/PDF.h"
8
9#include <Common/assertion.h>
10#include <Common/primitive_type.h>
11
12namespace ph
13{
14
18{
19public:
20 void set(const Time& time);
21
22 const Time& getTime() const;
23
24private:
25 Time m_time;
26#if PH_DEBUG
27 bool m_hasSet{false};
28#endif
29};
30
34{
35public:
36 void setPdf(const lta::PDF& pdfPos, const lta::PDF& pdfDir);
37 void setEmittedRay(const Ray& emittedRay);
38 void setEmittedEnergy(const math::Spectrum& emittedEnergy);
39
40 real getPdfA() const;
41 real getPdfW() const;
42 const lta::PDF& getPdfPos() const;
43 const lta::PDF& getPdfDir() const;
44 const Ray& getEmittedRay() const;
45 const math::Spectrum& getEmittedEnergy() const;
46
51 operator bool () const;
52
53private:
54 lta::PDF m_pdfPos{};
55 lta::PDF m_pdfDir{};
56 Ray m_emittedRay{};
57 math::Spectrum m_emittedEnergy{0};
58};
59
73
74// In-header Implementations:
75
77 const Time& time)
78{
79 m_time = time;
80
81#if PH_DEBUG
82 m_hasSet = true;
83#endif
84}
85
87{
88 PH_ASSERT(m_hasSet);
89 return m_time;
90}
91
92inline void EnergyEmissionSampleOutput::setPdf(const lta::PDF& pdfPos, const lta::PDF& pdfDir)
93{
94 m_pdfPos = pdfPos;
95 m_pdfDir = pdfDir;
96}
97
98inline void EnergyEmissionSampleOutput::setEmittedRay(const Ray& emittedRay)
99{
100 m_emittedRay = emittedRay;
101}
102
104{
105 m_emittedEnergy = emittedEnergy;
106}
107
109{
110 PH_ASSERT(*this);
111 return m_pdfPos.getPdfA();
112}
113
115{
116 PH_ASSERT(*this);
117 return m_pdfDir.getPdfW();
118}
119
121{
122 PH_ASSERT(*this);
123 return m_pdfPos;
124}
125
127{
128 PH_ASSERT(*this);
129 return m_pdfDir;
130}
131
133{
134 PH_ASSERT(*this);
135 return m_emittedRay;
136}
137
139{
140 PH_ASSERT(*this);
141 return m_emittedEnergy;
142}
143
144inline EnergyEmissionSampleOutput::operator bool () const
145{
146 return m_pdfPos && m_pdfDir;
147}
148
149}// end namespace ph
Input for EnergyEmissionSampleQuery.
Definition EnergyEmissionSampleQuery.h:18
const Time & getTime() const
Definition EnergyEmissionSampleQuery.h:86
void set(const Time &time)
Definition EnergyEmissionSampleQuery.h:76
Output for EnergyEmissionSampleQuery.
Definition EnergyEmissionSampleQuery.h:34
const math::Spectrum & getEmittedEnergy() const
Definition EnergyEmissionSampleQuery.h:138
const lta::PDF & getPdfDir() const
Definition EnergyEmissionSampleQuery.h:126
const lta::PDF & getPdfPos() const
Definition EnergyEmissionSampleQuery.h:120
real getPdfA() const
Definition EnergyEmissionSampleQuery.h:108
void setEmittedEnergy(const math::Spectrum &emittedEnergy)
Definition EnergyEmissionSampleQuery.h:103
void setEmittedRay(const Ray &emittedRay)
Definition EnergyEmissionSampleQuery.h:98
real getPdfW() const
Definition EnergyEmissionSampleQuery.h:114
const Ray & getEmittedRay() const
Definition EnergyEmissionSampleQuery.h:132
void setPdf(const lta::PDF &pdfPos, const lta::PDF &pdfDir)
Definition EnergyEmissionSampleQuery.h:92
Information for generating a sample for energy emission.
Definition EnergyEmissionSampleQuery.h:63
Output outputs
Definition EnergyEmissionSampleQuery.h:69
Input inputs
Definition EnergyEmissionSampleQuery.h:68
Represents a ray in space.
Definition Ray.h:21
Definition Time.h:9
A sample from a Probability Density Function (PDF).
Definition PDF.h:14
real getPdfW() const
Definition PDF.h:87
real getPdfA() const
Definition PDF.h:93
Definition TTristimulusSpectrum.h:11
The root for all renderer implementations.
Definition EEngineProject.h:6