NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::KDTree Class Reference

K-d tree acceleration structure class. More...

#include <KDTree.hpp>

Classes

struct  BuildParams
 Strucure holding build parameters. More...
 
struct  Stats
 Structure holding statistics about k-d tree. More...
 

Public Types

enum  BuilderType { SpatialMedian, ObjectMedian, SAH }
 Supported k-d tree builder types. More...
 

Public Member Functions

 KDTree (Scene *scene, const Platform &platform, const BuildParams &params)
 Constructor. More...
 
 ~KDTree (void)
 Destructor. More...
 
ScenegetScene (void) const
 Gets source scene of the k-d tree. More...
 
const PlatformgetPlatform (void) const
 Gets platform settings of the k-d tree. More...
 
KDTreeNodegetRoot (void) const
 Gets root node of the k-d tree. More...
 
Array< S32 > & getTriIndices (void)
 Returns an array of triangle indices to which leaf nodes are pointig. These indices point to scene's triangle array. More...
 
const Array< S32 > & getTriIndices (void) const
 Returns an array of triangle indices reffered to by the leaf nodes. These indices point to the scene's triangle array. More...
 

Detailed Description

K-d tree acceleration structure class.

Definition at line 41 of file KDTree.hpp.

Member Enumeration Documentation

Supported k-d tree builder types.

Enumerator
SpatialMedian 
ObjectMedian 
SAH 

Definition at line 47 of file KDTree.hpp.

Constructor & Destructor Documentation

FW::KDTree::KDTree ( Scene scene,
const Platform platform,
const BuildParams params 
)

Constructor.

Parameters
[in]sceneSource scene.
[in]platformPlatform settings.
[in]paramsBuild parameters.

Definition at line 35 of file KDTree.cpp.

FW::KDTree::~KDTree ( void  )
inline

Destructor.

Definition at line 113 of file KDTree.hpp.

Member Function Documentation

const Platform& FW::KDTree::getPlatform ( void  ) const
inline

Gets platform settings of the k-d tree.

Platform settings.

Definition at line 125 of file KDTree.hpp.

KDTreeNode* FW::KDTree::getRoot ( void  ) const
inline

Gets root node of the k-d tree.

Returns
K-d tree's root node.

Definition at line 131 of file KDTree.hpp.

Scene* FW::KDTree::getScene ( void  ) const
inline

Gets source scene of the k-d tree.

Returns
Source scene.

Definition at line 119 of file KDTree.hpp.

Array<S32>& FW::KDTree::getTriIndices ( void  )
inline

Returns an array of triangle indices to which leaf nodes are pointig. These indices point to scene's triangle array.

Returns
Array of triangle indices.

Definition at line 137 of file KDTree.hpp.

const Array<S32>& FW::KDTree::getTriIndices ( void  ) const
inline

Returns an array of triangle indices reffered to by the leaf nodes. These indices point to the scene's triangle array.

Returns
Array of triangle indices.

Definition at line 143 of file KDTree.hpp.


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