* @brief An abstraction class for the huge, but well reusable parts of a BVH. Included are a construction algorithm based on the binned SAH split, as well as a stackless traversal method.
*/
template<typenameTPrimitive>
classBVH
{
public:
structNode
{
enumclassType
{
eInner=0,
eLeaf=1
};
structbvh_node_t
{
math::Boundsbounds;
BVHNodeTypetype;
Typetype;
//Children, can be either child nodes or array start- and end indices.
uint32_tleft_idx;
...
...
@@ -32,7 +41,7 @@ namespace glare
uint32_tparent;
};
structindex_range_t
structIndexRange
{
uint32_tstart;
uint32_tend;
...
...
@@ -43,19 +52,12 @@ namespace glare
/**
* Bins are used in the split(...) method of the MeshBVH for the Binned SAH Split algorithm.
*/
structbin_t
structBin
{
math::Boundsbounds;
intobject_count;
};
/**
* @brief An abstraction class for the huge, but well reusable parts of a BVH. Included are a construction algorithm based on the binned SAH split, as well as a stackless traversal method.
*/
template<typenameTPrimitive>
classBVH
{
public:
BVH(){};
~BVH(){};
...
...
@@ -65,7 +67,7 @@ namespace glare
* @param centroid_from_id A function that should return a centroid coordinate for the parameter id (referring to the index in the primitive list).
* @param node_from_range A function that builds a bvh_node_t containing all primitives from index "start" to index "end".