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

The U4DMeshOctreeManager class builds an octree bounding a 3d model. More...

Public Member Functions

 U4DMeshOctreeManager (U4DModel *uModel)
 constructor for the U4DMeshOctreeManager. The constructor transforms the 3d mesh faces from local space to absolute space More...
 
 ~U4DMeshOctreeManager ()
 Destructor for the U4DMeshOctreeManager.
 
void buildOctree (int uSubDivisions)
 Builds the octree. More...
 
void buildOctreeNode (U4DMeshOctreeNode *uNode, U4DPoint3n &uCenter, float uHalfwidth, int uSubDivisions)
 Builds the octree nodes. More...
 
void assignFacesToNodeLeaf ()
 Assigns triangles(faces) of the 3D model mesh to node leaves.
 
U4DMeshOctreeNodegetRootNode ()
 Returns a pointer to the octree.
 
void computeMeshFacesAbsoluteSpace ()
 Transforms the mesh faces of the 3D model from local space to absolute space.
 
std::vector< U4DTrianglegetMeshFacesAbsoluteSpaceContainer ()
 returns the mesh faces in absolute space
 

Detailed Description

The U4DMeshOctreeManager class builds an octree bounding a 3d model.

Constructor & Destructor Documentation

◆ U4DMeshOctreeManager()

U4DEngine::U4DMeshOctreeManager::U4DMeshOctreeManager ( U4DModel uModel)

constructor for the U4DMeshOctreeManager. The constructor transforms the 3d mesh faces from local space to absolute space

Parameters
uModelpointer to the model whose octree will be based on

Member Function Documentation

◆ buildOctree()

void U4DEngine::U4DMeshOctreeManager::buildOctree ( int  uSubDivisions)

Builds the octree.

Builds an octree for the 3D model using AABB boxes

Parameters
uSubDivisionsThe subdivisions used for the octree. 1 subdivision=9 nodes, 2 subdivisions=73 node, 3 subdivisions=585 nodes

◆ buildOctreeNode()

void U4DEngine::U4DMeshOctreeManager::buildOctreeNode ( U4DMeshOctreeNode uNode,
U4DPoint3n uCenter,
float  uHalfwidth,
int  uSubDivisions 
)

Builds the octree nodes.

Parameters
uNodeOctree node
uCentercenter of the AABB box
uSubDivisionscurrent subdivision of the the octree