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>

Public Member Functions

uint GetTriangleCount () const
 Get number of triangles in this node.
 
bool HasChildren () const
 Check if this node has any children.
 
uint GetMinDepth (const Array< Node > &inNodes) const
 Min depth of tree.
 
uint GetMaxDepth (const Array< Node > &inNodes) const
 Max depth of tree.
 
uint GetNodeCount (const Array< Node > &inNodes) const
 Number of nodes in tree.
 
uint GetLeafNodeCount (const Array< Node > &inNodes) const
 Number of leaf nodes in tree.
 
uint GetTriangleCountInTree (const Array< Node > &inNodes) const
 Get triangle count in tree.
 
void GetTriangleCountPerNode (const Array< Node > &inNodes, float &outAverage, uint &outMin, uint &outMax) const
 Calculate min and max triangles per node.
 
float CalculateSAHCost (const Array< Node > &inNodes, float inCostTraversal, float inCostLeaf) const
 Calculate the total cost of the tree using the surface area heuristic.
 
void GetNChildren (const Array< Node > &inNodes, 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)
 

Public Attributes

AABox mBounds
 Bounding box.
 
uint mTrianglesBegin
 Triangles (if no child nodes)
 
uint mNumTriangles = 0
 
uint mChild [2] = { cInvalidNodeIndex, cInvalidNodeIndex }
 Child node indices (if no triangles)
 

Static Public Attributes

static JPH_OVERRIDE_NEW_DELETE constexpr uint cInvalidNodeIndex = ~uint(0)
 Indicates that there is no child.
 

Friends

class AABBTreeBuilder
 

Detailed Description

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

Member Function Documentation

◆ CalculateSAHCost()

float AABBTreeBuilder::Node::CalculateSAHCost ( const Array< Node > &  inNodes,
float  inCostTraversal,
float  inCostLeaf 
) const

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

◆ GetLeafNodeCount()

uint AABBTreeBuilder::Node::GetLeafNodeCount ( const Array< Node > &  inNodes) const

Number of leaf nodes in tree.

◆ GetMaxDepth()

uint AABBTreeBuilder::Node::GetMaxDepth ( const Array< Node > &  inNodes) const

Max depth of tree.

◆ GetMinDepth()

JPH_NAMESPACE_BEGIN uint AABBTreeBuilder::Node::GetMinDepth ( const Array< Node > &  inNodes) const

Min depth of tree.

◆ GetNChildren()

void AABBTreeBuilder::Node::GetNChildren ( const Array< Node > &  inNodes,
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 Array< Node > &  inNodes) 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 Array< Node > &  inNodes) const

Get triangle count in tree.

◆ GetTriangleCountPerNode()

void AABBTreeBuilder::Node::GetTriangleCountPerNode ( const Array< Node > &  inNodes,
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 Symbol Documentation

◆ AABBTreeBuilder

friend class AABBTreeBuilder
friend

Member Data Documentation

◆ cInvalidNodeIndex

JPH_OVERRIDE_NEW_DELETE constexpr uint AABBTreeBuilder::Node::cInvalidNodeIndex = ~uint(0)
staticconstexpr

Indicates that there is no child.

◆ mBounds

AABox AABBTreeBuilder::Node::mBounds

Bounding box.

◆ mChild

uint AABBTreeBuilder::Node::mChild[2] = { cInvalidNodeIndex, cInvalidNodeIndex }

Child node indices (if no triangles)

◆ mNumTriangles

uint AABBTreeBuilder::Node::mNumTriangles = 0

◆ mTrianglesBegin

uint AABBTreeBuilder::Node::mTrianglesBegin

Triangles (if no child nodes)


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