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

BVH leaf node. More...

#include <BVHNode.hpp>

Inherits FW::BVHNode.

Public Member Functions

 LeafNode (const AABB &bounds, int lo, int hi)
 Constructor. More...
 
 LeafNode (const LeafNode &s)
 Copy constructor. More...
 
bool isLeaf () const
 
S32 getNumChildNodes () const
 
BVHNodegetChildNode (S32) const
 Returns one of the node's child nodes. More...
 
S32 getNumTriangles () const
 
- Public Member Functions inherited from FW::BVHNode
 BVHNode ()
 Constructor. More...
 
float getArea () const
 
int getSubtreeSize (BVH_STAT stat=BVH_STAT_NODE_COUNT) const
 Calculates various information about the node's subtree. More...
 
void computeSubtreeProbabilities (const Platform &p, float parentProbability, float &sah)
 Calculates node's subtree probabilities and also sah price. More...
 
float computeSubtreeSAHCost (const Platform &p) const
 Calculates subtree SAH cost. Requires calculated probabilities. More...
 
void deleteSubtree ()
 Deletes node's subtree. More...
 
void assignIndicesDepthFirst (S32 index=0, bool includeLeafNodes=true)
 Assigns node's sbutree indices in depth first order. More...
 
void assignIndicesBreadthFirst (S32 index=0, bool includeLeafNodes=true)
 Assigns node's subtree indices in breadth first order. More...
 

Public Attributes

S32 m_lo
 Lower index to the BVH's triangle index array. More...
 
S32 m_hi
 Higher index to the BVH's triangle index array. More...
 
- Public Attributes inherited from FW::BVHNode
AABB m_bounds
 Bounding box of the node. More...
 
float m_probability
 Probability of coming here (widebvh uses this). More...
 
float m_parentProbability
 Probability of coming to parent (widebvh uses this). More...
 
int m_treelet
 For queuing tests (qmachine uses this). More...
 
int m_index
 in linearized tree (qmachine uses this). More...
 

Detailed Description

BVH leaf node.

Definition at line 275 of file BVHNode.hpp.

Constructor & Destructor Documentation

FW::LeafNode::LeafNode ( const AABB bounds,
int  lo,
int  hi 
)
inline

Constructor.

Parameters
[in]boundsNode's bounding box.
[in]loLower index to the BVH's triangle index array.
[in]hiHigher index to the BVH's triangle index array.

Definition at line 285 of file BVHNode.hpp.

FW::LeafNode::LeafNode ( const LeafNode s)
inline

Copy constructor.

Parameters
[in]sLeaf node to copy.

Definition at line 291 of file BVHNode.hpp.

Member Function Documentation

BVHNode* FW::LeafNode::getChildNode ( S32  ) const
inlinevirtual

Returns one of the node's child nodes.

Parameters
[in]iIndex of the child node.
Returns
Node's selected child node.

Implements FW::BVHNode.

Definition at line 308 of file BVHNode.hpp.

S32 FW::LeafNode::getNumChildNodes ( ) const
inlinevirtual
Returns
Number of the node's child nodes.

Implements FW::BVHNode.

Definition at line 301 of file BVHNode.hpp.

S32 FW::LeafNode::getNumTriangles ( ) const
inlinevirtual
Returns
Number of node's triangles.

Reimplemented from FW::BVHNode.

Definition at line 313 of file BVHNode.hpp.

bool FW::LeafNode::isLeaf ( ) const
inlinevirtual
Returns
Whether the node is a leaf node (always true).

Implements FW::BVHNode.

Definition at line 296 of file BVHNode.hpp.

Member Data Documentation

S32 FW::LeafNode::m_hi

Higher index to the BVH's triangle index array.

Definition at line 315 of file BVHNode.hpp.

S32 FW::LeafNode::m_lo

Lower index to the BVH's triangle index array.

Definition at line 314 of file BVHNode.hpp.


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