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

BVH inner node. More...

#include <BVHNode.hpp>

Inherits FW::BVHNode.

Public Member Functions

 InnerNode (const AABB &bounds, BVHNode *child0, BVHNode *child1)
 Constructor. More...
 
 InnerNode (const AABB &bounds, BVHNode *child0, BVHNode *child1, S32 axis, SplitInfo::SplitType splitType, bool osahTested)
 Constructor. More...
 
bool isLeaf () const
 
S32 getNumChildNodes () const
 
BVHNodegetChildNode (S32 i) const
 Returns one of the node's child nodes. More...
 
- Public Member Functions inherited from FW::BVHNode
 BVHNode ()
 Constructor. More...
 
virtual S32 getNumTriangles () const
 
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

BVHNodem_children [2]
 Child nodes. More...
 
SplitInfo m_splitInfo
 Split info. 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 inner node.

Definition at line 228 of file BVHNode.hpp.

Constructor & Destructor Documentation

FW::InnerNode::InnerNode ( const AABB bounds,
BVHNode child0,
BVHNode child1 
)
inline

Constructor.

Parameters
[in]boundsNode's bounding box.
[in]child0Left child node.
[in]child1Right child node.

Definition at line 238 of file BVHNode.hpp.

FW::InnerNode::InnerNode ( const AABB bounds,
BVHNode child0,
BVHNode child1,
S32  axis,
SplitInfo::SplitType  splitType,
bool  osahTested 
)
inline

Constructor.

Parameters
[in]boundsNode's bounding box.
[in]child0Left child node.
[in]child1Right child node.
[in]axisAxis of the node's split.
[in]splitTypeType of the node's split.
[in]osahTestedFlag whether the split was tested for OSAH.

Definition at line 249 of file BVHNode.hpp.

Member Function Documentation

BVHNode* FW::InnerNode::getChildNode ( S32  i) 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 266 of file BVHNode.hpp.

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

Implements FW::BVHNode.

Definition at line 259 of file BVHNode.hpp.

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

Implements FW::BVHNode.

Definition at line 254 of file BVHNode.hpp.

Member Data Documentation

BVHNode* FW::InnerNode::m_children[2]

Child nodes.

Definition at line 268 of file BVHNode.hpp.

SplitInfo FW::InnerNode::m_splitInfo

Split info.

Definition at line 269 of file BVHNode.hpp.


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