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

Lightweight ray intersection testing and reporting object. If an intersection is found, a detailed report can be obtained from the stored information. More...

#include <HitProbe.h>

Public Member Functions

 HitProbe ()
 
void calcHitDetail (const Ray &ray, HitDetail *out_detail) const
 Calculates basic hit information using this probe. The information is calculated using a copy of the current state of this probe.
 
void calcFullHitDetail (const Ray &ray, HitDetail *out_detail) const
 Calculates full hit information using this probe. The information is calculated using a copy of the current state of this probe.
 
bool reintersect (const Ray &ray, HitProbe &probe, const Ray &srcRay) const
 Intersect the intersected object again with a different ray. The operation is done using a copy of the current state of this probe.
 
bool isOnDefaultChannel () const
 
void pushIntermediateHit (const Intersectable *hitTarget)
 Adds a hit target that will participate in hit detail's calculation to the stack.
 
void pushBaseHit (const Intersectable *hitTarget, real hitRayT)
 Adds the first hit target to the stack. Similar to pushIntermediateHit(), except the parametric hit distance hitRayT must also be reported.
 
void popHit ()
 Removes the most recent hit target from the stack.
 
void replaceTopHit (const Intersectable *newTopHit)
 
void replaceBaseHitRayT (real newHitRayT)
 
void setChannel (uint8 channel)
 
uint8 getChannel () const
 
const IntersectablegetTopHit () const
 
real getHitRayT () const
 
template<typename T >
void pushCache (const T &data)
 
template<typename T >
popCache ()
 

Detailed Description

Lightweight ray intersection testing and reporting object. If an intersection is found, a detailed report can be obtained from the stored information.

Constructor & Destructor Documentation

◆ HitProbe()

ph::HitProbe::HitProbe ( )
inline

Creates an empty probe object and makes it ready for probing. To clear a used probe, assign an empty probe to it.

Member Function Documentation

◆ calcFullHitDetail()

void ph::HitProbe::calcFullHitDetail ( const Ray & ray,
HitDetail * out_detail ) const

Calculates full hit information using this probe. The information is calculated using a copy of the current state of this probe.

◆ calcHitDetail()

void ph::HitProbe::calcHitDetail ( const Ray & ray,
HitDetail * out_detail ) const

Calculates basic hit information using this probe. The information is calculated using a copy of the current state of this probe.

◆ getChannel()

uint8 ph::HitProbe::getChannel ( ) const
inline

◆ getHitRayT()

real ph::HitProbe::getHitRayT ( ) const
inline

◆ getTopHit()

const Intersectable * ph::HitProbe::getTopHit ( ) const
inline
Returns
Most recent hit target on the stack. May be nullptr if the probe is empty.

◆ isOnDefaultChannel()

bool ph::HitProbe::isOnDefaultChannel ( ) const

◆ popCache()

template<typename T >
T ph::HitProbe::popCache ( )
inline

◆ popHit()

void ph::HitProbe::popHit ( )
inline

Removes the most recent hit target from the stack.

◆ pushBaseHit()

void ph::HitProbe::pushBaseHit ( const Intersectable * hitTarget,
real hitRayT )
inline

Adds the first hit target to the stack. Similar to pushIntermediateHit(), except the parametric hit distance hitRayT must also be reported.

◆ pushCache()

template<typename T >
void ph::HitProbe::pushCache ( const T & data)
inline

◆ pushIntermediateHit()

void ph::HitProbe::pushIntermediateHit ( const Intersectable * hitTarget)
inline

Adds a hit target that will participate in hit detail's calculation to the stack.

◆ reintersect()

bool ph::HitProbe::reintersect ( const Ray & ray,
HitProbe & probe,
const Ray & srcRay ) const

Intersect the intersected object again with a different ray. The operation is done using a copy of the current state of this probe.

Parameters
rayThe different ray to use for intersection test.
probeThe probe to record the intersection.
srcRayThe ray from a previous hit event (associated with this probe).
Note
Generates hit event (with ray and probe).

◆ replaceBaseHitRayT()

void ph::HitProbe::replaceBaseHitRayT ( real newHitRayT)
inline

◆ replaceTopHit()

void ph::HitProbe::replaceTopHit ( const Intersectable * newTopHit)
inline

◆ setChannel()

void ph::HitProbe::setChannel ( uint8 channel)
inline

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