This class provides the public API for intersecting a ray with a generic (e.g. density) volume.
More...
|
| VolumeRayIntersector (const GridT &grid, int dilationCount=0) |
| Grid constructor.
|
|
| VolumeRayIntersector (const GridT &grid, const math::CoordBBox &bbox) |
| Grid and BBox constructor.
|
|
| VolumeRayIntersector (const VolumeRayIntersector &other) |
| Shallow copy constructor.
|
|
| ~VolumeRayIntersector () |
| Destructor.
|
|
bool | setIndexRay (const RayT &iRay) |
| Return false if the index ray misses the bbox of the grid.
|
|
bool | setWorldRay (const RayT &wRay) |
| Return false if the world ray misses the bbox of the grid.
|
|
RayT::TimeSpan | march () |
|
bool | march (RealType &t0, RealType &t1) |
| Return true if the ray intersects active values, i.e. either active voxels or tiles. Only when a hit is detected are t0 and t1 updated with the corresponding entry and exit times along the INDEX ray!
|
|
template<typename ListType > |
void | hits (ListType &list) |
| Generates a list of hits along the ray.
|
|
Vec3R | getIndexPos (RealType time) const |
| Return the floating-point index position along the current index ray at the specified time.
|
|
Vec3R | getWorldPos (RealType time) const |
| Return the floating-point world position along the current index ray at the specified time.
|
|
RealType | getWorldTime (RealType time) const |
|
const GridT & | grid () const |
| Return a const reference to the input grid.
|
|
const TreeT & | tree () const |
| Return a const reference to the (potentially dilated) bool tree used to accelerate the ray marching.
|
|
const math::CoordBBox & | bbox () const |
| Return a const reference to the BBOX of the grid.
|
|
void | print (std::ostream &os=std::cout, int verboseLevel=1) |
| Print bbox, statistics, memory usage and other information.
|
|
template<typename GridT, int NodeLevel = GridT::TreeType::RootNodeType::ChildNodeType::LEVEL, typename RayT = math::Ray<Real>>
class openvdb::v11_0::tools::VolumeRayIntersector< GridT, NodeLevel, RayT >
This class provides the public API for intersecting a ray with a generic (e.g. density) volume.
Internally it performs the actual hierarchical tree node traversal.
- Warning
- Use the (default) copy-constructor to make sure each computational thread has their own instance of this class. This is important since it contains a ValueAccessor that is not thread-safe and a CoordBBox of the active voxels that should not be re-computed for each thread. However copying is very efficient.
- Example:
iter.setIndexRay(ray);
iter.setWorldRay(ray);
double t0=0, t1=0;
while ( inter.march(t0, t1) ) {
}}