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

The U4DVisibilityManager class tests whether a model is within the camera frustum. More...

Public Member Functions

 U4DVisibilityManager ()
 class constructor
 
 ~U4DVisibilityManager ()
 class destructor
 
void buildBVH ()
 Method which starts building the BVH algorithm.
 
void buildBVHNode (U4DBVHNode< U4DModel > *uNode, int uLeftIndex, int uSplitIndex)
 Method which builds a BVH tree node. More...
 
std::vector< U4DModel * > getModelsContainer ()
 Method which returns all 3D entities in the BVH tree. More...
 
void calculateBVHVolume (U4DBVHNode< U4DModel > *uNode)
 Method which computes a BVH node volume. More...
 
void getBVHLongestDimensionVector (U4DBVHNode< U4DModel > *uNode)
 Method which computes the BVH node longest dimension vector. More...
 
void getBVHSplitIndex (U4DBVHNode< U4DModel > *uNode)
 Method which computes a BVH node split index. More...
 
void addModelToTreeContainer (U4DModel *uModel)
 Method which adds a model to the model container. More...
 
void heapSorting (U4DBVHNode< U4DModel > *uNode)
 Method to heap sort the BVH tree nodes. More...
 
void reHeapDown (U4DBVHNode< U4DModel > *uNode, int root, int bottom)
 Method used to heap-down sort the BVH tree nodes. More...
 
void swap (U4DBVHNode< U4DModel > *uNode, int uindex1, int uindex2)
 Method used to swap the BVH tree node's array index. More...
 
void startFrustumIntersection (std::vector< U4DPlane > &uPlanes)
 Starts the frustum vs model culling test. More...
 
void clearContainers ()
 Method which clears all broad-phase collision containers.
 
void setPauseBVHFBuild (bool uValue)
 method to inform that the bvh should be built. This method sets a flag but does not initiate construction of the bvh More...
 
bool getPauseBVHBuild ()
 method that returns if the manager should build the BVH More...
 
void startTimerForNextBVHBuild ()
 This methods starts the timer for the next bvh build. Note, it simply starts a timer. Once the time has elapsed, it sets the computeBVHFlag. It does not initiate the construction of the bvh.
 
void bvhTimerIntervalElapsed ()
 Method that is called by the scheduler once the time interval has elapsed.
 
void changeVisibilityInterval (float uValue)
 change the current visibility interval. The default is 0.5. More...
 

Detailed Description

The U4DVisibilityManager class tests whether a model is within the camera frustum.

Member Function Documentation

◆ addModelToTreeContainer()

void U4DEngine::U4DVisibilityManager::addModelToTreeContainer ( U4DModel uModel)

Method which adds a model to the model container.

Parameters
uModel3D model entity

◆ buildBVHNode()

void U4DEngine::U4DVisibilityManager::buildBVHNode ( U4DBVHNode< U4DModel > *  uNode,
int  uLeftIndex,
int  uSplitIndex 
)

Method which builds a BVH tree node.

Parameters
uNodeTree node
uLeftIndexLeft index
uSplitIndexSplit index

◆ calculateBVHVolume()

void U4DEngine::U4DVisibilityManager::calculateBVHVolume ( U4DBVHNode< U4DModel > *  uNode)

Method which computes a BVH node volume.

Parameters
uNodeBVH tree node

◆ changeVisibilityInterval()

void U4DEngine::U4DVisibilityManager::changeVisibilityInterval ( float  uValue)

change the current visibility interval. The default is 0.5.

This interval determines how fast the BVH is computed to determine which 3D models are within the camera frustum. The lower this interval, the faster the BVH is computed.

Parameters
uValuetime interval.

◆ getBVHLongestDimensionVector()

void U4DEngine::U4DVisibilityManager::getBVHLongestDimensionVector ( U4DBVHNode< U4DModel > *  uNode)

Method which computes the BVH node longest dimension vector.

Parameters
uNodeBVH tree node

◆ getBVHSplitIndex()

void U4DEngine::U4DVisibilityManager::getBVHSplitIndex ( U4DBVHNode< U4DModel > *  uNode)

Method which computes a BVH node split index.

Parameters
uNodeBVH tree node

◆ getModelsContainer()

std::vector< U4DModel * > U4DEngine::U4DVisibilityManager::getModelsContainer ( )

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

Returns
Returns all 3D entities in the BVH tree

◆ getPauseBVHBuild()

bool U4DEngine::U4DVisibilityManager::getPauseBVHBuild ( )

method that returns if the manager should build the BVH

Returns
returns true if the manager should build the bvh. Note, it does not initiate initiate construcion of the bvh

◆ heapSorting()

void U4DEngine::U4DVisibilityManager::heapSorting ( U4DBVHNode< U4DModel > *  uNode)

Method to heap sort the BVH tree nodes.

Parameters
uNodeBVH tree node

◆ reHeapDown()

void U4DEngine::U4DVisibilityManager::reHeapDown ( U4DBVHNode< U4DModel > *  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

◆ setPauseBVHFBuild()

void U4DEngine::U4DVisibilityManager::setPauseBVHFBuild ( bool  uValue)

method to inform that the bvh should be built. This method sets a flag but does not initiate construction of the bvh

Parameters
uValuevalue to inform the manager to build the bvh

◆ startFrustumIntersection()

void U4DEngine::U4DVisibilityManager::startFrustumIntersection ( std::vector< U4DPlane > &  uPlanes)

Starts the frustum vs model culling test.

Parameters
uPlanesfrustum planes

◆ swap()

void U4DEngine::U4DVisibilityManager::swap ( U4DBVHNode< U4DModel > *  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