Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DBVHManager Class Reference

The U4DBVHManager class represents the Boundary Volume Hierarchy manager. More...

Public Member Functions

 U4DBVHManager ()
 Constructor of the class.
 
 ~U4DBVHManager ()
 Destructor of the class.
 
void buildBVH ()
 Method which starts building the BVH algorithm.
 
void buildBVHNode (U4DBVHNode< U4DDynamicAction > *uNode, int uLeftIndex, int uSplitIndex)
 Method which builds a BVH tree node. More...
 
std::vector< U4DDynamicAction * > getModelsContainer ()
 Method which returns all 3D entities in the BVH tree. More...
 
void calculateBVHVolume (U4DBVHNode< U4DDynamicAction > *uNode)
 Method which computes a BVH node volume. More...
 
void getBVHLongestDimensionVector (U4DBVHNode< U4DDynamicAction > *uNode)
 Method which computes the BVH node longest dimension vector. More...
 
void getBVHSplitIndex (U4DBVHNode< U4DDynamicAction > *uNode)
 Method which computes a BVH node split index. More...
 
void addModelToTreeContainer (U4DDynamicAction *uAction)
 Method which adds a model to the model container. More...
 
void startCollision ()
 Method which starts testing Broad-Phase collisions.
 
void heapSorting (U4DBVHNode< U4DDynamicAction > *uNode)
 Method to heap sort the BVH tree nodes. More...
 
void reHeapDown (U4DBVHNode< U4DDynamicAction > *uNode, int root, int bottom)
 Method used to heap-down sort the BVH tree nodes. More...
 
void swap (U4DBVHNode< U4DDynamicAction > *uNode, int uindex1, int uindex2)
 Method used to swap the BVH tree node's array index. More...
 
std::vector< U4DBroadPhaseCollisionModelPairgetBroadPhaseCollisionPairs ()
 Method which returns all broad-phase collision pairs. More...
 
void clearContainers ()
 Method which clears all broad-phase collision containers.
 

Public Attributes

std::vector< U4DBroadPhaseCollisionModelPairbroadPhaseCollisionPairs
 Container to the Broad-Phase collision pair.
 
std::vector< std::shared_ptr< U4DBVHNode< U4DDynamicAction > > > treeContainer
 Smart pointer to the root tree container.
 

Detailed Description

The U4DBVHManager class represents the Boundary Volume Hierarchy manager.

Member Function Documentation

◆ addModelToTreeContainer()

void U4DEngine::U4DBVHManager::addModelToTreeContainer ( U4DDynamicAction uAction)

Method which adds a model to the model container.

Parameters
uActionDynamic action

◆ buildBVHNode()

void U4DEngine::U4DBVHManager::buildBVHNode ( U4DBVHNode< U4DDynamicAction > *  uNode,
int  uLeftIndex,
int  uSplitIndex 
)

Method which builds a BVH tree node.

Parameters
uNodeTree node
uLeftIndexLeft index
uSplitIndexSplit index

◆ calculateBVHVolume()

void U4DEngine::U4DBVHManager::calculateBVHVolume ( U4DBVHNode< U4DDynamicAction > *  uNode)

Method which computes a BVH node volume.

Parameters
uNodeBVH tree node

◆ getBroadPhaseCollisionPairs()

std::vector< U4DBroadPhaseCollisionModelPair > U4DEngine::U4DBVHManager::getBroadPhaseCollisionPairs ( )

Method which returns all broad-phase collision pairs.

Returns
Returns all broad-phase collision pairs

◆ getBVHLongestDimensionVector()

void U4DEngine::U4DBVHManager::getBVHLongestDimensionVector ( U4DBVHNode< U4DDynamicAction > *  uNode)

Method which computes the BVH node longest dimension vector.

Parameters
uNodeBVH tree node

◆ getBVHSplitIndex()

void U4DEngine::U4DBVHManager::getBVHSplitIndex ( U4DBVHNode< U4DDynamicAction > *  uNode)

Method which computes a BVH node split index.

Parameters
uNodeBVH tree node

◆ getModelsContainer()

std::vector< U4DDynamicAction * > U4DEngine::U4DBVHManager::getModelsContainer ( )

Method which returns all 3D entities in the BVH tree.

Returns
Returns all 3D entities in the BVH tree

◆ heapSorting()

void U4DEngine::U4DBVHManager::heapSorting ( U4DBVHNode< U4DDynamicAction > *  uNode)

Method to heap sort the BVH tree nodes.

Parameters
uNodeBVH tree node

◆ reHeapDown()

void U4DEngine::U4DBVHManager::reHeapDown ( U4DBVHNode< U4DDynamicAction > *  uNode,
int  root,
int  bottom 
)

Method used to heap-down sort the BVH tree nodes.

Parameters
uNodeBVH tree node
rootIndex of root node
bottombottom index

◆ swap()

void U4DEngine::U4DBVHManager::swap ( U4DBVHNode< U4DDynamicAction > *  uNode,
int  uindex1,
int  uindex2 
)

Method used to swap the BVH tree node's array index.

Parameters
uNodeBVH tree node
uindex1Node array index
uindex2Node array index