Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
AABBTreeBuilder::Node Class Reference

A node in the tree, contains the AABox for the tree and any child nodes or triangles. More...

#include <AABBTreeBuilder.h>

Inheritance diagram for AABBTreeBuilder::Node:
NonCopyable

Public Member Functions

JPH_OVERRIDE_NEW_DELETE Node ()
 Constructor. More...
 
 ~Node ()
 
uint GetTriangleCount () const
 Get number of triangles in this node. More...
 
bool HasChildren () const
 Check if this node has any children. More...
 
uint GetMinDepth () const
 Min depth of tree. More...
 
uint GetMaxDepth () const
 Max depth of tree. More...
 
uint GetNodeCount () const
 Number of nodes in tree. More...
 
uint GetLeafNodeCount () const
 Number of leaf nodes in tree. More...
 
uint GetTriangleCountInTree () const
 Get triangle count in tree. More...
 
void GetTriangleCountPerNode (float &outAverage, uint &outMin, uint &outMax) const
 Calculate min and max triangles per node. More...
 
float CalculateSAHCost (float inCostTraversal, float inCostLeaf) const
 Calculate the total cost of the tree using the surface area heuristic. More...
 
void GetNChildren (uint inN, Array< const Node * > &outChildren) const
 Recursively get children (breadth first) to get in total inN children (or less if there are no more) More...
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Public Attributes

AABox mBounds
 Bounding box. More...
 
IndexedTriangleList mTriangles
 Triangles (if no child nodes) More...
 
NodemChild [2]
 Child nodes (if no triangles) More...
 

Friends

class AABBTreeBuilder
 

Detailed Description

A node in the tree, contains the AABox for the tree and any child nodes or triangles.

Constructor & Destructor Documentation

◆ Node()

JPH_NAMESPACE_BEGIN AABBTreeBuilder::Node::Node ( )

Constructor.

◆ ~Node()

AABBTreeBuilder::Node::~Node ( )

Member Function Documentation

◆ CalculateSAHCost()

float AABBTreeBuilder::Node::CalculateSAHCost ( float  inCostTraversal,
float  inCostLeaf 
) const

Calculate the total cost of the tree using the surface area heuristic.

◆ GetLeafNodeCount()

uint AABBTreeBuilder::Node::GetLeafNodeCount ( ) const

Number of leaf nodes in tree.

◆ GetMaxDepth()

uint AABBTreeBuilder::Node::GetMaxDepth ( ) const

Max depth of tree.

◆ GetMinDepth()

uint AABBTreeBuilder::Node::GetMinDepth ( ) const

Min depth of tree.

◆ GetNChildren()

void AABBTreeBuilder::Node::GetNChildren ( uint  inN,
Array< const Node * > &  outChildren 
) const

Recursively get children (breadth first) to get in total inN children (or less if there are no more)

◆ GetNodeCount()

uint AABBTreeBuilder::Node::GetNodeCount ( ) const

Number of nodes in tree.

◆ GetTriangleCount()

uint AABBTreeBuilder::Node::GetTriangleCount ( ) const
inline

Get number of triangles in this node.

◆ GetTriangleCountInTree()

uint AABBTreeBuilder::Node::GetTriangleCountInTree ( ) const

Get triangle count in tree.

◆ GetTriangleCountPerNode()

void AABBTreeBuilder::Node::GetTriangleCountPerNode ( float &  outAverage,
uint outMin,
uint outMax 
) const

Calculate min and max triangles per node.

◆ HasChildren()

bool AABBTreeBuilder::Node::HasChildren ( ) const
inline

Check if this node has any children.

Friends And Related Function Documentation

◆ AABBTreeBuilder

friend class AABBTreeBuilder
friend

Member Data Documentation

◆ mBounds

AABox AABBTreeBuilder::Node::mBounds

Bounding box.

◆ mChild

Node* AABBTreeBuilder::Node::mChild[2]

Child nodes (if no triangles)

◆ mTriangles

IndexedTriangleList AABBTreeBuilder::Node::mTriangles

Triangles (if no child nodes)


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