Bounding Volume Hierarchy (BVH) in 3D. More...
#include <Core/Geometry/BVH3.h>
Public Types | |
using | ContainerType = std::vector< T > |
using | Iterator = typename ContainerType::iterator |
using | ConstIterator = typename ContainerType::const_iterator |
Public Member Functions | |
BVH3 () | |
Default constructor. More... | |
void | Build (const std::vector< T > &items, const std::vector< BoundingBox3D > &itemsBounds) |
Builds bounding volume hierarchy. More... | |
void | Clear () |
Clears all the contents of this instance. More... | |
NearestNeighborQueryResult3< T > | GetNearestNeighbor (const Vector3D &pt, const NearestNeighborDistanceFunc3< T > &distanceFunc) const override |
bool | IsIntersects (const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc) const override |
Returns true if given box intersects with any of the stored items. More... | |
bool | IsIntersects (const Ray3D &ray, const RayIntersectionTestFunc3< T > &testFunc) const override |
Returns true if given ray intersects with any of the stored items. More... | |
void | ForEachIntersectingItem (const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc, const IntersectionVisitorFunc3< T > &visitorFunc) const override |
Invokes visitorFunc for every intersecting items. More... | |
void | ForEachIntersectingItem (const Ray3D &ray, const RayIntersectionTestFunc3< T > &testFunc, const IntersectionVisitorFunc3< T > &visitorFunc) const override |
Invokes visitorFunc for every intersecting items. More... | |
ClosestIntersectionQueryResult3< T > | GetClosestIntersection (const Ray3D &ray, const GetRayIntersectionFunc3< T > &testFunc) const override |
Returns the closest intersection for given ray . More... | |
const BoundingBox3D & | GetBoundingBox () const |
Returns bounding box of every items. More... | |
Iterator | begin () |
Returns the begin iterator of the item. More... | |
Iterator | end () |
Returns the end iterator of the item. More... | |
ConstIterator | begin () const |
Returns the immutable begin iterator of the item. More... | |
ConstIterator | end () const |
Returns the immutable end iterator of the item. More... | |
size_t | GetNumberOfItems () const |
Returns the number of items. More... | |
const T & | GetItem (size_t i) const |
Returns the item at i . More... | |
Detailed Description
template<typename T>
class CubbyFlow::BVH3< T >
Bounding Volume Hierarchy (BVH) in 3D.
This class implements the classic bounding volume hierarchy structure in 3D. It implements IntersectionQueryEngine3 in order to support box/ray intersection tests. Also, NearestNeighborQueryEngine3 is implemented to provide nearest neighbor query.
Member Typedef Documentation
◆ ConstIterator
using CubbyFlow::BVH3< T >::ConstIterator = typename ContainerType::const_iterator |
◆ ContainerType
using CubbyFlow::BVH3< T >::ContainerType = std::vector<T> |
◆ Iterator
using CubbyFlow::BVH3< T >::Iterator = typename ContainerType::iterator |
Constructor & Destructor Documentation
◆ BVH3()
CubbyFlow::BVH3< T >::BVH3 | ( | ) |
Default constructor.
Member Function Documentation
◆ begin() [1/2]
BVH3< T >::Iterator CubbyFlow::BVH3< T >::begin | ( | ) |
Returns the begin iterator of the item.
◆ begin() [2/2]
BVH3< T >::ConstIterator CubbyFlow::BVH3< T >::begin | ( | ) | const |
Returns the immutable begin iterator of the item.
◆ Build()
void CubbyFlow::BVH3< T >::Build | ( | const std::vector< T > & | items, |
const std::vector< BoundingBox3D > & | itemsBounds | ||
) |
Builds bounding volume hierarchy.
◆ Clear()
void CubbyFlow::BVH3< T >::Clear | ( | ) |
Clears all the contents of this instance.
◆ end() [1/2]
BVH3< T >::Iterator CubbyFlow::BVH3< T >::end | ( | ) |
Returns the end iterator of the item.
◆ end() [2/2]
BVH3< T >::ConstIterator CubbyFlow::BVH3< T >::end | ( | ) | const |
Returns the immutable end iterator of the item.
◆ ForEachIntersectingItem() [1/2]
|
inlineoverridevirtual |
Invokes visitorFunc
for every intersecting items.
Implements CubbyFlow::IntersectionQueryEngine3< T >.
◆ ForEachIntersectingItem() [2/2]
|
inlineoverridevirtual |
Invokes visitorFunc
for every intersecting items.
Implements CubbyFlow::IntersectionQueryEngine3< T >.
◆ GetBoundingBox()
const BoundingBox3D & CubbyFlow::BVH3< T >::GetBoundingBox | ( | ) | const |
Returns bounding box of every items.
◆ GetClosestIntersection()
|
inlineoverridevirtual |
Returns the closest intersection for given ray
.
Implements CubbyFlow::IntersectionQueryEngine3< T >.
◆ GetItem()
const T & CubbyFlow::BVH3< T >::GetItem | ( | size_t | i | ) | const |
Returns the item at i
.
◆ GetNearestNeighbor()
|
inlineoverridevirtual |
Returns the nearest neighbor for given point and distance measure function.
Implements CubbyFlow::NearestNeighborQueryEngine3< T >.
◆ GetNumberOfItems()
size_t CubbyFlow::BVH3< T >::GetNumberOfItems | ( | ) | const |
Returns the number of items.
◆ IsIntersects() [1/2]
|
inlineoverridevirtual |
Returns true if given box
intersects with any of the stored items.
Implements CubbyFlow::IntersectionQueryEngine3< T >.
◆ IsIntersects() [2/2]
|
inlineoverridevirtual |
Returns true if given ray
intersects with any of the stored items.
Implements CubbyFlow::IntersectionQueryEngine3< T >.
The documentation for this class was generated from the following files:
- Core/Geometry/BVH3.h
- Core/Geometry/BVH3-Impl.h