Algorithms for various hit point adjustments. For surface escaping routines, the generated ray is not guaranteed to "actually" avoid the surface. In other words, self-intersection may still happen under different circumstances dpending on the method used.
More...
#include <SurfaceHitRefinery.h>
|
static void | init (const EngineInitSettings &settings) |
| Initialize from engine settings.
|
|
static real | selfIntersectDelta () |
| A small value for resolving self-intersections.
|
|
static std::size_t | numIterations () |
| Number of iterations to perform when escaping in iterative mode.
|
|
Algorithms for various hit point adjustments. For surface escaping routines, the generated ray is not guaranteed to "actually" avoid the surface. In other words, self-intersection may still happen under different circumstances dpending on the method used.
◆ SurfaceHitRefinery()
ph::lta::SurfaceHitRefinery::SurfaceHitRefinery |
( |
const SurfaceHit & | X | ) |
|
|
inlineexplicit |
◆ escape()
Escape this surface in a specific direction. The method to use for escaping the surface is determined by engine settings.
- Parameters
-
dir | The direction to escape. No need to be normalized. |
- Returns
- The longest ray in
dir
that avoids this surface.
◆ escapeEmpirically()
Ray ph::lta::SurfaceHitRefinery::escapeEmpirically |
( |
const math::Vector3R & | dir | ) |
const |
|
inline |
Escape this surface in a specific direction by some adaptive offset.
- Parameters
-
dir | The direction to escape. No need to be normalized. |
- Returns
- The longest ray in
dir
that avoids this surface.
◆ escapeIteratively()
Escape this surface in a specific direction by iteratively re-intersect with the surface. This variant is in general the most accurate one but is 5 % ~ 15 % more expensive than escapeManually()
.
- Parameters
-
dir | The direction to escape. No need to be normalized. |
numIters | The desired number of improvements to have on the offset. |
- Returns
- The longest ray in
dir
that avoids this surface.
◆ escapeManually()
Escape this surface in a specific direction by a small offset.
- Parameters
-
dir | The direction to escape. No need to be normalized. |
delta | The amount to offset. |
- Returns
- The longest ray in
dir
that avoids this surface.
◆ init()
Initialize from engine settings.
◆ numIterations()
std::size_t ph::lta::SurfaceHitRefinery::numIterations |
( |
| ) |
|
|
inlinestatic |
Number of iterations to perform when escaping in iterative mode.
◆ selfIntersectDelta()
real ph::lta::SurfaceHitRefinery::selfIntersectDelta |
( |
| ) |
|
|
inlinestatic |
A small value for resolving self-intersections.
◆ tryEscape()
std::optional< Ray > ph::lta::SurfaceHitRefinery::tryEscape |
( |
const SurfaceHit & | X2 | ) |
const |
|
inline |
Mutually escape from X
and X2
. The method to use for escaping the surfaces is determined by engine settings.
- Parameters
-
X2 | The other surface to escape from. |
- Returns
- The ray that avoids both surfaces.
◆ tryEscapeEmpirically()
std::optional< Ray > ph::lta::SurfaceHitRefinery::tryEscapeEmpirically |
( |
const SurfaceHit & | X2 | ) |
const |
|
inline |
Mutually escape from X
and X2
by some adaptive offset.
- Parameters
-
X2 | The other surface to escape from. |
- Returns
- The ray that avoids both surfaces.
◆ tryEscapeIteratively()
std::optional< Ray > ph::lta::SurfaceHitRefinery::tryEscapeIteratively |
( |
const SurfaceHit & | X2, |
|
|
std::size_t | numIters = numIterations() ) const |
|
inline |
Mutually escape from X
and X2
by iteratively re-intersect with the surfaces.
- Parameters
-
X2 | The other surface to escape from. |
numIters | The desired number of improvements to have on the offset. |
- Returns
- The ray that avoids both surfaces.
◆ tryEscapeManually()
Mutually escape from X
and X2
by a small offset.
- Parameters
-
X2 | The other surface to escape from. |
delta | The amount to offset. |
- Returns
- The ray that avoids both surfaces.
The documentation for this class was generated from the following files: