Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::PrimitivePosSampleOutput Class Referencefinal

Output for PrimitivePosSampleQuery. More...

#include <PrimitivePosSampleQuery.h>

Public Member Functions

void setPos (const math::Vector3R &pos)
 
void setPdfPos (const lta::PDF &pdfPos)
 
void setPdfDir (const lta::PDF &pdfDir)
 
void setObservationRay (const Ray &observationRay)
 
const math::Vector3RgetPos () const
 Get the sampled position.
 
const math::Vector3RgetDir () const
 Get the sampled direction. Some implementation may suggest a sample direction if no observation position is given.
 
real getPdfA () const
 
real getPdfW () const
 
const lta::PDFgetPdfPos () const
 
const lta::PDFgetPdfDir () const
 
const RaygetObservationRay () const
 Get the ray from observation position to sampled position. If there is no explicitly provided observation position, the sampled position will be the observation position. In this case, the length of the ray will be 0 and whether the direction of the ray may set to a meaningful value is depending on PrimitivePosSampleInput::suggestDir(): true: getObservationRay().getDir() and getDir() both contain the suggested direction if getPdfDir() is non-empty. false: No standard behavior is defined.
 
 operator bool () const
 Checks the validity of the sample.
 

Detailed Description

Member Function Documentation

◆ getDir()

const math::Vector3R & ph::PrimitivePosSampleOutput::getDir ( ) const
inline

Get the sampled direction. Some implementation may suggest a sample direction if no observation position is given.

Returns
A vector representing the suggested sample direction.
Note
This is only available if getPdfDir() is non-empty.

◆ getObservationRay()

const Ray & ph::PrimitivePosSampleOutput::getObservationRay ( ) const
inline

Get the ray from observation position to sampled position. If there is no explicitly provided observation position, the sampled position will be the observation position. In this case, the length of the ray will be 0 and whether the direction of the ray may set to a meaningful value is depending on PrimitivePosSampleInput::suggestDir(): true: getObservationRay().getDir() and getDir() both contain the suggested direction if getPdfDir() is non-empty. false: No standard behavior is defined.

Note
If a hit event is associated with this ray, obtaining the sampled position by calculating its hit detail is more accurate but slower. Using getObservationRay().getHead() is faster but is generally less accurate (though it is useful if only a crude position is required).

◆ getPdfA()

real ph::PrimitivePosSampleOutput::getPdfA ( ) const
inline

◆ getPdfDir()

const lta::PDF & ph::PrimitivePosSampleOutput::getPdfDir ( ) const
inline

◆ getPdfPos()

const lta::PDF & ph::PrimitivePosSampleOutput::getPdfPos ( ) const
inline

◆ getPdfW()

real ph::PrimitivePosSampleOutput::getPdfW ( ) const
inline

◆ getPos()

const math::Vector3R & ph::PrimitivePosSampleOutput::getPos ( ) const
inline

Get the sampled position.

Returns
The coordinates of the sampled position. This is generally more accurate (and more performant) than using getObservationRay().getHead().
Note
This is only available if getPdfPos() is non-empty.

◆ operator bool()

ph::PrimitivePosSampleOutput::operator bool ( ) const
inline

Checks the validity of the sample.

Returns
true if the sample is valid. false if the sample failed. A failed sample cannot be used. A typical way to fail is that sampling is not even supported/possible.

◆ setObservationRay()

void ph::PrimitivePosSampleOutput::setObservationRay ( const Ray & observationRay)
inline

◆ setPdfDir()

void ph::PrimitivePosSampleOutput::setPdfDir ( const lta::PDF & pdfDir)
inline

◆ setPdfPos()

void ph::PrimitivePosSampleOutput::setPdfPos ( const lta::PDF & pdfPos)
inline

◆ setPos()

void ph::PrimitivePosSampleOutput::setPos ( const math::Vector3R & pos)
inline

The documentation for this class was generated from the following file: