8#include <Common/assertion.h>
9#include <Common/primitive_type.h>
10#include <Common/logging.h>
14namespace ph {
class DirectEnergySampleInput; }
32 const std::optional<math::Vector3R>& observationPos = std::nullopt,
65 std::optional<math::Vector3R> m_observationPos;
120 operator bool ()
const;
126 Ray m_observationRay{};
147 const std::optional<math::Vector3R>& observationPos,
150 const bool suggestDir)
153 m_observationPos = observationPos;
163 PH_DEFAULT_LOG(WarningOnce,
164 "Requesting suggested direction in `PrimitivePosSampleInput` has no effect when "
165 "observation position is present.");
179 return m_observationPos;
202 m_observationRay = observationRay;
223 return m_observationRay;
229 PH_ASSERT(!m_pdfPos.
isEmpty());
235 PH_ASSERT(!m_pdfDir.
isEmpty());
261inline PrimitivePosSampleOutput::operator bool ()
const
Output for PrimitivePosSampleQuery.
Definition PrimitivePosSampleQuery.h:77
const Ray & getObservationRay() const
Get the ray from observation position to sampled position. If there is no explicitly provided observa...
Definition PrimitivePosSampleQuery.h:220
void setPos(const math::Vector3R &pos)
Definition PrimitivePosSampleQuery.h:205
void setPdfPos(const lta::PDF &pdfPos)
Definition PrimitivePosSampleQuery.h:210
void setPdfDir(const lta::PDF &pdfDir)
Definition PrimitivePosSampleQuery.h:215
const lta::PDF & getPdfPos() const
Definition PrimitivePosSampleQuery.h:249
const math::Vector3R & getDir() const
Get the sampled direction. Some implementation may suggest a sample direction if no observation posit...
Definition PrimitivePosSampleQuery.h:233
const lta::PDF & getPdfDir() const
Definition PrimitivePosSampleQuery.h:255
real getPdfA() const
Definition PrimitivePosSampleQuery.h:239
const math::Vector3R & getPos() const
Get the sampled position.
Definition PrimitivePosSampleQuery.h:226
void setObservationRay(const Ray &observationRay)
Definition PrimitivePosSampleQuery.h:200
real getPdfW() const
Definition PrimitivePosSampleQuery.h:244
Information for generating a sample point on a primitive.
Definition PrimitivePosSampleQuery.h:132
Input inputs
Definition PrimitivePosSampleQuery.h:137
PrimitivePosSampleQuery()=default
Output outputs
Definition PrimitivePosSampleQuery.h:138
Represents a ray in space.
Definition Ray.h:21
const math::Vector3R & getDir() const
Definition Ray.h:214
A sample from a Probability Density Function (PDF).
Definition PDF.h:14
real getPdfW() const
Definition PDF.h:87
bool isEmpty() const
Definition PDF.h:105
real getPdfA() const
Definition PDF.h:93
The root for all renderer implementations.
Definition EEngineProject.h:6