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

BVH acceleration structure class. More...

#include <BVH.hpp>

Inherits FW::AccelerationStructure.

Classes

struct  BuildParams
 Stucture holding the BVH build parameters. More...
 
struct  Stats
 Sturcture for holding statistics about the BVH. More...
 

Public Member Functions

 BVH (Scene *scene, const Platform &platform, const BuildParams &params, Environment *env)
 Constructor. More...
 
 ~BVH (void)
 Destructor. More...
 
BVHNodegetRoot (void) const
 Returns root node of the BVH. More...
 
void trace (RayBuffer &rays, RayStats *stats=NULL) const
 CPU traversal. 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 to which leaf nodes are pointig. These indices point to scene's triangle array. More...
 
- Public Member Functions inherited from FW::AccelerationStructure
 AccelerationStructure (Scene *scene, const Platform &platform)
 
virtual ~AccelerationStructure ()
 
ScenegetScene (void) const
 
const PlatformgetPlatform (void) const
 

Additional Inherited Members

- Protected Attributes inherited from FW::AccelerationStructure
Scenem_scene
 
Platform m_platform
 

Detailed Description

BVH acceleration structure class.

Holds a BVH acceleration structure and also provides method for its CPU traversal.

Definition at line 74 of file BVH.hpp.

Constructor & Destructor Documentation

BVH::BVH ( Scene scene,
const Platform platform,
const BuildParams params,
Environment env 
)

Constructor.

Parameters
[in]sceneSource scene for the BVH.
[in]platformPlatform settings.
[in]paramsBuild parameters.

Definition at line 36 of file BVH.cpp.

FW::BVH::~BVH ( void  )
inline

Destructor.

Definition at line 161 of file BVH.hpp.

Member Function Documentation

BVHNode* FW::BVH::getRoot ( void  ) const
inline

Returns root node of the BVH.

Returns
Root node of the BVH.

Definition at line 167 of file BVH.hpp.

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

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

Returns
Buffer of triangle indices.

Definition at line 180 of file BVH.hpp.

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

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

Returns
Buffer of triangle indices.

Definition at line 186 of file BVH.hpp.

void BVH::trace ( RayBuffer rays,
RayStats stats = NULL 
) const

CPU traversal.

Parameters
[out]raysBuffer of rays that will be traced.
[out]statsRay statistics collected during the traversal. Leave blank if no stats should be collected.

Definition at line 82 of file BVH.cpp.


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