Implements linear iterative search for a zero-crossing of the level set along along the direction of the ray.
More...
#include <RayIntersector.h>
template<typename GridT, int Iterations = 0, typename RealT = double>
class openvdb::v2_0_0::tools::LinearSearchImpl< GridT, Iterations, RealT >
Implements linear iterative search for a zero-crossing of the level set along along the direction of the ray.
- Note
- Since this class is used internally in LevelSetRayIntersector (define above) and LevelSetHDDA (defined below) client code should never interact directly with its API. This also explains why we are not concerned with the fact that several of its methods are unsafe to call unless zero-crossings were already detected.
It is approximate due to the limited number of iterations which can can be defined with a template parameter. However the default value has proven surprisingly accurate and fast. In fact more iterations are not guaranteed to give significantly better results.
- Warning
- Since this class internally stores a ValueAccessor it is NOT thread-safe, so make sure to give each thread its own instance. This of course also means that the cost of allocating an instance should (if possible) be amortized over as many ray intersections as possible.
typedef GridT::ValueType ValueT |
void getIndexPos |
( |
Vec3d & |
xyz | ) |
const |
|
inline |
Get the intersection point in index space.
- Parameters
-
xyz | The position in index space of the intersection. |
void getWorldPos |
( |
Vec3d & |
xyz | ) |
const |
|
inline |
Get the intersection point in world space.
- Parameters
-
xyz | The position in world space of the intersection. |
void getWorldPosAndNml |
( |
Vec3d & |
xyz, |
|
|
Vec3d & |
nml |
|
) |
| |
|
inline |
Get the intersection point and normal in world space.
- Parameters
-
xyz | The position in world space of the intersection. |
nml | The surface normal in world space of the intersection. |
bool setIndexRay |
( |
const RayT & |
iRay | ) |
|
|
inline |
Return false
the ray misses the bbox of the grid.
- Parameters
-
iRay | Ray represented in index space. |
- Warning
- Call this method before the ray traversal starts.
bool setWorldRay |
( |
const RayT & |
wRay | ) |
|
|
inline |
Return false
the ray misses the bbox of the grid.
- Parameters
-
wRay | Ray represented in world space. |
- Warning
- Call this method before the ray traversal starts.
The documentation for this class was generated from the following file: