HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDK_Sample::UT Namespace Reference

Classes

struct  Box
 
class  BVH
 
struct  ut_BoxCentre
 
struct  ut_BoxCentre< UT_FixedVector< T, NAXES > >
 
struct  ut_BoxCentre< UT_Vector2T< T > >
 
struct  ut_BoxCentre< UT_Vector3T< T > >
 
struct  ut_BoxCentre< UT_Vector4T< T > >
 

Enumerations

enum  BVH_Heuristic {
  BVH_Heuristic::BOX_PERIMETER, BVH_Heuristic::BOX_AREA, BVH_Heuristic::BOX_VOLUME, BVH_Heuristic::BOX_RADIUS,
  BVH_Heuristic::BOX_RADIUS2, BVH_Heuristic::BOX_RADIUS3, BVH_Heuristic::MEDIAN_MAX_AXIS
}
 

Functions

template<typename T , uint NAXES>
SYS_FORCE_INLINE bool utBoxExclude (const UT::Box< T, NAXES > &box) noexcept
 
template<uint NAXES>
SYS_FORCE_INLINE bool utBoxExclude (const UT::Box< fpreal32, NAXES > &box) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINEutBoxCenter (const UT::Box< T, NAXES > &box, uint axis) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINEutBoxExclude (const UT_FixedVector< T, NAXES > &position) noexcept
 
template<uint NAXES>
SYS_FORCE_INLINE bool utBoxExclude (const UT_FixedVector< fpreal32, NAXES > &position) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINEutBoxCenter (const UT_FixedVector< T, NAXES > &position, uint axis) noexcept
 
template<typename T >
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector2T< T > &position) noexcept
 
template<typename T >
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector3T< T > &position) noexcept
 
template<typename T >
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector4T< T > &position) noexcept
 
template<>
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector2T< fpreal32 > &position) noexcept
 
template<>
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector3T< fpreal32 > &position) noexcept
 
template<>
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector4T< fpreal32 > &position) noexcept
 
template<typename T >
SYS_FORCE_INLINEutBoxCenter (const UT_Vector2T< T > &position, uint axis) noexcept
 
template<typename T >
SYS_FORCE_INLINEutBoxCenter (const UT_Vector3T< T > &position, uint axis) noexcept
 
template<typename T >
SYS_FORCE_INLINEutBoxCenter (const UT_Vector4T< T > &position, uint axis) noexcept
 
template<typename BOX_TYPE , typename SRC_INT_TYPE , typename INT_TYPE >
INT_TYPE utExcludeNaNInfBoxIndices (const BOX_TYPE *boxes, SRC_INT_TYPE *indices, INT_TYPE &nboxes) noexcept
 

Enumeration Type Documentation

Used by BVH::init to specify the heuristic to use for choosing between different box splits. I tried putting this inside the BVH class, but I had difficulty getting it to compile.

Enumerator
BOX_PERIMETER 

Tries to minimize the sum of axis lengths of the boxes. This is useful for applications where the probability of a box being applicable to a query is proportional to the "length", e.g. the probability of a random infinite plane intersecting the box.

BOX_AREA 

Tries to minimize the "surface area" of the boxes. In 3D, uses the surface area; in 2D, uses the perimeter; in 1D, uses the axis length. This is what most applications, e.g. ray tracing, should use, particularly when the probability of a box being applicable to a query is proportional to the surface "area", e.g. the probability of a random ray hitting the box.

NOTE: USE THIS ONE IF YOU ARE UNSURE!

BOX_VOLUME 

Tries to minimize the "volume" of the boxes. Uses the product of all axis lengths as a heuristic, (volume in 3D, area in 2D, length in 1D). This is useful for applications where the probability of a box being applicable to a query is proportional to the "volume", e.g. the probability of a random point being inside the box.

BOX_RADIUS 

Tries to minimize the "radii" of the boxes (i.e. the distance from the centre to a corner). This is useful for applications where the probability of a box being applicable to a query is proportional to the distance to the box centre, e.g. the probability of a random infinite plane being within the "radius" of the centre.

BOX_RADIUS2 

Tries to minimize the squared "radii" of the boxes (i.e. the squared distance from the centre to a corner). This is useful for applications where the probability of a box being applicable to a query is proportional to the squared distance to the box centre, e.g. the probability of a random ray passing within the "radius" of the centre.

BOX_RADIUS3 

Tries to minimize the cubed "radii" of the boxes (i.e. the cubed distance from the centre to a corner). This is useful for applications where the probability of a box being applicable to a query is proportional to the cubed distance to the box centre, e.g. the probability of a random point being within the "radius" of the centre.

MEDIAN_MAX_AXIS 

Tries to minimize the depth of the tree by primarily splitting at the median of the max axis. It may fall back to minimizing the area, but the tree depth should be unaffected.

FIXME: This is not fully implemented yet.

Definition at line 329 of file UT_BVH.h.

Function Documentation

template<typename T , uint NAXES>
SYS_FORCE_INLINE T HDK_Sample::UT::utBoxCenter ( const UT::Box< T, NAXES > &  box,
uint  axis 
)
noexcept

Definition at line 76 of file UT_BVHImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE T HDK_Sample::UT::utBoxCenter ( const UT_FixedVector< T, NAXES > &  position,
uint  axis 
)
noexcept

Definition at line 101 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE T HDK_Sample::UT::utBoxCenter ( const UT_Vector2T< T > &  position,
uint  axis 
)
noexcept

Definition at line 148 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE T HDK_Sample::UT::utBoxCenter ( const UT_Vector3T< T > &  position,
uint  axis 
)
noexcept

Definition at line 152 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE T HDK_Sample::UT::utBoxCenter ( const UT_Vector4T< T > &  position,
uint  axis 
)
noexcept

Definition at line 156 of file UT_BVHImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT::Box< T, NAXES > &  box)
noexcept

Definition at line 52 of file UT_BVHImpl.h.

template<uint NAXES>
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT::Box< fpreal32, NAXES > &  box)
noexcept

Definition at line 63 of file UT_BVHImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE T HDK_Sample::UT::utBoxExclude ( const UT_FixedVector< T, NAXES > &  position)
noexcept

Definition at line 85 of file UT_BVHImpl.h.

template<uint NAXES>
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_FixedVector< fpreal32, NAXES > &  position)
noexcept

Definition at line 92 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_Vector2T< T > &  position)
noexcept

Definition at line 109 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_Vector3T< T > &  position)
noexcept

Definition at line 113 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_Vector4T< T > &  position)
noexcept

Definition at line 117 of file UT_BVHImpl.h.

template<>
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_Vector2T< fpreal32 > &  position)
noexcept

Definition at line 121 of file UT_BVHImpl.h.

template<>
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_Vector3T< fpreal32 > &  position)
noexcept

Definition at line 129 of file UT_BVHImpl.h.

template<>
SYS_FORCE_INLINE bool HDK_Sample::UT::utBoxExclude ( const UT_Vector4T< fpreal32 > &  position)
noexcept

Definition at line 138 of file UT_BVHImpl.h.

template<typename BOX_TYPE , typename SRC_INT_TYPE , typename INT_TYPE >
INT_TYPE HDK_Sample::UT::utExcludeNaNInfBoxIndices ( const BOX_TYPE *  boxes,
SRC_INT_TYPE *  indices,
INT_TYPE &  nboxes 
)
noexcept

Definition at line 173 of file UT_BVHImpl.h.