|
Jet
v1.3.3
|
Bounding Volume Hierarchy (BVH) in 3D. More...
#include <jet/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 > | nearest (const Vector3D &pt, const NearestNeighborDistanceFunc3< T > &distanceFunc) const override |
| bool | intersects (const BoundingBox3D &box, const BoxIntersectionTestFunc3< T > &testFunc) const override |
Returns true if given box intersects with any of the stored items. More... | |
| bool | intersects (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 > | closestIntersection (const Ray3D &ray, const GetRayIntersectionFunc3< T > &testFunc) const override |
Returns the closest intersection for given ray. More... | |
| const BoundingBox3D & | boundingBox () 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 | numberOfItems () const |
| Returns the number of items. More... | |
| const T & | item (size_t i) const |
Returns the item at i. More... | |
| size_t | numberOfNodes () const |
| Returns the number of nodes. More... | |
| std::pair< size_t, size_t > | children (size_t i) const |
Returns the children indices of i-th node. More... | |
| bool | isLeaf (size_t i) const |
Returns true if i-th node is a leaf node. More... | |
| const BoundingBox3D & | nodeBound (size_t i) const |
Returns bounding box of i-th node. More... | |
| Iterator | itemOfNode (size_t i) |
Returns item of i-th node. More... | |
| ConstIterator | itemOfNode (size_t i) const |
Returns item of i-th node. More... | |
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.
| using jet::Bvh3< T >::ConstIterator = typename ContainerType::const_iterator |
| using jet::Bvh3< T >::ContainerType = std::vector<T> |
| ConstIterator jet::Bvh3< T >::begin | ( | ) | const |
Returns the immutable begin iterator of the item.
| const BoundingBox3D& jet::Bvh3< T >::boundingBox | ( | ) | const |
Returns bounding box of every items.
| void jet::Bvh3< T >::build | ( | const std::vector< T > & | items, |
| const std::vector< BoundingBox3D > & | itemsBounds | ||
| ) |
Builds bounding volume hierarchy.
| std::pair<size_t, size_t> jet::Bvh3< T >::children | ( | size_t | i | ) | const |
Returns the children indices of i-th node.
| void jet::Bvh3< T >::clear | ( | ) |
Clears all the contents of this instance.
|
overridevirtual |
Returns the closest intersection for given ray.
Implements jet::IntersectionQueryEngine3< T >.
| ConstIterator jet::Bvh3< T >::end | ( | ) | const |
Returns the immutable end iterator of the item.
|
overridevirtual |
Invokes visitorFunc for every intersecting items.
Implements jet::IntersectionQueryEngine3< T >.
|
overridevirtual |
Invokes visitorFunc for every intersecting items.
Implements jet::IntersectionQueryEngine3< T >.
|
overridevirtual |
Returns true if given box intersects with any of the stored items.
Implements jet::IntersectionQueryEngine3< T >.
|
overridevirtual |
Returns true if given ray intersects with any of the stored items.
Implements jet::IntersectionQueryEngine3< T >.
| bool jet::Bvh3< T >::isLeaf | ( | size_t | i | ) | const |
Returns true if i-th node is a leaf node.
| const T& jet::Bvh3< T >::item | ( | size_t | i | ) | const |
Returns the item at i.
| ConstIterator jet::Bvh3< T >::itemOfNode | ( | size_t | i | ) | const |
Returns item of i-th node.
|
overridevirtual |
Returns the nearest neighbor for given point and distance measure function.
Implements jet::NearestNeighborQueryEngine3< T >.
| const BoundingBox3D& jet::Bvh3< T >::nodeBound | ( | size_t | i | ) | const |
Returns bounding box of i-th node.
| size_t jet::Bvh3< T >::numberOfItems | ( | ) | const |
Returns the number of items.
| size_t jet::Bvh3< T >::numberOfNodes | ( | ) | const |
Returns the number of nodes.
1.8.18