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>
Lightweight ray intersection testing and reporting object. If an intersection is found, a detailed report can be obtained from the stored information.
◆ 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.
◆ 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()
- 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
-
ray | The different ray to use for intersection test. |
probe | The probe to record the intersection. |
srcRay | The 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: