Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::math::TBvhBuilder< N, Item, ItemToAABB > Class Template Referencefinal

#include <TBvhBuilder.h>

Public Types

using InfoNodeType = TBvhInfoNode<N, Item>
 
using ItemInfoType = TBvhItemInfo<Item>
 

Public Member Functions

 TBvhBuilder (BvhParams params=BvhParams{})
 
 TBvhBuilder (ItemToAABB itemToAABB, BvhParams params=BvhParams{})
 
auto buildInformativeBvh (TSpanView< Item > items) -> const InfoNodeType *
 Build a BVH that contains additional information useful for many purposes. The built BVH has the following properties:
 
void clearBuildData ()
 
auto totalInfoNodes () const -> std::size_t
 
auto totalItems () const -> std::size_t
 

Static Public Member Functions

static std::size_t calcTotalNodes (const InfoNodeType *node)
 
static std::size_t calcTotalItems (const InfoNodeType *node)
 
static std::size_t calcMaxDepth (const InfoNodeType *node)
 

Member Typedef Documentation

◆ InfoNodeType

template<std::size_t N, typename Item , typename ItemToAABB >
using ph::math::TBvhBuilder< N, Item, ItemToAABB >::InfoNodeType = TBvhInfoNode<N, Item>

◆ ItemInfoType

template<std::size_t N, typename Item , typename ItemToAABB >
using ph::math::TBvhBuilder< N, Item, ItemToAABB >::ItemInfoType = TBvhItemInfo<Item>

Constructor & Destructor Documentation

◆ TBvhBuilder() [1/2]

template<std::size_t N, typename Item , typename ItemToAABB >
ph::math::TBvhBuilder< N, Item, ItemToAABB >::TBvhBuilder ( BvhParams params = BvhParams{})
inlineexplicit

◆ TBvhBuilder() [2/2]

template<std::size_t N, typename Item , typename ItemToAABB >
ph::math::TBvhBuilder< N, Item, ItemToAABB >::TBvhBuilder ( ItemToAABB itemToAABB,
BvhParams params = BvhParams{} )
inlineexplicit

Member Function Documentation

◆ buildInformativeBvh()

template<std::size_t N, typename Item , typename ItemToAABB >
auto ph::math::TBvhBuilder< N, Item, ItemToAABB >::buildInformativeBvh ( TSpanView< Item > items) -> const InfoNodeType*
inline

Build a BVH that contains additional information useful for many purposes. The built BVH has the following properties:

  • Maximum items: The maximum number of items a leaf node can contain. This value can be set by BvhParams.
  • Branch factor: The maximum number of children each node can have is N.
  • Split axis: The axis of the offset between children. The split axis associated with child i is for the axis of offset between child i and child i + 1.
  • Split method: How the split axis and its offset value is chosen. This can be set by BvhParams.
    Returns
    The root node of the built BVH. Memory of the BVH is managed by this builder.
    Note
    This method will clear any previous build data.

◆ calcMaxDepth()

template<std::size_t N, typename Item , typename ItemToAABB >
std::size_t ph::math::TBvhBuilder< N, Item, ItemToAABB >::calcMaxDepth ( const InfoNodeType * node)
inlinestatic

◆ calcTotalItems()

template<std::size_t N, typename Item , typename ItemToAABB >
std::size_t ph::math::TBvhBuilder< N, Item, ItemToAABB >::calcTotalItems ( const InfoNodeType * node)
inlinestatic

◆ calcTotalNodes()

template<std::size_t N, typename Item , typename ItemToAABB >
std::size_t ph::math::TBvhBuilder< N, Item, ItemToAABB >::calcTotalNodes ( const InfoNodeType * node)
inlinestatic

◆ clearBuildData()

template<std::size_t N, typename Item , typename ItemToAABB >
void ph::math::TBvhBuilder< N, Item, ItemToAABB >::clearBuildData ( )
inline

◆ totalInfoNodes()

template<std::size_t N, typename Item , typename ItemToAABB >
auto ph::math::TBvhBuilder< N, Item, ItemToAABB >::totalInfoNodes ( ) const -> std::size_t
inline
Returns
Number of nodes of the most recent BVH built by this builder.

◆ totalItems()

template<std::size_t N, typename Item , typename ItemToAABB >
auto ph::math::TBvhBuilder< N, Item, ItemToAABB >::totalItems ( ) const -> std::size_t
inline
Returns
Number of contained items of the most recent BVH built by this builder.

The documentation for this class was generated from the following files: