43 using std::unique_ptr;
60 template<
typename BaseVecT>
71 BVHTree(
const vector<float>& vertices,
const vector<uint32_t>& faces);
77 const floatArr vertices,
size_t n_vertices,
159 virtual bool isLeaf() = 0;
213 const floatArr vertices,
size_t n_vertices,
249 #include "lvr2/geometry/BVH.tcc" BoundingBox< BaseVecT > bb
vector< uint32_t > m_indexesOrTrilists
const vector< float > & getLimits() const
BVHNodePtr buildTree(const vector< float > &vertices, const vector< uint32_t > &faces)
Builds the tree without it's cache friendly representation. Utilizes the buildTreeRecursive method...
std::shared_ptr< MeshBuffer > MeshBufferPtr
void createCFTree()
Creates the cache friendly representation of the tree. Needs the tree itself!
const vector< uint32_t > & getTriIndexList() const
unique_ptr< BVHNode > BVHNodePtr
vector< float > m_trianglesIntersectionData
unique_ptr< BVHLeaf > BVHLeafPtr
unique_ptr< BVHInner > BVHInnerPtr
Implementation of an Bounding Volume Hierarchy Tree used for ray casting.
A dynamic bounding box class.
const vector< float > & getTrianglesIntersectionData() const
Returns precalculated values for the triangle intersection tests.
const vector< uint32_t > & getIndexesOrTrilists() const
BVHTree(const vector< float > &vertices, const vector< uint32_t > &faces)
Constructs the tree itself and it's cache friendly representation.
vector< size_t > triangles
BoundingBox< BaseVecT > bb
boost::shared_array< unsigned int > indexArray
void convertTrianglesIntersectionData()
Converts the precalculated triangle intersection data to a SIMD friendly structure.
boost::shared_array< float > floatArr
BoundingBox< BaseVecT > bb
vector< size_t > triangles
vector< Triangle > m_triangles
void createCFTreeRecursive(BVHNodePtr currentNode, uint32_t &idxBoxes)
Recursive method for cache friendly tree creation.
BVHNodePtr buildTreeRecursive(vector< AABB > &work, uint32_t depth=0)
Recursive method to build the tree.
vector< uint32_t > m_triIndexList